roneditor.commands
Class RenameNamedElementCommand
java.lang.Object
org.eclipse.gef.commands.Command
roneditor.commands.RenameNamedElementCommand
public class RenameNamedElementCommand
- extends org.eclipse.gef.commands.Command
Command to change the name of a NamedElement. This is undoable.
- Author:
- Tony Modica
Method Summary |
void |
execute()
Executes the command by storing the old name of the named element and
setting the new one. |
void |
redo()
|
void |
setNewName(java.lang.String newName)
|
void |
undo()
Undoes the command by resetting the old name of the named element. |
Methods inherited from class org.eclipse.gef.commands.Command |
canExecute, canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EditCommand_Label
private static final java.lang.String EditCommand_Label
- See Also:
- Constant Field Values
namedElement
protected ronmodel.NamedElement namedElement
oldName
protected java.lang.String oldName
newName
protected java.lang.String newName
RenameNamedElementCommand
public RenameNamedElementCommand(ronmodel.NamedElement namedElement)
execute
public void execute()
- Executes the command by storing the old name of the named element and
setting the new one.
- Overrides:
execute
in class org.eclipse.gef.commands.Command
undo
public void undo()
- Undoes the command by resetting the old name of the named element. The
old name has been saved by
execute()
.
- Overrides:
undo
in class org.eclipse.gef.commands.Command
redo
public void redo()
- Overrides:
redo
in class org.eclipse.gef.commands.Command
setNewName
public void setNewName(java.lang.String newName)
- Parameters:
newName
- The newName to set.