public final class MnemonicUtils extends Object
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
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 markerNullPointerException - if target is nullpublic 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 markerNullPointerException - if target is nullpublic 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 markerNullPointerException - 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 markerCopyright © 2009-2014 JGoodies Software GmbH. All Rights Reserved.