@Deprecated public final class KeySequence extends Object implements Comparable
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.
Modifier and Type | Field and Description |
---|---|
static String |
KEY_STROKE_DELIMITER
Deprecated.
The delimiter between multiple key strokes in a single key sequence --
expressed in the formal key stroke grammar.
|
static String |
KEY_STROKE_DELIMITERS
Deprecated.
The set of delimiters for
KeyStroke objects allowed
during parsing of the formal string representation. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object object)
Deprecated.
|
boolean |
endsWith(KeySequence keySequence,
boolean equals)
Deprecated.
Returns whether or not this key sequence ends with the given key
sequence.
|
boolean |
equals(Object object)
Deprecated.
|
String |
format()
Deprecated.
Formats this key sequence into the current default look.
|
static KeySequence |
getInstance()
Deprecated.
Gets an instance of
KeySequence . |
static KeySequence |
getInstance(KeySequence newKeySequence)
Deprecated.
Gets an instance of
KeySequence given a new-style key
sequence. |
static KeySequence |
getInstance(KeySequence keySequence,
KeyStroke keyStroke)
Deprecated.
Gets an instance of
KeySequence given a key sequence and
a key stroke. |
static KeySequence |
getInstance(KeyStroke keyStroke)
Deprecated.
Gets an instance of
KeySequence given a single key
stroke. |
static KeySequence |
getInstance(KeyStroke[] keyStrokes)
Deprecated.
Gets an instance of
KeySequence given an array of key
strokes. |
static KeySequence |
getInstance(List keyStrokes)
Deprecated.
Gets an instance of
KeySequence given a list of key
strokes. |
static KeySequence |
getInstance(String string)
Deprecated.
Gets an instance of
KeySequence by parsing a given a
formal string representation. |
List |
getKeyStrokes()
Deprecated.
Returns the list of key strokes for this key sequence.
|
int |
hashCode()
Deprecated.
|
boolean |
isComplete()
Deprecated.
Returns whether or not this key sequence is complete.
|
boolean |
isEmpty()
Deprecated.
Returns whether or not this key sequence is empty.
|
boolean |
startsWith(KeySequence keySequence,
boolean equals)
Deprecated.
Returns whether or not this key sequence starts with the given key
sequence.
|
String |
toString()
Deprecated.
Returns the formal string representation for this key sequence.
|
public static final String KEY_STROKE_DELIMITER
public static final String KEY_STROKE_DELIMITERS
KeyStroke
objects allowed
during parsing of the formal string representation.public static KeySequence getInstance()
KeySequence
.null
.public static 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 KeySequence getInstance(KeyStroke keyStroke)
KeySequence
given a single key
stroke.keyStroke
- a single key stroke. Must not be null
.null
.public static 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 KeySequence getInstance(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 KeySequence getInstance(KeySequence newKeySequence)
KeySequence
given a new-style key
sequence.newKeySequence
- The new-style key sequence to convert into a legacy key
sequence; must not be null
.null
.public static KeySequence getInstance(String string) throws ParseException
KeySequence
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 sequence.public int compareTo(Object object)
compareTo
in interface Comparable
public boolean endsWith(KeySequence keySequence, boolean equals)
keySequence
- a key sequence. Must not be null
.equals
- whether or not an identical key sequence should be considered
as a possible match.true
, iff the given key sequence ends with this
key sequence.public String format()
null
.public List getKeyStrokes()
null
. If this list is not
empty, it is guaranteed to only contain instances of KeyStroke
.public boolean isComplete()
true
, iff the key sequence is complete.public boolean isEmpty()
true
, iff the key sequence is empty.public boolean startsWith(KeySequence keySequence, boolean equals)
keySequence
- a key sequence. Must not be null
.equals
- whether or not an identical key sequence should be considered
as a possible match.true
, iff the given key sequence starts with
this key sequence.
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.