public final class HotkeyManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.Map<java.awt.Container,java.util.List<HotkeyCondition>> |
containerConditions
Conditions for top components which might.
|
protected static java.util.Map<java.awt.Component,java.util.List<HotkeyInfo>> |
hotkeys
Added hotkeys.
|
protected static boolean |
hotkeysEnabled
Global hotkeys block flag.
|
protected static boolean |
initialized
Initialization mark.
|
protected static java.lang.Object |
sync
Synchronization object.
|
protected static boolean |
transferFocus
Pass focus to fired hotkey component.
|
| Constructor and Description |
|---|
HotkeyManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addContainerHotkeyCondition(java.awt.Container container,
HotkeyCondition hotkeyCondition)
Sets top component additional hotkey trigger condition
|
protected static void |
cacheHotkey(HotkeyInfo hotkeyInfo)
Hotkeys cache methods
|
protected static void |
clearHotkeyCache(HotkeyInfo hotkeyInfo) |
protected static void |
clearHotkeysCache(java.awt.Component component) |
protected static void |
clearHotkeysCache(java.util.List<HotkeyInfo> hotkeys) |
protected static java.util.Map<java.awt.Container,java.util.List<HotkeyCondition>> |
copyContainerConditions() |
protected static java.util.Map<java.awt.Component,java.util.List<HotkeyInfo>> |
copyHotkeys()
Returns a full copy of hotkeys map.
|
protected static HotkeyRunnable |
createAction(javax.swing.AbstractButton forComponent) |
static void |
disableHotkeys()
Global hotkey block
|
static void |
enableHotkeys() |
static java.util.Map<java.awt.Component,java.util.List<HotkeyInfo>> |
getAllHotkeys()
All added hotkeys.
|
static java.util.List<HotkeyInfo> |
getComponentHotkeys(java.awt.Component component)
Hotkeys retrieval methods
|
protected static java.util.List<HotkeyInfo> |
getComponentHotkeysCache(java.awt.Component component) |
static java.lang.String |
getComponentHotkeysString(java.awt.Component component)
All component hotkeys list
|
protected static java.lang.String |
getComponentHotkeysString(java.util.List<HotkeyInfo> infoList) |
static java.util.List<HotkeyCondition> |
getContainerHotkeyConditions(java.awt.Container container) |
protected static java.util.List<HotkeyCondition> |
getContainerHotkeyConditionsCache(java.awt.Container container) |
protected static boolean |
hotkeyForEventExists(java.awt.event.KeyEvent keyEvent)
Returns whether at least one hotkey for the specified key event exists or not.
|
static void |
initialize()
Initializes hotkey manager.
|
static void |
installShowAllHotkeysAction(java.awt.Component topComponent)
Installs "show all hotkeys" action on window or component
|
static void |
installShowAllHotkeysAction(java.awt.Component topComponent,
HotkeyData hotkeyData) |
static boolean |
isTransferFocus()
Should transfer focus to fired hotkey component or not
|
protected static boolean |
meetsParentConditions(java.awt.Component forComponent) |
protected static void |
processHotkeys(java.awt.event.KeyEvent e)
Processes all available registered hotkeys.
|
static HotkeyInfo |
registerHotkey(javax.swing.AbstractButton forComponent,
HotkeyData hotkeyData)
Button-specific hotkey register methods
|
static HotkeyInfo |
registerHotkey(javax.swing.AbstractButton forComponent,
HotkeyData hotkeyData,
boolean hidden) |
static HotkeyInfo |
registerHotkey(javax.swing.AbstractButton forComponent,
HotkeyData hotkeyData,
com.alee.managers.language.data.TooltipWay tooltipWay) |
static HotkeyInfo |
registerHotkey(java.awt.Component topComponent,
javax.swing.AbstractButton forComponent,
HotkeyData hotkeyData) |
static HotkeyInfo |
registerHotkey(java.awt.Component topComponent,
javax.swing.AbstractButton forComponent,
HotkeyData hotkeyData,
boolean hidden) |
static HotkeyInfo |
registerHotkey(java.awt.Component topComponent,
javax.swing.AbstractButton forComponent,
HotkeyData hotkeyData,
com.alee.managers.language.data.TooltipWay tooltipWay) |
static HotkeyInfo |
registerHotkey(java.awt.Component topComponent,
java.awt.Component forComponent,
HotkeyData hotkeyData,
HotkeyRunnable action) |
static HotkeyInfo |
registerHotkey(java.awt.Component topComponent,
java.awt.Component forComponent,
HotkeyData hotkeyData,
HotkeyRunnable action,
boolean hidden) |
static HotkeyInfo |
registerHotkey(java.awt.Component topComponent,
java.awt.Component forComponent,
HotkeyData hotkeyData,
HotkeyRunnable action,
boolean hidden,
com.alee.managers.language.data.TooltipWay tooltipWay) |
static HotkeyInfo |
registerHotkey(java.awt.Component topComponent,
java.awt.Component forComponent,
HotkeyData hotkeyData,
HotkeyRunnable action,
com.alee.managers.language.data.TooltipWay tooltipWay) |
static HotkeyInfo |
registerHotkey(java.awt.Component forComponent,
HotkeyData hotkeyData,
HotkeyRunnable action) |
static HotkeyInfo |
registerHotkey(java.awt.Component forComponent,
HotkeyData hotkeyData,
HotkeyRunnable action,
boolean hidden) |
static HotkeyInfo |
registerHotkey(HotkeyData hotkeyData,
HotkeyRunnable action)
Hotkey register methods
|
static void |
removeContainerHotkeyCondition(java.awt.Container container,
HotkeyCondition hotkeyCondition) |
static void |
removeContainerHotkeyConditions(java.awt.Container container) |
static void |
setComponentHotkeyDisplayWay(java.awt.Component component,
com.alee.managers.language.data.TooltipWay tooltipWay)
Sets component hotkey tip way
|
static void |
setTransferFocus(boolean transferFocus) |
static void |
showComponentHotkeys()
Shows all visible components hotkeys
|
static void |
showComponentHotkeys(java.awt.Component component) |
protected static void |
showComponentHotkeys(java.awt.Window window) |
static void |
unregisterHotkey(HotkeyInfo hotkeyInfo)
Hotkey removal methods
|
static void |
unregisterHotkeys(java.awt.Component component) |
protected static final java.lang.Object sync
protected static boolean hotkeysEnabled
protected static boolean transferFocus
protected static java.util.Map<java.awt.Component,java.util.List<HotkeyInfo>> hotkeys
protected static java.util.Map<java.awt.Container,java.util.List<HotkeyCondition>> containerConditions
protected static boolean initialized
public static void initialize()
protected static java.util.Map<java.awt.Component,java.util.List<HotkeyInfo>> copyHotkeys()
protected static java.util.Map<java.awt.Container,java.util.List<HotkeyCondition>> copyContainerConditions()
protected static boolean hotkeyForEventExists(java.awt.event.KeyEvent keyEvent)
keyEvent - key event to search hotkeys forprotected static void processHotkeys(java.awt.event.KeyEvent e)
e - key eventprotected static boolean meetsParentConditions(java.awt.Component forComponent)
public static HotkeyInfo registerHotkey(HotkeyData hotkeyData, HotkeyRunnable action)
public static HotkeyInfo registerHotkey(java.awt.Component forComponent, HotkeyData hotkeyData, HotkeyRunnable action)
public static HotkeyInfo registerHotkey(java.awt.Component forComponent, HotkeyData hotkeyData, HotkeyRunnable action, boolean hidden)
public static HotkeyInfo registerHotkey(java.awt.Component topComponent, java.awt.Component forComponent, HotkeyData hotkeyData, HotkeyRunnable action)
public static HotkeyInfo registerHotkey(java.awt.Component topComponent, java.awt.Component forComponent, HotkeyData hotkeyData, HotkeyRunnable action, com.alee.managers.language.data.TooltipWay tooltipWay)
public static HotkeyInfo registerHotkey(java.awt.Component topComponent, java.awt.Component forComponent, HotkeyData hotkeyData, HotkeyRunnable action, boolean hidden)
public static HotkeyInfo registerHotkey(java.awt.Component topComponent, java.awt.Component forComponent, HotkeyData hotkeyData, HotkeyRunnable action, boolean hidden, com.alee.managers.language.data.TooltipWay tooltipWay)
public static HotkeyInfo registerHotkey(javax.swing.AbstractButton forComponent, HotkeyData hotkeyData)
public static HotkeyInfo registerHotkey(javax.swing.AbstractButton forComponent, HotkeyData hotkeyData, boolean hidden)
public static HotkeyInfo registerHotkey(javax.swing.AbstractButton forComponent, HotkeyData hotkeyData, com.alee.managers.language.data.TooltipWay tooltipWay)
public static HotkeyInfo registerHotkey(java.awt.Component topComponent, javax.swing.AbstractButton forComponent, HotkeyData hotkeyData)
public static HotkeyInfo registerHotkey(java.awt.Component topComponent, javax.swing.AbstractButton forComponent, HotkeyData hotkeyData, com.alee.managers.language.data.TooltipWay tooltipWay)
public static HotkeyInfo registerHotkey(java.awt.Component topComponent, javax.swing.AbstractButton forComponent, HotkeyData hotkeyData, boolean hidden)
protected static HotkeyRunnable createAction(javax.swing.AbstractButton forComponent)
public static void setComponentHotkeyDisplayWay(java.awt.Component component,
com.alee.managers.language.data.TooltipWay tooltipWay)
public static void addContainerHotkeyCondition(java.awt.Container container,
HotkeyCondition hotkeyCondition)
public static void removeContainerHotkeyCondition(java.awt.Container container,
HotkeyCondition hotkeyCondition)
public static void removeContainerHotkeyConditions(java.awt.Container container)
public static java.util.List<HotkeyCondition> getContainerHotkeyConditions(java.awt.Container container)
protected static java.util.List<HotkeyCondition> getContainerHotkeyConditionsCache(java.awt.Container container)
public static void unregisterHotkey(HotkeyInfo hotkeyInfo)
public static void unregisterHotkeys(java.awt.Component component)
public static java.util.List<HotkeyInfo> getComponentHotkeys(java.awt.Component component)
public static java.util.Map<java.awt.Component,java.util.List<HotkeyInfo>> getAllHotkeys()
protected static void cacheHotkey(HotkeyInfo hotkeyInfo)
protected static void clearHotkeyCache(HotkeyInfo hotkeyInfo)
protected static void clearHotkeysCache(java.util.List<HotkeyInfo> hotkeys)
protected static void clearHotkeysCache(java.awt.Component component)
protected static java.util.List<HotkeyInfo> getComponentHotkeysCache(java.awt.Component component)
public static void showComponentHotkeys()
public static void showComponentHotkeys(java.awt.Component component)
protected static void showComponentHotkeys(java.awt.Window window)
public static void installShowAllHotkeysAction(java.awt.Component topComponent)
public static void installShowAllHotkeysAction(java.awt.Component topComponent,
HotkeyData hotkeyData)
public static java.lang.String getComponentHotkeysString(java.awt.Component component)
protected static java.lang.String getComponentHotkeysString(java.util.List<HotkeyInfo> infoList)
public static void disableHotkeys()
public static void enableHotkeys()
public static boolean isTransferFocus()
public static void setTransferFocus(boolean transferFocus)