Class KeyStroke
- java.lang.Object
-
- org.eclipse.ui.keys.KeyStroke
-
- All Implemented Interfaces:
Comparable
@Deprecated public final class KeyStroke extends Object implements Comparable
Deprecated.Please use org.eclipse.jface.bindings.keys.KeyStrokeA
KeyStrokeis defined as an optional set of modifier keys followed optionally by a natural key. AKeyStrokeis said to be complete if it contains a natural key. A natural key is any Unicode character (e.g., "backspace", etc.), any character belonging to a natural language (e.g., "A", "1", "[", etc.), or any special control character specific to computers (e.g., "F10", "PageUp", etc.).All
KeyStrokeobjects have a formal string representation available via thetoString()method. There are a number of methods to get instances ofKeyStrokeobjects, including one which can parse this formal string representation.All
KeyStrokeobjects, via theformat()method, provide a version of their formal string representation translated by platform and locale, suitable for display to a user.KeyStrokeobjects are immutable. Clients are not permitted to extend this class.- Since:
- 3.0
- See Also:
ModifierKey,NaturalKey
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_DELIMITERDeprecated.The delimiter between multiple keys in a single key strokes -- expressed in the formal key stroke grammar.static StringKEY_DELIMITERSDeprecated.The set of delimiters forKeyobjects allowed during parsing of the formal string representation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompareTo(Object object)Deprecated.booleanequals(Object object)Deprecated.Stringformat()Deprecated.Formats this key stroke into the current default look.static KeyStrokegetInstance(String string)Deprecated.Gets an instance ofKeyStrokeby parsing a given a formal string representation.static KeyStrokegetInstance(SortedSet modifierKeys, NaturalKey naturalKey)Deprecated.Gets an instance ofKeyStrokegiven a set of modifier keys and a natural key.static KeyStrokegetInstance(ModifierKey[] modifierKeys, NaturalKey naturalKey)Deprecated.Gets an instance ofKeyStrokegiven an array of modifier keys and a natural key.static KeyStrokegetInstance(ModifierKey modifierKey, NaturalKey naturalKey)Deprecated.Gets an instance ofKeyStrokegiven a single modifier key and a natural key.static KeyStrokegetInstance(NaturalKey naturalKey)Deprecated.Gets an instance ofKeyStrokegiven a natural key.SetgetModifierKeys()Deprecated.Returns the set of modifier keys for this key stroke.NaturalKeygetNaturalKey()Deprecated.Returns the natural key for this key stroke.inthashCode()Deprecated.booleanisComplete()Deprecated.Returns whether or not this key stroke is complete.StringtoString()Deprecated.Returns the formal string representation for this key stroke.
-
-
-
Field Detail
-
KEY_DELIMITER
public static final String KEY_DELIMITER
Deprecated.The delimiter between multiple keys in a single key strokes -- expressed in the formal key stroke grammar. This is not to be displayed to the user. It is only intended as an internal representation.- See Also:
- Constant Field Values
-
KEY_DELIMITERS
public static final String KEY_DELIMITERS
Deprecated.The set of delimiters forKeyobjects allowed during parsing of the formal string representation.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static KeyStroke getInstance(ModifierKey modifierKey, NaturalKey naturalKey)
Deprecated.Gets an instance ofKeyStrokegiven a single modifier key and a natural key.- Parameters:
modifierKey- a modifier key. Must not benull.naturalKey- the natural key. May benull.- Returns:
- a key stroke. Guaranteed not to be
null.
-
getInstance
public static KeyStroke getInstance(ModifierKey[] modifierKeys, NaturalKey naturalKey)
Deprecated.Gets an instance ofKeyStrokegiven an array of modifier keys and a natural key.- Parameters:
modifierKeys- the array of modifier keys. This array may be empty, but it must not benull. If this array is not empty, it must not containnullelements.naturalKey- the natural key. May benull.- Returns:
- a key stroke. Guaranteed not to be
null.
-
getInstance
public static KeyStroke getInstance(NaturalKey naturalKey)
Deprecated.Gets an instance ofKeyStrokegiven a natural key.- Parameters:
naturalKey- the natural key. May benull.- Returns:
- a key stroke. This key stroke will have no modifier keys. Guaranteed
not to be
null.
-
getInstance
public static KeyStroke getInstance(SortedSet modifierKeys, NaturalKey naturalKey)
Deprecated.Gets an instance ofKeyStrokegiven a set of modifier keys and a natural key.- Parameters:
modifierKeys- the set of modifier keys. This set may be empty, but it must not benull. If this set is not empty, it must only contain instances ofModifierKey.naturalKey- the natural key. May benull.- Returns:
- a key stroke. Guaranteed not to be
null.
-
getInstance
public static KeyStroke getInstance(String string) throws ParseException
Deprecated.Gets an instance ofKeyStrokeby parsing a given a formal string representation.- Parameters:
string- the formal string representation to parse.- Returns:
- a key stroke. Guaranteed not to be
null. - Throws:
ParseException- if the given formal string representation could not be parsed to a valid key stroke.
-
compareTo
public int compareTo(Object object)
Deprecated.- Specified by:
compareToin interfaceComparable- See Also:
Comparable.compareTo(java.lang.Object)
-
format
public String format()
Deprecated.Formats this key stroke into the current default look.- Returns:
- A string representation for this key stroke using the default look;
never
null.
-
getModifierKeys
public Set getModifierKeys()
Deprecated.Returns the set of modifier keys for this key stroke.- Returns:
- the set of modifier keys. This set may be empty, but is guaranteed
not to be
null. If this set is not empty, it is guaranteed to only contain instances ofModifierKey.
-
getNaturalKey
public NaturalKey getNaturalKey()
Deprecated.Returns the natural key for this key stroke.- Returns:
- the natural key. May be
null.
-
isComplete
public boolean isComplete()
Deprecated.Returns whether or not this key stroke is complete. Key strokes are complete iff they have a natural key which is notnull.- Returns:
true, iff the key stroke is complete.
-
-