Package ca.cgjennings.ui
Class MnemonicInstaller
- java.lang.Object
-
- ca.cgjennings.ui.MnemonicInstaller
-
public class MnemonicInstaller extends java.lang.ObjectA singleton class that that intercepts components, extracts a mnemonic key from the component's label or button text, and sets that as the the component's mnemonic key.- Author:
- Chris Jennings
-
-
Field Summary
Fields Modifier and Type Field Description static intALLstatic intBUTTONSstatic intLABELSstatic intMENUSstatic intTOGGLE_BUTTONS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetMask()Returns the bitmask of component types that the manager will automatically handle mnemonics for.static booleanisMnemonicHidden()Returnstrueif mnemonic letters will not be marked within the UI.static voidsetMask(int mask)Sets the bitmask that determines which control types to manage.static voidsetMnemonicHidden(boolean hide)Sets whether mnemonics will be displayed.
-
-
-
Field Detail
-
LABELS
public static final int LABELS
- See Also:
- Constant Field Values
-
MENUS
public static final int MENUS
- See Also:
- Constant Field Values
-
BUTTONS
public static final int BUTTONS
- See Also:
- Constant Field Values
-
TOGGLE_BUTTONS
public static final int TOGGLE_BUTTONS
- See Also:
- Constant Field Values
-
ALL
public static final int ALL
- See Also:
- Constant Field Values
-
-
Method Detail
-
setMnemonicHidden
public static void setMnemonicHidden(boolean hide)
Sets whether mnemonics will be displayed. When set totrue, mnemonic codes will still be extracted and set on components, but they will not be marked in the UI. For example, if mnemonic letters are normally underlined, this underlining will be disabled.- Parameters:
hide- iftrue, mnemonics will be hidden
-
isMnemonicHidden
public static boolean isMnemonicHidden()
Returnstrueif mnemonic letters will not be marked within the UI.- Returns:
trueif mnemonics are hidden- See Also:
setMnemonicHidden(boolean)
-
getMask
public static int getMask()
Returns the bitmask of component types that the manager will automatically handle mnemonics for.- Returns:
- the mask of component types
-
setMask
public static void setMask(int mask)
Sets the bitmask that determines which control types to manage. Setting the mask to 0 will disable automatic management of mnemonics.- Parameters:
mask- the logical or of the mask values for the control types to manage
-
-