com.sdm.quasar.client.core.commands
Class AbstractCommandAdapter

java.lang.Object
  extended bycom.sdm.quasar.client.core.commands.AbstractCommandAdapter
All Implemented Interfaces:
CommandAdapter, Disposable
Direct Known Subclasses:
AbstractButtonCommandAdapter, JComboBoxCommandAdapter, JComponentCommandAdapter, JTableDoubleClickCommandAdapter, JTreeSelectionCommandAdapter, ListSelectionCommandAdapter, WindowClosingCommandAdapter

public abstract class AbstractCommandAdapter
extends java.lang.Object
implements CommandAdapter, Disposable

An abstract CommandAdapter implementation.

Version:
1.$Revision$
Author:
Thomas Wolf

Constructor Summary
AbstractCommandAdapter()
          Creates a new AbstractCommandAdapter.
AbstractCommandAdapter(java.lang.String name)
          Creates a new AbstractCommandAdapter.
 
Method Summary
protected  void executeCommand()
          Executes the adapted command.
 Command getCommand()
           
 java.lang.String getName()
          Return the name of the CommandAdapter.
 void setCommand(Command command)
          Sets (or resets if command==null) the Command this adapter adapts.
 void setName(java.lang.String name)
          Set the name of the CommandAdapter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sdm.quasar.client.core.common.Disposable
dispose
 

Constructor Detail

AbstractCommandAdapter

public AbstractCommandAdapter()
Creates a new AbstractCommandAdapter.


AbstractCommandAdapter

public AbstractCommandAdapter(java.lang.String name)
Creates a new AbstractCommandAdapter.

Parameters:
name - the name to set
Method Detail

getName

public java.lang.String getName()
Description copied from interface: CommandAdapter
Return the name of the CommandAdapter.

Specified by:
getName in interface CommandAdapter
Returns:
the name of the CommandAdapter (never null)
See Also:
BooleanStateAdapter.getName()

setName

public void setName(java.lang.String name)
Description copied from interface: CommandAdapter
Set the name of the CommandAdapter.

Specified by:
setName in interface CommandAdapter
Parameters:
name - the name of the CommandAdapter (not null)
See Also:
BooleanStateAdapter.setName(java.lang.String)

getCommand

public Command getCommand()
Specified by:
getCommand in interface CommandAdapter
Returns:
the Command to adapt, or null, if currently no Command is adapted.
See Also:
CommandAdapter.getCommand()

setCommand

public void setCommand(Command command)
Description copied from interface: CommandAdapter
Sets (or resets if command==null) the Command this adapter adapts.

Specified by:
setCommand in interface CommandAdapter
Parameters:
command - the Command we act upon or null
See Also:
CommandAdapter.setCommand(com.sdm.quasar.client.core.commands.Command)

executeCommand

protected final void executeCommand()
Executes the adapted command.