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.ChangeListener
Show/hide mnemonics.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
altPressedEventCount
private static java.lang.ref.WeakReference<java.awt.Window>
lastShowMnemonicWindow
private static boolean
selectMenuOnAltReleased
private static boolean
showMnemonics
private static java.awt.event.WindowListener
windowListener
-
Constructor Summary
Constructors Constructor Description MnemonicHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static boolean
hasMnemonic(java.awt.Component c)
(package private) void
install()
(package private) static boolean
isShowMnemonics()
boolean
postProcessKeyEvent(java.awt.event.KeyEvent e)
private boolean
processKeyEventOnWindows(java.awt.event.KeyEvent e)
Special Alt key behavior on Windows.private static void
repaintMnemonics(java.awt.Container container)
private boolean
shouldShowMnemonics(java.awt.event.KeyEvent e)
(package private) static void
showMnemonics(boolean show, java.awt.Component c)
void
stateChanged(javax.swing.event.ChangeEvent e)
(package private) void
uninstall()
-
-
-
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:
postProcessKeyEvent
in 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:
stateChanged
in 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)
-
-