net.sf.doolin.gui.action.support
Class AbstractSwingAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by net.sf.doolin.gui.action.support.AbstractSwingAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
SwingAction

public abstract class AbstractSwingAction
extends AbstractAction

Ancestor for Swing Actions used in the Doolin GUI framework.

Author:
Damien Coraboeuf
See Also:
Serialized Form

Field Summary
static String VISIBLE_PROPERTY
          Property name for the visibility state of the action.
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractSwingAction()
           
 
Method Summary
 boolean isVisible()
          Checks if the action is visible.
 void setIcon(Icon icon)
          Sets the icon for this action
 void setShortcut(String shortcut)
          Sets the shortcut for this action
 void setState(DisplayState state)
          Sets the state for the action
 void setText(String text)
          Sets the text of the action, taking case of any declared mnemonic.
 void setTip(String tip)
          Sets the tip for this action
 void setVisible(boolean visible)
          Sets the visibility of the action.
 
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
 

Field Detail

VISIBLE_PROPERTY

public static final String VISIBLE_PROPERTY
Property name for the visibility state of the action.

See Also:
Constant Field Values
Constructor Detail

AbstractSwingAction

public AbstractSwingAction()
Method Detail

isVisible

public boolean isVisible()
Checks if the action is visible.

Returns:
true if the action is visible

setIcon

public void setIcon(Icon icon)
Sets the icon for this action

Parameters:
icon - Icon to set

setShortcut

public void setShortcut(String shortcut)
Sets the shortcut for this action

Parameters:
shortcut - Encoded form of the shortcut
See Also:
AWTKeyStroke.getAWTKeyStroke(String)

setState

public void setState(DisplayState state)
Sets the state for the action

Parameters:
state - State to set
See Also:
AbstractAction.setEnabled(boolean), setVisible(boolean)

setText

public void setText(String text)
Sets the text of the action, taking case of any declared mnemonic.

Parameters:
text - Text of the action
See Also:
MnemonicInfo.configureAction(javax.swing.Action)

setTip

public void setTip(String tip)
Sets the tip for this action

Parameters:
tip - Tip

setVisible

public void setVisible(boolean visible)
Sets the visibility of the action. This property is bound to property.

Parameters:
visible - New visibility of the action


Copyright © 2011. All Rights Reserved.