SWIXML 1.5 (#144) | |
Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.swixml.converters.KeyStrokeConverter
Valild syntax includes:
javax.swing.KeyStroke.getKeyStroke(java.lang.String)
, ConverterLibrary
Field Summary | |
static Class |
|
Method Summary | |
static Object | |
Object | |
Class |
|
public static Object conv(Class type, Attribute attr, Localizer localizer)
Converts a String into an KeyStroke. Parses a string and returns aKeyStroke
. The string must have the following syntax:<modifiers>* (<typedID> | <pressedReleasedID>) modifiers := shift | control | ctrl | meta | alt | button1 | button2 | button3 typedID := typed <typedKey> typedKey := string of length 1 giving Unicode character. pressedReleasedID := (pressed | released) key key := KeyEvent key code name, i.e. the name following "VK_".If typed, pressed or released is not specified, pressed is assumed. Here are some examples:"INSERT" => getKeyStroke(KeyEvent.VK_INSERT, 0); "control DELETE" => getKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_MASK); "alt shift X" => getKeyStroke(KeyEvent.VK_X, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK); "alt shift released X" => getKeyStroke(KeyEvent.VK_X, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK, true); "typed a" => getKeyStroke('a');In order to maintain backward-compatibility, specifying a null String, or a String which is formatted incorrectly, returns null.
- Parameters:
type
-Class
not usedattr
-Attribute
attribute provides the value to be convertedlocalizer
-Localizer
allow the use of resource lookups
- Returns:
Object
- aKeyStroke
object for that String, or null if the specified String is null, or is formatted incorrectly
public Object convert(Class type, Attribute attr, Localizer localizer)
Converts a String into an KeyStroke through a Resource lookup
- Parameters:
type
-Class
not usedattr
-Attribute
attribute provides the value to be convertedlocalizer
-Localizer
allow the use of resource lookups
- Returns:
Object
- aKeyStroke
public Class convertsTo()
AConverters
conversTo method informs about the Class type the converter is returning when itsconvert
method is called
- Specified by:
- convertsTo in interface Converter
- Returns:
Class
- the Class the converter is returning when its convert method is called