|
SWIXML 1.6 (#161) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.swixml.converters.KeyStrokeConverter
public class KeyStrokeConverter
A Converter that turns a Strings in the form of a filename into an KeyStroke objects.
Valild syntax includes:
KeyStroke.getKeyStroke(java.lang.String)
,
ConverterLibrary
Field Summary | |
---|---|
static Class |
TEMPLATE
converter's return type |
Constructor Summary | |
---|---|
KeyStrokeConverter()
|
Method Summary | |
---|---|
static Object |
conv(Class type,
Attribute attr,
Localizer localizer)
Converts a String into an KeyStroke. |
Object |
convert(Class type,
Attribute attr,
Localizer localizer)
Converts a String into an KeyStroke through a Resource lookup |
Class |
convertsTo()
A Converters conversTo method informs about the Class type the converter
is returning when its convert method is called |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Class TEMPLATE
Constructor Detail |
---|
public KeyStrokeConverter()
Method Detail |
---|
public Object convert(Class type, Attribute attr, Localizer localizer)
convert
in interface Converter
type
- Class
not usedattr
- Attribute
attribute provides the value to be convertedlocalizer
- Localizer
allow the use of resource lookups
Object
- a KeyStroke
public static Object conv(Class type, Attribute attr, Localizer localizer)
KeyStroke
.
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.
type
- Class
not usedattr
- Attribute
attribute provides the value to be convertedlocalizer
- Localizer
allow the use of resource lookups
Object
- a KeyStroke
object for that String,
or null if the specified String is null, or is formatted incorrectlypublic Class convertsTo()
Converters
conversTo method informs about the Class type the converter
is returning when its convert
method is called
convertsTo
in interface Converter
Class
- the Class the converter is returning when its convert method is called
|
SWIXML 1.6 (#161) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |