Package org.eclipse.jface.bindings.keys
Class SWTKeyLookup
- java.lang.Object
-
- org.eclipse.jface.bindings.keys.SWTKeyLookup
-
- All Implemented Interfaces:
IKeyLookup
public final class SWTKeyLookup extends Object implements IKeyLookup
A look-up table for the formal grammar for keys, and the integer values they represent. This look-up table is hard-coded to use SWT representations. By replacing this class (and
SWTKeySupport), you can remove the dependency on SWT.- Since:
- 3.1
- See Also:
KeyLookupFactory
-
-
Field Summary
-
Fields inherited from interface org.eclipse.jface.bindings.keys.IKeyLookup
ALT_NAME, ARROW_DOWN_NAME, ARROW_LEFT_NAME, ARROW_RIGHT_NAME, ARROW_UP_NAME, BACKSPACE_NAME, BREAK_NAME, BS_NAME, CAPS_LOCK_NAME, COMMAND_NAME, CR_NAME, CTRL_NAME, DEL_NAME, DELETE_NAME, END_NAME, ENTER_NAME, ESC_NAME, ESCAPE_NAME, F1_NAME, F10_NAME, F11_NAME, F12_NAME, F13_NAME, F14_NAME, F15_NAME, F16_NAME, F17_NAME, F18_NAME, F19_NAME, F2_NAME, F20_NAME, F3_NAME, F4_NAME, F5_NAME, F6_NAME, F7_NAME, F8_NAME, F9_NAME, FF_NAME, HOME_NAME, INSERT_NAME, LF_NAME, M1_NAME, M2_NAME, M3_NAME, M4_NAME, NUL_NAME, NUM_LOCK_NAME, NUMPAD_0_NAME, NUMPAD_1_NAME, NUMPAD_2_NAME, NUMPAD_3_NAME, NUMPAD_4_NAME, NUMPAD_5_NAME, NUMPAD_6_NAME, NUMPAD_7_NAME, NUMPAD_8_NAME, NUMPAD_9_NAME, NUMPAD_ADD_NAME, NUMPAD_DECIMAL_NAME, NUMPAD_DIVIDE_NAME, NUMPAD_ENTER_NAME, NUMPAD_EQUAL_NAME, NUMPAD_MULTIPLY_NAME, NUMPAD_SUBTRACT_NAME, PAGE_DOWN_NAME, PAGE_UP_NAME, PAUSE_NAME, PRINT_SCREEN_NAME, RETURN_NAME, SCROLL_LOCK_NAME, SHIFT_NAME, SPACE_NAME, TAB_NAME, VT_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intformalKeyLookup(String name)Looks up a single natural key by its formal name, and returns the integer representation for this natural keyIntegerformalKeyLookupInteger(String name)Looks up a single natural key by its formal name, and returns the integer representation for this natural keyintformalModifierLookup(String name)Looks up a single modifier key by its formal name, and returns the integer representation for this modifier keyStringformalNameLookup(int key)Looks up a key value, and returns the formal string representation for that keyintgetAlt()Returns the integer representation of the ALT key.intgetCommand()Returns the integer representation of the COMMAND key.intgetCtrl()Returns the integer representation of the CTRL key.intgetShift()Returns the integer representation of the SHIFT key.booleanisModifierKey(int key)Returns whether the given key is a modifier key.
-
-
-
Method Detail
-
formalKeyLookup
public final int formalKeyLookup(String name)
Description copied from interface:IKeyLookupLooks up a single natural key by its formal name, and returns the integer representation for this natural key- Specified by:
formalKeyLookupin interfaceIKeyLookup- Parameters:
name- The formal name of the natural key to look-up; must not benull.- Returns:
- The integer representation of this key. If the natural key cannot
be found, then this method returns
0.
-
formalKeyLookupInteger
public final Integer formalKeyLookupInteger(String name)
Description copied from interface:IKeyLookupLooks up a single natural key by its formal name, and returns the integer representation for this natural key- Specified by:
formalKeyLookupIntegerin interfaceIKeyLookup- Parameters:
name- The formal name of the natural key to look-up; must not benull.- Returns:
- The integer representation of this key. If the natural key cannot
be found, then this method returns
0.
-
formalModifierLookup
public final int formalModifierLookup(String name)
Description copied from interface:IKeyLookupLooks up a single modifier key by its formal name, and returns the integer representation for this modifier key- Specified by:
formalModifierLookupin interfaceIKeyLookup- Parameters:
name- The formal name of the modifier key to look-up; must not benull.- Returns:
- The integer representation of this key. If the modifier key
cannot be found, then this method returns
0.
-
formalNameLookup
public final String formalNameLookup(int key)
Description copied from interface:IKeyLookupLooks up a key value, and returns the formal string representation for that key- Specified by:
formalNameLookupin interfaceIKeyLookup- Parameters:
key- The key to look-up.- Returns:
- The formal string representation of this key. If this key cannot be found, then it is simply the character corresponding to that integer value.
-
getAlt
public final int getAlt()
Description copied from interface:IKeyLookupReturns the integer representation of the ALT key.- Specified by:
getAltin interfaceIKeyLookup- Returns:
- The ALT key
-
getCommand
public final int getCommand()
Description copied from interface:IKeyLookupReturns the integer representation of the COMMAND key.- Specified by:
getCommandin interfaceIKeyLookup- Returns:
- The COMMAND key
-
getCtrl
public final int getCtrl()
Description copied from interface:IKeyLookupReturns the integer representation of the CTRL key.- Specified by:
getCtrlin interfaceIKeyLookup- Returns:
- The CTRL key
-
getShift
public final int getShift()
Description copied from interface:IKeyLookupReturns the integer representation of the SHIFT key.- Specified by:
getShiftin interfaceIKeyLookup- Returns:
- The SHIFT key
-
isModifierKey
public final boolean isModifierKey(int key)
Description copied from interface:IKeyLookupReturns whether the given key is a modifier key.- Specified by:
isModifierKeyin interfaceIKeyLookup- Parameters:
key- The integer value of the key to check.- Returns:
trueif the key is one of the modifier keys;falseotherwise.
-
-