dsto.dfc.swing.commands
Class AbstractSelectionBasedCommand

java.lang.Object
  extended by dsto.dfc.swing.commands.AbstractCommand
      extended by dsto.dfc.swing.commands.AbstractMutableCommand
          extended by dsto.dfc.swing.commands.AbstractSelectionBasedCommand
All Implemented Interfaces:
Command, SelectionListener, Iconic, Copyable, Disposable, PropertyEventSource, ActionListener, Cloneable, EventListener
Direct Known Subclasses:
AbstractMoveCommand, BasicDeleteCommand, CmdAddEntry, CmdRename, StyleSheetTableView.CmdClearValue

public abstract class AbstractSelectionBasedCommand
extends AbstractMutableCommand
implements SelectionListener, Disposable

Base class for commands that are affected by changes in a SelectionEventSource (eg become disabled when nothing is selected). Subclasses can override selectionChanged () to catch selection changes in the source.

Version:
$Revision$

Field Summary
protected  SelectionEventSource source
           
 
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
protected AbstractSelectionBasedCommand()
           
  AbstractSelectionBasedCommand(SelectionEventSource source)
           
  AbstractSelectionBasedCommand(SelectionEventSource source, String iconName)
           
 
Method Summary
 void dispose()
          Dispose of the object (unregister listeners, close open resources etc).
 void selectionChanged(SelectionEvent e)
          SelectionListener interface implementation: does nothing.
 
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, execute, getAccelerator, getDefaultDisplayName, getDescription, getDisplayName, getGroupInView, getIcon, getLargeIcon, getLogString, getMnemonic, getName, isInteractive, setDisplayName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected SelectionEventSource source
Constructor Detail

AbstractSelectionBasedCommand

public AbstractSelectionBasedCommand(SelectionEventSource source)

AbstractSelectionBasedCommand

public AbstractSelectionBasedCommand(SelectionEventSource source,
                                     String iconName)

AbstractSelectionBasedCommand

protected AbstractSelectionBasedCommand()
Method Detail

dispose

public void dispose()
Description copied from interface: Disposable
Dispose of the object (unregister listeners, close open resources etc). It should be safe to call this method more than once. Note for beans that support client event listeners: if there are listeners registered when this is called, this method should do nothing.

Specified by:
dispose in interface Disposable

selectionChanged

public void selectionChanged(SelectionEvent e)
SelectionListener interface implementation: does nothing.

Specified by:
selectionChanged in interface SelectionListener


Copyright © 2008 Commonwealth of Australia