Package org.eclipse.jface.bindings
Class TriggerSequence
- java.lang.Object
-
- org.eclipse.jface.bindings.TriggerSequence
-
- Direct Known Subclasses:
KeySequence
public abstract class TriggerSequence extends Object
A sequence of one or more triggers. None of these triggers may be
null.- Since:
- 3.1
-
-
Constructor Summary
Constructors Constructor Description TriggerSequence(Trigger[] triggers)Constructs a new instance ofTriggerSequence.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanendsWith(TriggerSequence triggerSequence, boolean equals)Returns whether or not this key sequence ends with the given key sequence.booleanequals(Object object)abstract Stringformat()Formats this trigger sequence into the current default look.abstract TriggerSequence[]getPrefixes()Returns a list of prefixes for the current sequence.Trigger[]getTriggers()Returns the list of triggers.inthashCode()booleanisEmpty()Returns whether or not this trigger sequence is empty.booleanstartsWith(TriggerSequence triggerSequence, boolean equals)Returns whether or not this trigger sequence starts with the given trigger sequence.
-
-
-
Field Detail
-
hashCode
protected transient int hashCode
The 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_COMPUTEDiff the hash code has not yet been computed.
-
triggers
protected final Trigger[] triggers
The list of trigger in this sequence. This value is nevernull, and never containsnullelements.
-
-
Constructor Detail
-
TriggerSequence
public TriggerSequence(Trigger[] triggers)
Constructs a new instance ofTriggerSequence.- Parameters:
triggers- The triggers contained within this sequence; must not benullor containnullelements. May be empty.
-
-
Method Detail
-
endsWith
public final boolean endsWith(TriggerSequence triggerSequence, boolean equals)
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.
-
format
public abstract String 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
public abstract TriggerSequence[] 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
public final Trigger[] getTriggers()
Returns the list of triggers.- Returns:
- The triggers; never
nulland guaranteed to only contain instances ofTrigger.
-
isEmpty
public final boolean isEmpty()
Returns whether or not this trigger sequence is empty.- Returns:
true, iff the trigger sequence is empty.
-
startsWith
public final boolean startsWith(TriggerSequence triggerSequence, boolean equals)
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.
-
-