Package com.formdev.flatlaf
Class MnemonicHandler
- java.lang.Object
-
- com.formdev.flatlaf.MnemonicHandler
-
- All Implemented Interfaces:
java.awt.KeyEventPostProcessor,java.util.EventListener,javax.swing.event.ChangeListener
class MnemonicHandler extends java.lang.Object implements java.awt.KeyEventPostProcessor, javax.swing.event.ChangeListenerShow/hide mnemonics.
-
-
Field Summary
Fields Modifier and Type Field Description private static intaltPressedEventCountprivate static java.lang.ref.WeakReference<java.awt.Window>lastShowMnemonicWindowprivate static booleanselectMenuOnAltReleasedprivate static booleanshowMnemonicsprivate static java.awt.event.WindowListenerwindowListener
-
Constructor Summary
Constructors Constructor Description MnemonicHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static booleanhasMnemonic(java.awt.Component c)(package private) voidinstall()(package private) static booleanisShowMnemonics()booleanpostProcessKeyEvent(java.awt.event.KeyEvent e)private booleanprocessKeyEventOnWindows(java.awt.event.KeyEvent e)Special Alt key behavior on Windows.private static voidrepaintMnemonics(java.awt.Container container)private booleanshouldShowMnemonics(java.awt.event.KeyEvent e)(package private) static voidshowMnemonics(boolean show, java.awt.Component c)voidstateChanged(javax.swing.event.ChangeEvent e)(package private) voiduninstall()
-
-
-
Field Detail
-
showMnemonics
private static boolean showMnemonics
-
lastShowMnemonicWindow
private static java.lang.ref.WeakReference<java.awt.Window> lastShowMnemonicWindow
-
windowListener
private static java.awt.event.WindowListener windowListener
-
altPressedEventCount
private static int altPressedEventCount
-
selectMenuOnAltReleased
private static boolean selectMenuOnAltReleased
-
-
Method Detail
-
isShowMnemonics
static boolean isShowMnemonics()
-
install
void install()
-
uninstall
void uninstall()
-
postProcessKeyEvent
public boolean postProcessKeyEvent(java.awt.event.KeyEvent e)
- Specified by:
postProcessKeyEventin interfacejava.awt.KeyEventPostProcessor
-
shouldShowMnemonics
private boolean shouldShowMnemonics(java.awt.event.KeyEvent e)
-
processKeyEventOnWindows
private boolean processKeyEventOnWindows(java.awt.event.KeyEvent e)
Special Alt key behavior on Windows. Press-and-release Alt key selects first menu (if available) and moves focus temporary to menu bar. If menu bar has focus (some menu is selected), pressing Alt key unselects menu and moves focus back to permanent focus owner.
-
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent e)
- Specified by:
stateChangedin interfacejavax.swing.event.ChangeListener
-
showMnemonics
static void showMnemonics(boolean show, java.awt.Component c)
-
repaintMnemonics
private static void repaintMnemonics(java.awt.Container container)
-
hasMnemonic
private static boolean hasMnemonic(java.awt.Component c)
-
-