|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ui.keys.KeyStroke
public final class KeyStroke
A KeyStroke is defined as an optional set of modifier keys
followed optionally by a natural key. A KeyStroke is 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 KeyStroke objects have a formal string representation
available via the toString() method. There are a number of
methods to get instances of KeyStroke objects, including one
which can parse this formal string representation.
All KeyStroke objects, via the format() method,
provide a version of their formal string representation translated by
platform and locale, suitable for display to a user.
KeyStroke objects are immutable. Clients are not permitted to
extend this class.
ModifierKey,
NaturalKey| Field Summary | |
|---|---|
static java.lang.String |
KEY_DELIMITER
Deprecated. The delimiter between multiple keys in a single key strokes -- expressed in the formal key stroke grammar. |
static java.lang.String |
KEY_DELIMITERS
Deprecated. The set of delimiters for Key objects allowed during
parsing of the formal string representation. |
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object object)
Deprecated. |
boolean |
equals(java.lang.Object object)
Deprecated. |
java.lang.String |
format()
Deprecated. Formats this key stroke into the current default look. |
static KeyStroke |
getInstance(ModifierKey[] modifierKeys,
NaturalKey naturalKey)
Deprecated. Gets an instance of KeyStroke given an array of modifier
keys and a natural key. |
static KeyStroke |
getInstance(ModifierKey modifierKey,
NaturalKey naturalKey)
Deprecated. Gets an instance of KeyStroke given a single modifier key
and a natural key. |
static KeyStroke |
getInstance(NaturalKey naturalKey)
Deprecated. Gets an instance of KeyStroke given a natural key. |
static KeyStroke |
getInstance(java.util.SortedSet modifierKeys,
NaturalKey naturalKey)
Deprecated. Gets an instance of KeyStroke given a set of modifier
keys and a natural key. |
static KeyStroke |
getInstance(java.lang.String string)
Deprecated. Gets an instance of KeyStroke by parsing a given a formal
string representation. |
java.util.Set |
getModifierKeys()
Deprecated. Returns the set of modifier keys for this key stroke. |
NaturalKey |
getNaturalKey()
Deprecated. Returns the natural key for this key stroke. |
int |
hashCode()
Deprecated. |
boolean |
isComplete()
Deprecated. Returns whether or not this key stroke is complete. |
java.lang.String |
toString()
Deprecated. Returns the formal string representation for this key stroke. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String KEY_DELIMITER
public static final java.lang.String KEY_DELIMITERS
Key objects allowed during
parsing of the formal string representation.
| Method Detail |
|---|
public static KeyStroke getInstance(ModifierKey modifierKey,
NaturalKey naturalKey)
KeyStroke given a single modifier key
and a natural key.
modifierKey - a modifier key. Must not be null.naturalKey - the natural key. May be null.
null.
public static KeyStroke getInstance(ModifierKey[] modifierKeys,
NaturalKey naturalKey)
KeyStroke given an array of modifier
keys and a natural key.
modifierKeys - the array of modifier keys. This array may be empty, but it
must not be null. If this array is not empty,
it must not contain null elements.naturalKey - the natural key. May be null.
null.public static KeyStroke getInstance(NaturalKey naturalKey)
KeyStroke given a natural key.
naturalKey - the natural key. May be null.
null.
public static KeyStroke getInstance(java.util.SortedSet modifierKeys,
NaturalKey naturalKey)
KeyStroke given a set of modifier
keys and a natural key.
modifierKeys - the set of modifier keys. This set may be empty, but it must
not be null. If this set is not empty, it
must only contain instances of ModifierKey.naturalKey - the natural key. May be null.
null.
public static KeyStroke getInstance(java.lang.String string)
throws ParseException
KeyStroke by parsing a given a formal
string representation.
string - the formal string representation to parse.
null.
ParseException - if the given formal string representation could not be
parsed to a valid key stroke.public int compareTo(java.lang.Object object)
compareTo in interface java.lang.ComparableComparable.compareTo(java.lang.Object)public boolean equals(java.lang.Object object)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public java.lang.String format()
null.public java.util.Set getModifierKeys()
null. If this set is not
empty, it is guaranteed to only contain instances of ModifierKey.public NaturalKey getNaturalKey()
null.public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean isComplete()
null.
true, iff the key stroke is complete.public java.lang.String toString()
toString in class java.lang.Objectnull.Object.toString()
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.