oracle.ide.keyboard
Class KeyStrokesConstraintFactory
java.lang.Object
|
+--oracle.ide.keyboard.KeyStrokesConstraintFactory
- All Implemented Interfaces:
- KeyStrokesConstraint
- public final class KeyStrokesConstraintFactory
- extends java.lang.Object
- implements KeyStrokesConstraint
KeyStrokesConstraintFactory is a factory of KeyStrokeConstraint.
Since I only expect two KeyStrokeConstraint, this factory builds them.
The first factory, TYPE_ALL, accepts any key. The second, TYPE_TEXT_EDITOR,
Does not allow shortcuts that do not start with a modifier (Ctrl, Alt, ...)
or with the Shift modifier (in clear, it refuses "A", "Shift+A",... but
accepts "Ctrl+A", "Ctrl+A, A", "Ctrl+Shift+A", ...
This class implements KeyStrokesConstraint for internal reasons only.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TYPE_ALL
public static final int TYPE_ALL
- KeyStrokesConstraint ID.
TYPE_TEXT_EDITOR
public static final int TYPE_TEXT_EDITOR
- KeyStrokesConstraint ID.
isAcceptableKey
public boolean isAcceptableKey(KeyStrokes kss,
javax.swing.KeyStroke ksNew)
- Implements KeyStrokesConstraint
- Specified by:
isAcceptableKey
in interface KeyStrokesConstraint
getConstraint
public static KeyStrokesConstraint getConstraint(int nType)
- Parameters:
nType
- Valid values are TYPE_ALL and TYPE_TEXT_EDITOR- Returns:
- a predefined KeyStrokesConstraint.