com.jidesoft.grid
Class KeyStrokeSupport
java.lang.Object
com.jidesoft.grid.KeyStrokeSupport
public class KeyStrokeSupport
- extends Object
Collection of static methods providing default implementations for KeyStroke-related tests.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KeyStrokeSupport
public KeyStrokeSupport()
lookAheadHierarchyMightProcess
public static boolean lookAheadHierarchyMightProcess(JComponent comp,
KeyStroke ks)
- Walk up the Swing Hierarchy starting at the specified JComponent and determine if any Container is likely to be
able to process a key binding for the specified keystroke.
Modeled after part of JComponent's protected processKeyBindings method. Instead of asking each Container to
processKeyBinding, just ask if the binding is in the input/action map.
Note that if nothing in the hierarchy is interested, we can't complete the process described in
JComponent.processKeyBindings by asking a JInternalFrame or Window to processKeyBindingsForAllComponents. That
method is protected and would be pretty complicated to work around.
- Parameters:
comp
- the component to start with and work upward fromks
- the specified keystroke
- Returns:
- Is it in an ancestor's input/action map?
canProcessKeyBinding
public static boolean canProcessKeyBinding(JComponent comp,
KeyStroke ks,
int condition)
- Is the specified keystroke/condition in the specified JComponent's input and action maps?
- Parameters:
comp
- the specified JComponentks
- the specified keystrokecondition
- the specified condition (KeyEvent.WHEN_FOCUSED, KeyEvent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
KeyEvent.WHEN_IN_FOCUSED_WINDOW)
- Returns:
- Is it? Not necessarily the same as what will be returned by actually executing the action, which can fail.
isValidKeyForDefaultTableEditor
public static boolean isValidKeyForDefaultTableEditor(KeyEvent e,
KeyStroke ks)
isModifierKey
public static boolean isModifierKey(KeyEvent e)
isTableNavigationKey
public static boolean isTableNavigationKey(KeyStroke ks)