Class AbstractBaseAction

    • Constructor Detail

      • AbstractBaseAction

        public AbstractBaseAction()
        Defines an Action object with a default description string and default icon.
      • AbstractBaseAction

        public AbstractBaseAction​(String name)
        Defines an Action object with the specified description string and a default icon.
        Parameters:
        name - the description
      • AbstractBaseAction

        public AbstractBaseAction​(String name,
                                  Icon icon)
        Defines an Action object with the specified description string and a the specified icon.
        Parameters:
        name - the description
        icon - the icon
      • AbstractBaseAction

        public AbstractBaseAction​(String name,
                                  String icon)
        Defines an Action object with the specified description string and a the specified icon.
        Parameters:
        name - the description
        icon - the icon file (without path)
      • AbstractBaseAction

        public AbstractBaseAction​(Icon icon)
        Defines an Action object with the specified icon.
        Parameters:
        icon - the icon
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the action.
      • setName

        public void setName​(String value)
        Sets the name of the action, i.e., the menuitem/button caption.
        Specified by:
        setName in interface BaseAction
        Parameters:
        value - the name
      • getName

        public String getName()
        Returns the name of the action, i.e., the menuitem/button caption.
        Specified by:
        getName in interface BaseAction
        Returns:
        the name
      • setIcon

        public void setIcon​(Icon value)
        Sets the icon of the action, i.e., the menuitem/button icon. Sets SMALL_ICON and LARGE_ICON_KEY at the same time.
        Specified by:
        setIcon in interface BaseAction
        Parameters:
        value - the icon
      • getIcon

        public Icon getIcon()
        Returns the icon the action (stored under SMALL_ICON).
        Specified by:
        getIcon in interface BaseAction
        Returns:
        the icon
      • hasIcon

        public boolean hasIcon()
        Checks whether an icon is present.
        Returns:
        true if present
      • setSelected

        public void setSelected​(boolean value)
        Sets the name of the action, i.e., the menuitem/button caption.
        Specified by:
        setSelected in interface BaseAction
        Parameters:
        value - the name
      • isSelected

        public boolean isSelected()
        Returns the name of the action, i.e., the menuitem/button caption.
        Specified by:
        isSelected in interface BaseAction
        Returns:
        the name
      • setMnemonic

        public void setMnemonic​(int value)
        Sets the mnemonic to use for the action.
        Specified by:
        setMnemonic in interface BaseAction
        Parameters:
        value - the mnemonic, e.g., KeyEvent.VK_O
        See Also:
        KeyEvent
      • hasMnemonic

        public boolean hasMnemonic()
        Checks whether a mnemonic is available for this action.
        Specified by:
        hasMnemonic in interface BaseAction
        Returns:
        true if a mnemonic is available
      • getMnemonic

        public Integer getMnemonic()
        Returns the mnemonic in use for the action.
        Specified by:
        getMnemonic in interface BaseAction
        Returns:
        the mnemonic if available (e.g., KeyEvent.VK_O), otherwise null
        See Also:
        hasMnemonic()
      • hasAccelerator

        public boolean hasAccelerator()
        Checks whether a keystroke is available for this action.
        Specified by:
        hasAccelerator in interface BaseAction
        Returns:
        true if a keystroke is available
      • getAccelerator

        public KeyStroke getAccelerator()
        Returns the accelerator (KeyStroke) in use for the action.
        Specified by:
        getAccelerator in interface BaseAction
        Returns:
        the keystroke if available, otherwise null
        See Also:
        hasAccelerator()
      • setToolTipText

        public void setToolTipText​(String value)
        Sets the TipText to use for the action, i.e., button.
        Specified by:
        setToolTipText in interface BaseAction
        Parameters:
        value - the tip text
      • hasToolTipText

        public boolean hasToolTipText()
        Checks whether a tip text is available for this action.
        Specified by:
        hasToolTipText in interface BaseAction
        Returns:
        true if a tip text is available
      • setAsynchronous

        public void setAsynchronous​(boolean value)
        Sets whether to launch the menu item asynchronously using a swingworker.
        Specified by:
        setAsynchronous in interface BaseAction
        Parameters:
        value - true if asynchronous
      • isAsynchronous

        public boolean isAsynchronous()
        Returns whether to launch the menu item asynchronously using a swingworker.
        Specified by:
        isAsynchronous in interface BaseAction
        Returns:
        true if asynchronous
      • preActionPerformed

        protected void preActionPerformed​(ActionEvent e)
        Invoked when an action occurs (hook method before executing the actual action code).

        Default implementation does nothing.
        Parameters:
        e - the event
      • doActionPerformed

        protected abstract void doActionPerformed​(ActionEvent e)
        Invoked when an action occurs.
        Parameters:
        e - the event
      • postActionPerformed

        protected void postActionPerformed​(ActionEvent e)
        Invoked when an action occurs (hook method after executing the actual action code).

        Default implementation does nothing.
        Parameters:
        e - the event
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.

        Default implementation does nothing.
        Specified by:
        cleanUp in interface BaseAction
        Specified by:
        cleanUp in interface CleanUpHandler