net.infonode.docking.action
Class StateDependentWindowAction

java.lang.Object
  extended by net.infonode.docking.action.DockingWindowAction
      extended by net.infonode.docking.action.StateDependentWindowAction
All Implemented Interfaces:
java.io.Serializable, IconProvider

public class StateDependentWindowAction
extends DockingWindowAction

Performs different actions on a window depending on the state of the window.

Since:
IDW 1.3.0
Version:
$Revision: 1.6 $
Author:
$Author: jesper $
See Also:
Serialized Form

Field Summary
static StateDependentWindowAction MAXIMIZE_RESTORE
          If the window is maximized or minimized it is restored, otherwise it is maximized.
static StateDependentWindowAction MAXIMIZE_RESTORE_WITH_ABORT
          If the window is maximized or minimized it is restored, otherwise it is maximized.
private  DockingWindowAction maximizedAction
           
private  DockingWindowAction minimizedAction
           
private  DockingWindowAction normalAction
           
private static long serialVersionUID
           
 
Constructor Summary
StateDependentWindowAction(DockingWindowAction normalAction, DockingWindowAction minimizedAction, DockingWindowAction maximizedAction)
          Constructor.
 
Method Summary
private  DockingWindowAction getActionProvider(DockingWindow window)
           
 java.lang.String getName()
          Returns the name of this action.
 boolean isPerformable(DockingWindow window)
          Returns true if this action is performable on a window.
 void perform(DockingWindow window)
          Performs this action on a window.
 
Methods inherited from class net.infonode.docking.action.DockingWindowAction
getAction, getIcon, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

MAXIMIZE_RESTORE

public static final StateDependentWindowAction MAXIMIZE_RESTORE
If the window is maximized or minimized it is restored, otherwise it is maximized.


MAXIMIZE_RESTORE_WITH_ABORT

public static final StateDependentWindowAction MAXIMIZE_RESTORE_WITH_ABORT
If the window is maximized or minimized it is restored, otherwise it is maximized. The operations can be aborted by a DockingWindowListener.

Since:
IDW 1.4.0

normalAction

private DockingWindowAction normalAction

minimizedAction

private DockingWindowAction minimizedAction

maximizedAction

private DockingWindowAction maximizedAction
Constructor Detail

StateDependentWindowAction

public StateDependentWindowAction(DockingWindowAction normalAction,
                                  DockingWindowAction minimizedAction,
                                  DockingWindowAction maximizedAction)
Constructor.

Parameters:
normalAction - the action to perform if a window is in normal state
minimizedAction - the action to perform if a window is minimized
maximizedAction - the action to perform if a window is maximized
Method Detail

getName

public java.lang.String getName()
Description copied from class: DockingWindowAction
Returns the name of this action.

Specified by:
getName in class DockingWindowAction
Returns:
the name of this action

isPerformable

public boolean isPerformable(DockingWindow window)
Description copied from class: DockingWindowAction
Returns true if this action is performable on a window.

Specified by:
isPerformable in class DockingWindowAction
Parameters:
window - the window on which the action will be performed
Returns:
true if this action is performable on the window

perform

public void perform(DockingWindow window)
Description copied from class: DockingWindowAction
Performs this action on a window.

Specified by:
perform in class DockingWindowAction
Parameters:
window - the window on which to perform the action

getActionProvider

private DockingWindowAction getActionProvider(DockingWindow window)