Package ca.cgjennings.ui
Class MnemonicInstaller
- java.lang.Object
-
- ca.cgjennings.ui.MnemonicInstaller
-
public class MnemonicInstaller extends java.lang.Object
A 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 int
ALL
static int
BUTTONS
static int
LABELS
static int
MENUS
static int
TOGGLE_BUTTONS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getMask()
Returns the bitmask of component types that the manager will automatically handle mnemonics for.static boolean
isMnemonicHidden()
Returnstrue
if mnemonic letters will not be marked within the UI.static void
setMask(int mask)
Sets the bitmask that determines which control types to manage.static void
setMnemonicHidden(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()
Returnstrue
if mnemonic letters will not be marked within the UI.- Returns:
true
if 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
-
-