Package org.apache.batik.apps.svgbrowser
Class AbstractUndoableCommand
- java.lang.Object
-
- org.apache.batik.apps.svgbrowser.AbstractUndoableCommand
-
- All Implemented Interfaces:
UndoableCommand
- Direct Known Subclasses:
AbstractCompoundCommand
,HistoryBrowserInterface.AppendChildCommand
,HistoryBrowserInterface.AttributeAddedCommand
,HistoryBrowserInterface.AttributeModifiedCommand
,HistoryBrowserInterface.AttributeRemovedCommand
,HistoryBrowserInterface.ChangeNodeValueCommand
,HistoryBrowserInterface.CharDataModifiedCommand
,HistoryBrowserInterface.InsertNodeBeforeCommand
,HistoryBrowserInterface.NodeInsertedCommand
,HistoryBrowserInterface.NodeRemovedCommand
,HistoryBrowserInterface.RemoveChildCommand
,HistoryBrowserInterface.ReplaceChildCommand
public abstract class AbstractUndoableCommand extends java.lang.Object implements UndoableCommand
Represents abstract undoable/redoable command. Concrete commands should extend this class
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
The command name.
-
Constructor Summary
Constructors Constructor Description AbstractUndoableCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
Executes this command.java.lang.String
getName()
Gets the command name.void
redo()
Performs redo for this command.void
setName(java.lang.String name)
Sets the command name.boolean
shouldExecute()
Tests if the command can be executed.void
undo()
Performs undo for this command.
-
-
-
Method Detail
-
execute
public void execute()
Description copied from interface:UndoableCommand
Executes this command.- Specified by:
execute
in interfaceUndoableCommand
-
undo
public void undo()
Description copied from interface:UndoableCommand
Performs undo for this command.- Specified by:
undo
in interfaceUndoableCommand
-
redo
public void redo()
Description copied from interface:UndoableCommand
Performs redo for this command.- Specified by:
redo
in interfaceUndoableCommand
-
getName
public java.lang.String getName()
Description copied from interface:UndoableCommand
Gets the command name.- Specified by:
getName
in interfaceUndoableCommand
-
setName
public void setName(java.lang.String name)
Sets the command name.- Parameters:
name
- Name to set
-
shouldExecute
public boolean shouldExecute()
Description copied from interface:UndoableCommand
Tests if the command can be executed.- Specified by:
shouldExecute
in interfaceUndoableCommand
- Returns:
- True if command should be executed
-
-