net.refractions.udig.project.command
Class UndoRedoCommand

java.lang.Object
  extended by net.refractions.udig.project.command.AbstractCommand
      extended by net.refractions.udig.project.command.UndoRedoCommand
All Implemented Interfaces:
Command, MapCommand, UndoableCommand, UndoableMapCommand

public class UndoRedoCommand
extends AbstractCommand
implements UndoableMapCommand

This class will only rollback and redo the command it wraps. In the case of where commands are required to interact with the UI it is often desirable to execute the command and then put it on the command stack so that it can be undone.

Since:
1.1.0
Author:
Jesse

Constructor Summary
UndoRedoCommand(UndoableMapCommand addVertexCommand)
           
 
Method Summary
 java.lang.String getName()
          Returns the name of the MapCommand
 void rollback(IProgressMonitor monitor)
          Rollback the effects of the command
 void run(IProgressMonitor monitor)
          The method that performs the work of the command.
 
Methods inherited from class net.refractions.udig.project.command.AbstractCommand
copy, getMap, setMap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.refractions.udig.project.command.MapCommand
getMap, setMap
 
Methods inherited from interface net.refractions.udig.project.command.Command
copy
 
Methods inherited from interface net.refractions.udig.project.command.Command
copy
 

Constructor Detail

UndoRedoCommand

public UndoRedoCommand(UndoableMapCommand addVertexCommand)
Method Detail

getName

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

Specified by:
getName in interface Command
Returns:
The name of the command.

run

public void run(IProgressMonitor monitor)
         throws java.lang.Exception
Description copied from interface: Command
The method that performs the work of the command.

Run is called by UDIG when the command is received. Commands are run in a seperate thread.

Specified by:
run in interface Command
Parameters:
monitor - A progress monitor used by the command to report on its internal state. API how is this associated with a Thread? is it a Thread?
Throws:
java.lang.Exception

rollback

public void rollback(IProgressMonitor monitor)
              throws java.lang.Exception
Description copied from interface: UndoableCommand
Rollback the effects of the command

Specified by:
rollback in interface UndoableCommand
Throws:
java.lang.Exception