public abstract class AbstractKeyFormatter extends Object implements IKeyFormatter
An abstract implementation of a key formatter that provides a lot of common
key formatting functionality. It is recommended that implementations of
IKeyFormatter subclass from here, rather than implementing
IKeyFormatter directly.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
KEY_DELIMITER_KEY
The key for the delimiter between keys.
|
protected static String |
KEY_STROKE_DELIMITER_KEY
The key for the delimiter between key strokes.
|
protected static int[] |
NO_MODIFIER_KEYS
An empty integer array that can be used in
sortModifierKeys(int). |
| Constructor and Description |
|---|
AbstractKeyFormatter() |
| Modifier and Type | Method and Description |
|---|---|
String |
format(int key)
Formats an individual key into a human readable format.
|
String |
format(KeySequence keySequence)
Format the given key sequence into a string.
|
String |
format(KeyStroke keyStroke)
Format the given key strokes into a string.
|
protected abstract String |
getKeyDelimiter()
An accessor for the delimiter you wish to use between keys.
|
protected abstract String |
getKeyStrokeDelimiter()
An accessor for the delimiter you wish to use between key strokes.
|
protected abstract int[] |
sortModifierKeys(int modifierKeys)
Separates the modifier keys from each other, and then places them in an
array in some sorted order.
|
protected static final String KEY_DELIMITER_KEY
protected static final String KEY_STROKE_DELIMITER_KEY
protected static final int[] NO_MODIFIER_KEYS
sortModifierKeys(int).public String format(int key)
IKeyFormatterformat in interface IKeyFormatterkey - The key to format.null.public String format(KeySequence keySequence)
IKeyFormatterformat in interface IKeyFormatterkeySequence - The key sequence to convert; must not be null.null.public String format(KeyStroke keyStroke)
IKeyFormatterformat in interface IKeyFormatterkeyStroke - The key stroke to convert; must not be null.
nullprotected abstract String getKeyDelimiter()
null.protected abstract String getKeyStrokeDelimiter()
null.protected abstract int[] sortModifierKeys(int modifierKeys)
modifierKeys - The modifier keys from the key stroke.KeyStroke.NO_KEY should be ignored.Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.