com.javadocking.dockable.action
Class DefaultDockableStateAction

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

public class DefaultDockableStateAction
extends javax.swing.AbstractAction
implements DockableStateAction

This is the default action to change the state of the dockable.

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
DefaultDockableStateAction(Dockable dockable, int newDockableState)
          Constructs an action to put the dockable in the given state.
DefaultDockableStateAction(Dockable dockable, int newDockableState, java.lang.String name)
          Constructs an action to put the dockable in the given state.
DefaultDockableStateAction(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
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 

Constructor Detail

DefaultDockableStateAction

public DefaultDockableStateAction(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.

DefaultDockableStateAction

public DefaultDockableStateAction(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.

DefaultDockableStateAction

public DefaultDockableStateAction(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)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getDockable

public Dockable getDockable()
Description copied from interface: DockableStateAction
Gets the dockable whose state is changed by this action.

Specified by:
getDockable in interface DockableStateAction
Returns:
The dockable whose state is changed by this action.

getNewDockableState

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

Specified by:
getNewDockableState in interface DockableStateAction
Returns:
The state in which the dockable should be after performing the 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.

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.