dsto.dfc.swing.panels
Class CmdClosePanel

java.lang.Object
  extended by dsto.dfc.swing.commands.AbstractCommand
      extended by dsto.dfc.swing.commands.AbstractMutableCommand
          extended by dsto.dfc.swing.panels.CmdClosePanel
All Implemented Interfaces:
Command, Iconic, PanelManagerListener, UndoableEditSource, Copyable, PropertyEventSource, ActionListener, Cloneable, EventListener

public class CmdClosePanel
extends AbstractMutableCommand
implements PanelManagerListener, UndoableEditSource

A Command that removes the currently active panel from the panel manager.

Author:
Peter J Smet

Field Summary
protected  UndoableEditSupport editSupport
           
protected  PanelManager manager
           
 
Fields inherited from class dsto.dfc.swing.commands.AbstractMutableCommand
listeners
 
Fields inherited from class dsto.dfc.swing.commands.AbstractCommand
displayName, icon
 
Fields inherited from interface dsto.dfc.swing.icons.Iconic
NULL_ICON
 
Constructor Summary
CmdClosePanel(PanelManager manager)
           
 
Method Summary
 void aboutToRemovePanel(PanelManagerEvent e)
           
 void addUndoableEditListener(UndoableEditListener listener)
           
 void dispose()
           
 void execute()
          Execute the command.
 KeyStroke getAccelerator()
          Get a keyboard accelerator for the command.
 String getDescription()
          A short description of the command, suitable for a tooltip or use in a status panel.
 String getDisplayName()
          The name of the command as it should be displayed (eg on a menu).
 String getGroupInView(String viewName)
          Get the preferred group that this command should appear in for a given view.
 char getMnemonic()
          Get a character shortcut for the command (eg for use on a menu).
 String getName()
          The formal identifying name for this command (eg edit.Copy, file.Open).
 boolean isInteractive()
          True if this command will interact with the user when execute() is called.
 void panelAdded(PanelManagerEvent e)
           
 void panelFloated(PanelManagerEvent e)
           
 void panelRemoved(PanelManagerEvent e)
           
 void panelUnfloated(PanelManagerEvent e)
           
 void removeUndoableEditListener(UndoableEditListener listener)
           
protected  void updateEnabled()
           
 
Methods inherited from class dsto.dfc.swing.commands.AbstractMutableCommand
addPropertyChangeListener, clone, isEnabled, removePropertyChangeListener, setEnabled, setIcon
 
Methods inherited from class dsto.dfc.swing.commands.AbstractCommand
actionPerformed, canReplace, getDefaultDisplayName, getIcon, getLargeIcon, getLogString, setDisplayName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected PanelManager manager

editSupport

protected UndoableEditSupport editSupport
Constructor Detail

CmdClosePanel

public CmdClosePanel(PanelManager manager)
Method Detail

dispose

public void dispose()

execute

public void execute()
Description copied from interface: Command
Execute the command.

Specified by:
execute in interface Command
Specified by:
execute in class AbstractCommand

updateEnabled

protected void updateEnabled()

getDisplayName

public String getDisplayName()
Description copied from interface: Command
The name of the command as it should be displayed (eg on a menu). May be null in which case the command name (or some derivative) will be used.

Specified by:
getDisplayName in interface Command
Overrides:
getDisplayName in class AbstractCommand

getName

public String getName()
Description copied from interface: Command
The formal identifying name for this command (eg edit.Copy, file.Open). This must not change during the lifetime of a command instance.

Specified by:
getName in interface Command
Specified by:
getName in interface Iconic
Specified by:
getName in class AbstractCommand

getDescription

public String getDescription()
Description copied from interface: Command
A short description of the command, suitable for a tooltip or use in a status panel.

Specified by:
getDescription in interface Command
Specified by:
getDescription in class AbstractCommand

isInteractive

public boolean isInteractive()
Description copied from interface: Command
True if this command will interact with the user when execute() is called.

Specified by:
isInteractive in interface Command
Specified by:
isInteractive in class AbstractCommand

getGroupInView

public String getGroupInView(String viewName)
Description copied from interface: Command
Get the preferred group that this command should appear in for a given view. This may be overridden by a setting in the CommandRegistry.

If the command changes its group in any view it should generate a groupInView property change event with the old value set to the old group and the new value set to the new group.

Specified by:
getGroupInView in interface Command
Specified by:
getGroupInView in class AbstractCommand
Parameters:
viewName - The name of the view.
Returns:
The group in the view, or null if this command does not appear in the given view.

getMnemonic

public char getMnemonic()
Description copied from interface: Command
Get a character shortcut for the command (eg for use on a menu). May return 0 for no mnemonic.

Specified by:
getMnemonic in interface Command
Specified by:
getMnemonic in class AbstractCommand

getAccelerator

public KeyStroke getAccelerator()
Description copied from interface: Command
Get a keyboard accelerator for the command. May return null for no accelerator.

Specified by:
getAccelerator in interface Command
Overrides:
getAccelerator in class AbstractCommand

panelAdded

public void panelAdded(PanelManagerEvent e)
Specified by:
panelAdded in interface PanelManagerListener

panelRemoved

public void panelRemoved(PanelManagerEvent e)
Specified by:
panelRemoved in interface PanelManagerListener

panelFloated

public void panelFloated(PanelManagerEvent e)
Specified by:
panelFloated in interface PanelManagerListener

panelUnfloated

public void panelUnfloated(PanelManagerEvent e)
Specified by:
panelUnfloated in interface PanelManagerListener

aboutToRemovePanel

public void aboutToRemovePanel(PanelManagerEvent e)
Specified by:
aboutToRemovePanel in interface PanelManagerListener

addUndoableEditListener

public void addUndoableEditListener(UndoableEditListener listener)
Specified by:
addUndoableEditListener in interface UndoableEditSource

removeUndoableEditListener

public void removeUndoableEditListener(UndoableEditListener listener)
Specified by:
removeUndoableEditListener in interface UndoableEditSource


Copyright © 2008 Commonwealth of Australia