eu.beesoft.gaia.swing
Class SwingAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by eu.beesoft.gaia.swing.SwingAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public abstract class SwingAction
extends javax.swing.AbstractAction

Extends functionality of javax.swing.AbstractAction by adding accessors for action properties.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
enabled, changeSupport
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
SwingAction()
           
 
Method Summary
 javax.swing.KeyStroke getAccelerator()
          Gets the action accelerator key (property Action.ACCELERATOR_KEY).
 java.lang.String getActionCommand()
          Gets the action command (property Action.ACTION_COMMAND_KEY ).
 javax.swing.Icon getIcon()
          Gets the action icon (property Action.SMALL_ICON).
 java.lang.String getName()
          Gets the action name (property Action.NAME).
 java.lang.String getToolTipText()
          Gets the action tooltip (property Action.SHORT_DESCRIPTION).
 void setAccelerator(javax.swing.KeyStroke accelerator)
          Sets the action accelerator key (property Action.ACCELERATOR_KEY).
 void setAccelerator(java.lang.String accelerator)
          Sets the action accelerator key (property Action.ACCELERATOR_KEY).
 void setActionCommand(java.lang.String actionCommand)
          Sets the action command (property Action.ACTION_COMMAND_KEY ).
 void setIcon(javax.swing.Icon icon)
          Sets the action icon (property Action.SMALL_ICON).
 void setIcon(java.lang.String name)
          Sets the action icon (property Action.SMALL_ICON) from resource with given name.
 void setName(java.lang.String name)
          Sets the action name (property Action.NAME).
 void setToolTipText(java.lang.String toolTipText)
          Sets the action tooltip (property Action.SHORT_DESCRIPTION).
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Constructor Detail

SwingAction

public SwingAction()
Method Detail

getName

public java.lang.String getName()
Gets the action name (property Action.NAME).

Returns:
the name

setName

public void setName(java.lang.String name)
Sets the action name (property Action.NAME).

Parameters:
name - the name to set

getIcon

public javax.swing.Icon getIcon()
Gets the action icon (property Action.SMALL_ICON).

Returns:
the icon

setIcon

public void setIcon(javax.swing.Icon icon)
Sets the action icon (property Action.SMALL_ICON).

Parameters:
icon - - the icon to set

setIcon

public void setIcon(java.lang.String name)
Sets the action icon (property Action.SMALL_ICON) from resource with given name.

Parameters:
name - - the icon to set

getToolTipText

public java.lang.String getToolTipText()
Gets the action tooltip (property Action.SHORT_DESCRIPTION).

Returns:
the toolTipText

setToolTipText

public void setToolTipText(java.lang.String toolTipText)
Sets the action tooltip (property Action.SHORT_DESCRIPTION).

Parameters:
toolTipText - the toolTipText to set

getActionCommand

public java.lang.String getActionCommand()
Gets the action command (property Action.ACTION_COMMAND_KEY ).

Returns:
the actionCommand

setActionCommand

public void setActionCommand(java.lang.String actionCommand)
Sets the action command (property Action.ACTION_COMMAND_KEY ).

Parameters:
actionCommand - the actionCommand to set

getAccelerator

public javax.swing.KeyStroke getAccelerator()
Gets the action accelerator key (property Action.ACCELERATOR_KEY).

Returns:
the accelerator

setAccelerator

public void setAccelerator(javax.swing.KeyStroke accelerator)
Sets the action accelerator key (property Action.ACCELERATOR_KEY).

Parameters:
accelerator - the accelerator to set

setAccelerator

public void setAccelerator(java.lang.String accelerator)
Sets the action accelerator key (property Action.ACCELERATOR_KEY). Given String is parsed in javax.swing.KeyStroke class.

Parameters:
accelerator - the accelerator to set