public class Shortcut
extends java.lang.Object
Constructor and Description |
---|
Shortcut(@NotNull java.lang.String command,
@Nullable Spell spell)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addShortcutListener(@NotNull ShortcutListener listener)
Registers a shortcut listener.
|
boolean |
displaysFace(@NotNull Face face)
Returns whether this shortcut displays the given face.
|
void |
dispose()
Releases all allocated resources.
|
@NotNull java.lang.String |
getCommand()
Returns the command to execute.
|
@Nullable Spell |
getSpell()
Returns the associated spell to cast.
|
@NotNull java.lang.String |
getTooltipText()
Returns the current tooltip text.
|
boolean |
isImmediate()
Returns whether the command should be executed immediately.
|
void |
removeShortcutListener(@NotNull ShortcutListener listener)
Unregisters a shortcut listener.
|
void |
toggleImmediate()
Toggles between immediate execution and activation only.
|
public Shortcut(@NotNull @NotNull java.lang.String command, @Nullable @Nullable Spell spell)
command
- the command to executespell
- the spell associated with the command or null
is the
command is not a spell related command or if the spell is unknown@NotNull public @NotNull java.lang.String getCommand()
@Nullable public @Nullable Spell getSpell()
null
if the command is not a spell related
command or if the spell is unknownpublic void dispose()
public void addShortcutListener(@NotNull @NotNull ShortcutListener listener)
listener
- the listener to registerpublic void removeShortcutListener(@NotNull @NotNull ShortcutListener listener)
listener
- the listener to unregister@NotNull public @NotNull java.lang.String getTooltipText()
public boolean displaysFace(@NotNull @NotNull Face face)
face
- the face to check forpublic boolean isImmediate()
true
to execute immediately or false
to only
activatepublic void toggleImmediate()