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
ActionDatainterface.This class defines member variables for all the get and set methods defined by the
ActionDatainterface. 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 AcceleratorgetAccelerator()Returns the accelerator.ObjectgetIcon()Returns the icon for the represented action.intgetMnemonicKey()Returns the mnemonic key.StringgetName()Returns the name of this action.ObjectgetTask()Returns the task of this action.StringgetText()Returns the text of this action.StringgetToolTip()Returns the tool tip of this action.voidsetAccelerator(Accelerator accelerator)Sets the accelerator.voidsetActionData(ActionData c)Initializes this object from the specifiedActionDataobject.voidsetIcon(Object icon)Sets the icon for the represented action.voidsetMnemonicKey(int mnemonicKey)Sets the mnemonic key.voidsetName(String name)Sets the name of this action.voidsetTask(Object t)Allows setting the task of this action.voidsetText(String text)Sets the text of this action.voidsetToolTip(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:
getIconin 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:
getMnemonicKeyin 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:
getAcceleratorin 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:
getNamein 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:
getTaskin 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:
getTextin 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:
getToolTipin 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 specifiedActionDataobject. 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 theActionDataobject is null
-
-