|
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.jface.bindings.TriggerSequence
org.eclipse.jface.bindings.keys.KeySequence
public final class KeySequence
A KeySequence is defined as a list of zero or more
KeyStrokes, with the stipulation that all
KeyStroke objects must be complete, save for the last one,
whose completeness is optional. A KeySequence is said to be
complete if all of its KeyStroke objects are complete.
All KeySequence objects have a formal string representation
available via the toString() method. There are a number of
methods to get instances of KeySequence objects, including one
which can parse this formal string representation.
All KeySequence objects, via the format()
method, provide a version of their formal string representation translated by
platform and locale, suitable for display to a user.
KeySequence objects are immutable. Clients are not permitted
to extend this class.
| Field Summary | |
|---|---|
static java.lang.String |
KEY_STROKE_DELIMITER
The delimiter between multiple key strokes in a single key sequence -- expressed in the formal key stroke grammar. |
static java.lang.String |
KEY_STROKE_DELIMITERS
The set of delimiters for KeyStroke objects allowed during
parsing of the formal string representation. |
| Fields inherited from class org.eclipse.jface.bindings.TriggerSequence |
|---|
hashCode, triggers |
| Constructor Summary | |
|---|---|
protected |
KeySequence(KeyStroke[] keyStrokes)
Constructs an instance of KeySequence given a list of key
strokes. |
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object object)
|
java.lang.String |
format()
Formats this key sequence into the current default look. |
static KeySequence |
getInstance()
Gets an instance of KeySequence. |
static KeySequence |
getInstance(KeySequence keySequence,
KeyStroke keyStroke)
Creates an instance of KeySequence given a key sequence
and a key stroke. |
static KeySequence |
getInstance(KeyStroke keyStroke)
Creates an instance of KeySequence given a single key
stroke. |
static KeySequence |
getInstance(KeyStroke[] keyStrokes)
Creates an instance of KeySequence given an array of key
strokes. |
static KeySequence |
getInstance(java.util.List keyStrokes)
Creates an instance of KeySequence given a list of key
strokes. |
static KeySequence |
getInstance(java.lang.String string)
Creates an instance of KeySequence by parsing a given
formal string representation. |
KeyStroke[] |
getKeyStrokes()
Returns the list of key strokes for this key sequence. |
TriggerSequence[] |
getPrefixes()
Returns a list of prefixes for the current sequence. |
boolean |
isComplete()
Returns whether or not this key sequence is complete. |
java.lang.String |
toString()
Returns the formal string representation for this key sequence. |
| Methods inherited from class org.eclipse.jface.bindings.TriggerSequence |
|---|
endsWith, equals, getTriggers, hashCode, isEmpty, startsWith |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String KEY_STROKE_DELIMITER
public static final java.lang.String KEY_STROKE_DELIMITERS
KeyStroke objects allowed during
parsing of the formal string representation.
| Constructor Detail |
|---|
protected KeySequence(KeyStroke[] keyStrokes)
KeySequence given a list of key
strokes.
keyStrokes - the list of key strokes. This list may be empty, but it must
not be null. If this list is not empty, it
must only contain instances of KeyStroke.| Method Detail |
|---|
public static final KeySequence getInstance()
KeySequence.
null.
public static final KeySequence getInstance(KeySequence keySequence,
KeyStroke keyStroke)
KeySequence given a key sequence
and a key stroke.
keySequence - a key sequence. Must not be null.keyStroke - a key stroke. Must not be null.
null.public static final KeySequence getInstance(KeyStroke keyStroke)
KeySequence given a single key
stroke.
keyStroke - a single key stroke. Must not be null.
null.public static final KeySequence getInstance(KeyStroke[] keyStrokes)
KeySequence given an array of key
strokes.
keyStrokes - the array of key strokes. This array may be empty, but it must
not be null. This array must not contain
null elements.
null.public static final KeySequence getInstance(java.util.List keyStrokes)
KeySequence given a list of key
strokes.
keyStrokes - the list of key strokes. This list may be empty, but it must
not be null. If this list is not empty, it
must only contain instances of KeyStroke.
null.
public static final KeySequence getInstance(java.lang.String string)
throws ParseException
KeySequence by parsing a given
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 sequence.public final int compareTo(java.lang.Object object)
compareTo in interface java.lang.Comparablepublic final java.lang.String format()
format in class TriggerSequencenull.public final KeyStroke[] getKeyStrokes()
null. If this list is not
empty, it is guaranteed to only contain instances of
KeyStroke.public final TriggerSequence[] getPrefixes()
TriggerSequence
Returns a list of prefixes for the current sequence. A prefix is any
leading subsequence in a TriggerSequence. A prefix is
also an instance of TriggerSequence.
For example, consider a trigger sequence that consists of four triggers: A, B, C and D. The prefixes would be "", "A", "A B", and "A B C". The list of prefixes must always be the same as the size of the trigger list.
getPrefixes in class TriggerSequencenull, but may be empty. It must only
contains instances of TriggerSequence.public final boolean isComplete()
true, iff the key sequence is complete.public final 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.