Package org.eclipse.jface.bindings
Class TriggerSequence
java.lang.Object
org.eclipse.jface.bindings.TriggerSequence
- Direct Known Subclasses:
KeySequence
A sequence of one or more triggers. None of these triggers may be
null
.
- Since:
- 3.1
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTriggerSequence
(Trigger[] triggers) Constructs a new instance ofTriggerSequence
. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
endsWith
(TriggerSequence triggerSequence, boolean equals) Returns whether or not this key sequence ends with the given key sequence.final boolean
abstract String
format()
Formats this trigger sequence into the current default look.abstract TriggerSequence[]
Returns a list of prefixes for the current sequence.final Trigger[]
Returns the list of triggers.final int
hashCode()
final boolean
isEmpty()
Returns whether or not this trigger sequence is empty.final boolean
startsWith
(TriggerSequence triggerSequence, boolean equals) Returns whether or not this trigger sequence starts with the given trigger sequence.
-
Field Details
-
hashCode
protected transient int hashCodeThe hash code for this object. This value is computed lazily, and marked as invalid when one of the values on which it is based changes. This values isHASH_CODE_NOT_COMPUTED
iff the hash code has not yet been computed. -
triggers
The list of trigger in this sequence. This value is nevernull
, and never containsnull
elements.
-
-
Constructor Details
-
TriggerSequence
Constructs a new instance ofTriggerSequence
.- Parameters:
triggers
- The triggers contained within this sequence; must not benull
or containnull
elements. May be empty.
-
-
Method Details
-
endsWith
Returns whether or not this key sequence ends with the given key sequence.- Parameters:
triggerSequence
- a trigger sequence. Must not benull
.equals
- whether or not an identical trigger sequence should be considered as a possible match.- Returns:
true
, iff the given trigger sequence ends with this trigger sequence.
-
equals
-
format
Formats this trigger sequence into the current default look.- Returns:
- A string representation for this trigger sequence using the
default look; never
null
.
-
getPrefixes
Returns a list of prefixes for the current sequence. A prefix is any leading subsequence in a
TriggerSequence
. A prefix is also an instance ofTriggerSequence
.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.
- Returns:
- The array of possible prefixes for this sequence. This array must
not be
null
, but may be empty. It must only contains instances ofTriggerSequence
.
-
getTriggers
Returns the list of triggers.- Returns:
- The triggers; never
null
and guaranteed to only contain instances ofTrigger
.
-
hashCode
public final int hashCode() -
isEmpty
public final boolean isEmpty()Returns whether or not this trigger sequence is empty.- Returns:
true
, iff the trigger sequence is empty.
-
startsWith
Returns whether or not this trigger sequence starts with the given trigger sequence.- Parameters:
triggerSequence
- a trigger sequence. Must not benull
.equals
- whether or not an identical trigger sequence should be considered as a possible match.- Returns:
true
, iff the given trigger sequence starts with this key sequence.
-