jimm.datavision.gui.cmd
Class CommandAdapter

java.lang.Object
  extended by jimm.datavision.gui.cmd.CommandAdapter
All Implemented Interfaces:
Command, Nameable
Direct Known Subclasses:
AbstractAggregateCommand, BoundsCommand, CompoundCommand, DbConnCommand, DeleteCommand, DeleteGroupCommand, DeleteSectionCommand, EditAggregateFuncCommand, FieldAlignCommand, FieldMoveCommand, FieldResizeCommand, FieldShowHideCommand, FieldStretchCommand, FormatCommand, FormulaEditCommand, FPDeleteCommand, GroupEditCommand, InsertFieldCommand, NameableRenameCommand, NewGroupCommand, NewSectionCommand, PaperSizeCommand, ParamEditCommand, PasteCommand, ReportStartupScriptEditCommand, ScriptingCommand, SectionPageBreakCommand, SectionResizeCommand, SortEditCommand, SummaryCommand, SuppressionProcEditCommand, TableJoinCommand, TypingCommand, UserColumnEditCommand, WhereClauseEditCommand, WidgetRenameCommand

public abstract class CommandAdapter
extends java.lang.Object
implements Command

An abstract adapter class for performing a command. It exists as a convenience for creating command objects. The perform and undo methods in this class are empty. redo calls perform. The getName method provides read-only access to the name provided at construction time. The setName method does nothing.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  java.lang.String name
           
 
Constructor Summary
CommandAdapter(java.lang.String name)
           
 
Method Summary
 java.lang.String getName()
          Returns the name.
 void perform()
          Performs the command.
 void redo()
          Redoes the command by calling perform().
 void setName(java.lang.String name)
          A command's name is immutable.
 void undo()
          Undoes the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Constructor Detail

CommandAdapter

public CommandAdapter(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Nameable
Returns the name.

Specified by:
getName in interface Nameable

setName

public void setName(java.lang.String name)
A command's name is immutable.

Specified by:
setName in interface Nameable
Parameters:
name - the new name

perform

public void perform()
Performs the command. The default implementation does nothing.

Specified by:
perform in interface Command

undo

public void undo()
Undoes the command. The default implementation does nothing.

Specified by:
undo in interface Command

redo

public void redo()
Redoes the command by calling perform().

Specified by:
redo in interface Command