Class ActionDataImpl

  • All Implemented Interfaces:
    ActionData
    Direct Known Subclasses:
    SimplePopupMenuHandler

    public class ActionDataImpl
    extends Object
    implements ActionData

    A straight forward implementation of the ActionData interface.

    This class defines member variables for all the get and set methods defined by the ActionData interface. The access methods operate directly on these fields.

    Implementation note: This class is not thread-safe.

    Version:
    $Id: ActionDataImpl.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • ActionDataImpl

        public ActionDataImpl()
    • Method Detail

      • getIcon

        public Object getIcon()
        Returns the icon for the represented action.
        Specified by:
        getIcon in interface ActionData
        Returns:
        the icon
      • setIcon

        public void setIcon​(Object icon)
        Sets the icon for the represented action. The object passed to this method must be a valid icon for the GUI library used.
        Parameters:
        icon - the icon
      • getMnemonicKey

        public int getMnemonicKey()
        Returns the mnemonic key.
        Specified by:
        getMnemonicKey in interface ActionData
        Returns:
        the mnemonic
      • setMnemonicKey

        public void setMnemonicKey​(int mnemonicKey)
        Sets the mnemonic key.
        Parameters:
        mnemonicKey - the key code
      • setAccelerator

        public void setAccelerator​(Accelerator accelerator)
        Sets the accelerator.
        Parameters:
        accelerator - the accelerator
      • getName

        public String getName()
        Returns the name of this action.
        Specified by:
        getName in interface ActionData
        Returns:
        the action name
      • setName

        public void setName​(String name)
        Sets the name of this action.
        Parameters:
        name - the action name
      • getTask

        public Object getTask()
        Returns the task of this action.
        Specified by:
        getTask in interface ActionData
        Returns:
        the task
      • setTask

        public void setTask​(Object t)
        Allows setting the task of this action. This task will be executed when the action is triggered. The object passed to this method must be a valid task. However, this method does not perform any validity checks; it just stores the object.
        Parameters:
        t - the task
      • getText

        public String getText()
        Returns the text of this action.
        Specified by:
        getText in interface ActionData
        Returns:
        the action text
      • setText

        public void setText​(String text)
        Sets the text of this action.
        Parameters:
        text - the text
      • getToolTip

        public String getToolTip()
        Returns the tool tip of this action.
        Specified by:
        getToolTip in interface ActionData
        Returns:
        the tool tip text
      • setToolTip

        public void setToolTip​(String toolTip)
        Sets the tool tip text of this action.
        Parameters:
        toolTip - the tool tip text
      • setActionData

        public void setActionData​(ActionData c)
        Initializes this object from the specified ActionData object. The properties are copied from this object. Note: This is not a typical property set method because there is no corresponding getActionData() method. However, using this name simplifies bean declarations for this class in builder scripts.
        Parameters:
        c - the source object (must not be null)
        Throws:
        IllegalArgumentException - if the ActionData object is null