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- Version:
- $Id: AbstractUndoableCommand.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringnameThe command name.
-
Constructor Summary
Constructors Constructor Description AbstractUndoableCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()Executes this command.java.lang.StringgetName()Gets the command name.voidredo()Performs redo for this command.voidsetName(java.lang.String name)Sets the command name.booleanshouldExecute()Tests if the command can be executed.voidundo()Performs undo for this command.
-
-
-
Method Detail
-
execute
public void execute()
Description copied from interface:UndoableCommandExecutes this command.- Specified by:
executein interfaceUndoableCommand
-
undo
public void undo()
Description copied from interface:UndoableCommandPerforms undo for this command.- Specified by:
undoin interfaceUndoableCommand
-
redo
public void redo()
Description copied from interface:UndoableCommandPerforms redo for this command.- Specified by:
redoin interfaceUndoableCommand
-
getName
public java.lang.String getName()
Description copied from interface:UndoableCommandGets the command name.- Specified by:
getNamein 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:UndoableCommandTests if the command can be executed.- Specified by:
shouldExecutein interfaceUndoableCommand- Returns:
- True if command should be executed
-
-