public class KeyBinding extends java.lang.Object implements java.lang.Comparable<KeyBinding>
CommandList
.Constructor and Description |
---|
KeyBinding(@NotNull KeyEvent2 keyEvent,
@NotNull CommandList commands,
boolean isDefault)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(@NotNull KeyBinding o) |
boolean |
equals(@Nullable java.lang.Object obj) |
@NotNull java.lang.String |
getBindingDescription()
Return the binding as a human-readable text.
|
@NotNull CommandList |
getCommands()
Returns the associated
CommandList . |
@NotNull java.lang.String |
getCommandString()
Returns the commands as a string.
|
@NotNull KeyEvent2 |
getKeyEvent2()
Returns the key to match.
|
int |
hashCode() |
boolean |
isDefault()
Returns whether the key binding is a "default" binding which should not
be saved.
|
boolean |
matchesKeyEvent(@NotNull KeyEvent2 keyEvent)
Checks whether this key binding matches a key event.
|
public KeyBinding(@NotNull @NotNull KeyEvent2 keyEvent, @NotNull @NotNull CommandList commands, boolean isDefault)
keyEvent
- the key to matchcommands
- the commands to executeisDefault
- whether the key binding is a "default" binding which
should not be saved@NotNull public @NotNull KeyEvent2 getKeyEvent2()
@NotNull public @NotNull CommandList getCommands()
CommandList
.public boolean matchesKeyEvent(@NotNull @NotNull KeyEvent2 keyEvent)
keyEvent
- the key to checkpublic boolean equals(@Nullable @Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(@NotNull @NotNull KeyBinding o)
compareTo
in interface java.lang.Comparable<KeyBinding>
@NotNull public @NotNull java.lang.String getBindingDescription()
@NotNull public @NotNull java.lang.String getCommandString()
public boolean isDefault()
true
=do not save