Class Shortcut

  • Direct Known Subclasses:
    ShortcutCommand, ShortcutSpell

    public abstract class Shortcut
    extends java.lang.Object
    Abstract base class for shortcut commands.
    • Constructor Detail

      • Shortcut

        public Shortcut()
    • Method Detail

      • dispose

        public abstract void dispose()
        Releases all allocated resources.
      • execute

        public abstract void execute()
        Executes the shortcut.
      • addShortcutListener

        public void addShortcutListener​(@NotNull
                                        @NotNull ShortcutListener listener)
        Registers a shortcut listener.
        Parameters:
        listener - the listener to register
      • removeShortcutListener

        public void removeShortcutListener​(@NotNull
                                           @NotNull ShortcutListener listener)
        Unregisters a shortcut listener.
        Parameters:
        listener - the listener to unregister
      • fireModifiedEvent

        protected void fireModifiedEvent()
        Notifies all listeners about a modification.
      • getTooltipText

        @NotNull
        public abstract @NotNull java.lang.String getTooltipText()
        Returns the current tooltip text.
        Returns:
        the tooltip text
      • visit

        public abstract void visit​(@NotNull
                                   @NotNull ShortcutVisitor visitor)
        Calls a ShortcutVisitor's visit() function for this instance.
        Parameters:
        visitor - the visitor to call
      • displaysFace

        public abstract boolean displaysFace​(Face face)
        Returns whether this shortcut displays the given face.
        Parameters:
        face - the face to check for
        Returns:
        whether the face is displayed