uk.ac.kcl.cch.jb.pliny.commands
Class UpdateNameCommand

java.lang.Object
  extended byorg.eclipse.gef.commands.Command
      extended byuk.ac.kcl.cch.jb.pliny.commands.UpdateNameCommand

public class UpdateNameCommand
extends org.eclipse.gef.commands.Command

command to change the name of any object that has a name. This command is used in the Resource Explorer and NoteSearchView.

Author:
John Bradley

Constructor Summary
UpdateNameCommand(org.eclipse.jface.viewers.TreeViewer theViewer, INamedObject object, String newText)
          creates an instance of this command that will change the name of object to the given new name, and refresh the TreeViewer so that it displays the new name.
 
Method Summary
 void execute()
           
 void undo()
           
 
Methods inherited from class org.eclipse.gef.commands.Command
canExecute, canUndo, chain, dispose, getDebugLabel, getLabel, redo, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateNameCommand

public UpdateNameCommand(org.eclipse.jface.viewers.TreeViewer theViewer,
                         INamedObject object,
                         String newText)
creates an instance of this command that will change the name of object to the given new name, and refresh the TreeViewer so that it displays the new name.

Parameters:
theViewer - TreeViewer to be refreshed after new name is set.
object - INamedObject object to be named.
newText - String new name to use.
See Also:
INamedObject
Method Detail

execute

public void execute()

undo

public void undo()