com.javadocking.dockable.action
Class DockableStateAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by com.javadocking.dockable.action.DockableStateAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class DockableStateAction
extends javax.swing.AbstractAction

This is an action to change the state the dockable.

The new state for the dockable is defined by an integer. This is an integer constant defined by DockableState.

Author:
Heidi Rakels.
See Also:
Serialized Form

Field Summary
 
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
DockableStateAction(Dockable dockable, int newDockableState)
          Constructs an action to put the dockable in the given state.
DockableStateAction(Dockable dockable, int newDockableState, java.lang.String name)
          Constructs an action to put the dockable in the given state.
DockableStateAction(Dockable dockable, int newDockableState, java.lang.String name, javax.swing.Icon icon)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent actionEvent)
           
 Dockable getDockable()
          Gets the dockable whose state is changed by this action.
 int getNewDockableState()
          Gets the state in which the dockable should be after performing the action.
 void setDockable(Dockable dockable)
          Sets the dockable whose state is changed by this action.
 void setNewDockableState(int newWindowState)
          Sets the state in which the dockable should be after performing 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
 

Constructor Detail

DockableStateAction

public DockableStateAction(Dockable dockable,
                           int newDockableState)
Constructs an action to put the dockable in the given state.

Parameters:
dockable - The state of this dockable will be changed by this action.
newDockableState - The new state for the dockable. This is a constant defined by DockableState.

DockableStateAction

public DockableStateAction(Dockable dockable,
                           int newDockableState,
                           java.lang.String name)
Constructs an action to put the dockable in the given state.

Parameters:
dockable - The state of this dockable will be changed by this action.
newDockableState - The new state for the dockable. This is a constant defined by DockableState.
name - The name and short description of the action.

DockableStateAction

public DockableStateAction(Dockable dockable,
                           int newDockableState,
                           java.lang.String name,
                           javax.swing.Icon icon)
Parameters:
dockable - The state of this dockable will be changed by this action.
newDockableState - The new state for the dockable. This is a constant defined by DockableState.
name - The name and short description of the action.
icon - The icon of the action.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent actionEvent)

getDockable

public Dockable getDockable()
Gets the dockable whose state is changed by this action.

Returns:
The dockable whose state is changed by this action.

setDockable

public void setDockable(Dockable dockable)
Sets the dockable whose state is changed by this action.

Parameters:
dockable - The dockable whose state is changed by this action.

getNewDockableState

public int getNewDockableState()
Gets the state in which the dockable should be after performing the action. This is a constant defined by DockableState.

Returns:
The state in which the dockable should be after performing the action.

setNewDockableState

public void setNewDockableState(int newWindowState)
Sets the state in which the dockable should be after performing the action. This is a constant defined by DockableState.

Parameters:
newWindowState - The state in which the dockable should be after performing the action.