public class MnemonicSolver.MenuLabel
extends java.lang.Object
MenuLabel
class. Instances of this class encapsulate a
menu label.Modifier | Constructor and Description |
---|---|
protected |
MnemonicSolver.MenuLabel(javax.swing.AbstractButton menuItem,
boolean fixed)
Constructor.
|
protected |
MnemonicSolver.MenuLabel(javax.swing.AbstractButton menuItem,
java.lang.String text,
boolean fixed)
Constructor.
|
protected |
MnemonicSolver.MenuLabel(java.lang.String text)
Constructor.
|
protected |
MnemonicSolver.MenuLabel(java.lang.String text,
int mnemonic)
Constructor.
|
protected |
MnemonicSolver.MenuLabel(java.lang.String text,
int mnemonic,
boolean fixed)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
javax.swing.AbstractButton |
getMenuItem()
Gets the
AbstractButton associated with this menu label. |
int |
getMnemonic()
Returns the menu label mnemonics.
|
java.util.List |
getPotentialMnemonics()
Gets the recommended mnemonics list.
|
java.lang.String |
getText()
Returns the menu text.
|
void |
initMnemonic(int mnemonic)
Sets the menu label mnemonic.
|
boolean |
isFixed()
Indicates whether this menu label allows changing its mnemonic.
|
boolean |
isValidText(java.lang.String text)
Checks if the specified
text is not null and
has length. |
void |
setFixed(boolean fixed)
Set whether this menu label allows changing its mnmonic.
|
void |
setMenuItem(javax.swing.AbstractButton menuItem)
Sets the
AbstractButton associated with this menu label. |
void |
setMnemonic(int mnemonic)
Sets the menu label mnemonics.
|
void |
setPotentialMnemonics(java.util.List potentialMnemonics)
Sets the recommended mnemonics list.
|
void |
setText(java.lang.String text)
Sets the menu
text . |
protected MnemonicSolver.MenuLabel(java.lang.String text)
text
- The menu text.protected MnemonicSolver.MenuLabel(java.lang.String text, int mnemonic)
text
- The menu text.mnemonic
- The menu mnemonic.protected MnemonicSolver.MenuLabel(java.lang.String text, int mnemonic, boolean fixed)
text
- The menu text.mnemonic
- The menu mnemonic.fixed
- true
if this menu label does not allow
changingprotected MnemonicSolver.MenuLabel(javax.swing.AbstractButton menuItem, boolean fixed)
menuItem
- The menu whose mnemonic needs resolution.fixed
- true
if this menu label does not allow
changingprotected MnemonicSolver.MenuLabel(javax.swing.AbstractButton menuItem, java.lang.String text, boolean fixed)
menuItem
- The menu whose mnemonic needs resolution.text
- The menu text. Overrides the menuItem
text.fixed
- true
if this menu label does not allow
changingpublic java.lang.String getText()
public void setText(java.lang.String text)
text
.public int getMnemonic()
public void setMnemonic(int mnemonic)
public void initMnemonic(int mnemonic)
AbstractButton
,
it also sets it on the menu item.public boolean isFixed()
public void setFixed(boolean fixed)
public javax.swing.AbstractButton getMenuItem()
AbstractButton
associated with this menu label.public void setMenuItem(javax.swing.AbstractButton menuItem)
AbstractButton
associated with this menu label.public java.util.List getPotentialMnemonics()
public void setPotentialMnemonics(java.util.List potentialMnemonics)
public boolean isValidText(java.lang.String text)
text
is not null
and
has length.