Class ActionDataImpl
- java.lang.Object
-
- net.sf.jguiraffe.gui.builder.action.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 Summary
Constructors Constructor Description ActionDataImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Accelerator
getAccelerator()
Returns the accelerator.Object
getIcon()
Returns the icon for the represented action.int
getMnemonicKey()
Returns the mnemonic key.String
getName()
Returns the name of this action.Object
getTask()
Returns the task of this action.String
getText()
Returns the text of this action.String
getToolTip()
Returns the tool tip of this action.void
setAccelerator(Accelerator accelerator)
Sets the accelerator.void
setActionData(ActionData c)
Initializes this object from the specifiedActionData
object.void
setIcon(Object icon)
Sets the icon for the represented action.void
setMnemonicKey(int mnemonicKey)
Sets the mnemonic key.void
setName(String name)
Sets the name of this action.void
setTask(Object t)
Allows setting the task of this action.void
setText(String text)
Sets the text of this action.void
setToolTip(String toolTip)
Sets the tool tip text of this action.
-
-
-
Method Detail
-
getIcon
public Object getIcon()
Returns the icon for the represented action.- Specified by:
getIcon
in interfaceActionData
- 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 interfaceActionData
- Returns:
- the mnemonic
-
setMnemonicKey
public void setMnemonicKey(int mnemonicKey)
Sets the mnemonic key.- Parameters:
mnemonicKey
- the key code
-
getAccelerator
public Accelerator getAccelerator()
Returns the accelerator.- Specified by:
getAccelerator
in interfaceActionData
- Returns:
- the accelerator
-
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 interfaceActionData
- 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 interfaceActionData
- 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 interfaceActionData
- 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 interfaceActionData
- 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 specifiedActionData
object. The properties are copied from this object. Note: This is not a typical property set method because there is no correspondinggetActionData()
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 theActionData
object is null
-
-