|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jgoodies.common.swing.MnemonicUtils
public final class MnemonicUtils
Configures the text, mnemonic and mnemonic index in Actions, JLabels and AbstractButtons. The term marked text is used for String that contain a marker character that marks both the mnemonic an its index in the resulting plain text.
Marked TextPlain TextMnemonicMnemonic IndexCommentSaveSave0-1No mnemonic&SaveSave'S'0 Save &asSave as'A'5Second 'a' markedLook&FeelLookFeel'F'4& should be quotedLook&&FeelLook&Feel0-1& is quoted&Look&FeelLook&FeelL0Second & needs no quoteLook & FeelLook & Feel0-1Whitespace cannot be markedR&&D D&epartmentR&D Department'E'5First & is quoted<html>a&b</html><html>a<u>b</u></html>'B'-1'b' is underlined<html>R&D D&ep.</html><html>R&D D<u>e</u>p.</html>'B'-1HTML & doesn't mark
| Method Summary | |
|---|---|
static void |
configure(AbstractButton target,
String markedText)
Configures the text, mnemonic and mnemonic index for target
|
static void |
configure(Action target,
String markedText)
Configures the text, mnemonic and mnemonic index for target
|
static void |
configure(JLabel target,
String markedText)
Configures the text, mnemonic and mnemonic index for target
|
static String |
plainText(String markedText)
Returns the plain text for the given marked text by removin the mnemonic marker and marker quotes - if any. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void configure(AbstractButton target,
String markedText)
targetmarkedText is "Save &as", the tex
will be set to "Save as", the mnemonic is 'a', and th
mnemonic index is 5.
target - the button to be configuredmarkedText - the text with optional mnemonic marker
NullPointerException - if target is null
public static void configure(Action target,
String markedText)
targetmarkedText is "Save &as", the tex
will be set to "Save as", the mnemonic is 'a', and th
mnemonic index is 5.
target - the Action to be configuredmarkedText - the text with optional mnemonic marker
NullPointerException - if target is null
public static void configure(JLabel target,
String markedText)
targetmarkedText is "Save &as", the tex
will be set to "Save as", the mnemonic is 'a', and th
mnemonic index is 5.
target - the label to be configuredmarkedText - the text with optional mnemonic marker
NullPointerException - if target is nullpublic static String plainText(String markedText)
MnemonicUtils class comment for informatio
about how to mark a mnemonic and how to quote a marker
markedText - the text that may contain a mnemonic marker
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||