|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.swing.commands.AbstractCommand
dsto.dfc.swing.commands.AbstractMutableCommand
dsto.dfc.swing.undo.AbstractUndoableCommand
public abstract class AbstractUndoableCommand
Abstract super class for undo and redo commands. Provides exception handling and cursor listening behaviour.
Field Summary | |
---|---|
protected dsto.dfc.swing.undo.CursorUpdatePolicy |
cursorUpdatePolicy
|
protected EditExceptionHandler |
exceptionHandler
|
protected String |
name
|
protected MonitoredUndoManager |
undoManager
|
Fields inherited from class dsto.dfc.swing.commands.AbstractMutableCommand |
---|
listeners |
Fields inherited from class dsto.dfc.swing.commands.AbstractCommand |
---|
displayName, icon |
Fields inherited from interface dsto.dfc.swing.icons.Iconic |
---|
NULL_ICON |
Constructor Summary | |
---|---|
AbstractUndoableCommand(MonitoredUndoManager undoManager)
Used by subclasses to register the MonitoredUndoManager being
listened to and construct the cursor update policy. |
Method Summary | |
---|---|
void |
execute()
Template method, should not be overridden |
abstract void |
execute(UndoableEdit edit)
Implement this method with the command's behaviour. |
String |
getGroupInView(String viewName)
Get the preferred group that this command should appear in for a given view. |
String |
getName()
The formal identifying name for this command (eg edit.Copy, file.Open). |
protected int |
handleNonExecutableEdit()
Template method, should not be overridden. |
boolean |
isInteractive()
True if this command will interact with the user when execute() is called. |
protected void |
listenForEnablingEvents()
Start listening for enabling cursor changes. |
void |
listenForEnablingEvents(boolean listen)
The boolean listen indicates whether the command should allow itself to be enable-able by listening to cursor changes. |
void |
pause()
Override this method to add behaviour when pausing. |
void |
retry()
Tries to re-execute the undo or redo. |
abstract UndoableEdit |
selectedEdit()
Implement this method to return the edit in question. |
abstract void |
skip()
Implement this command to determine how to skip an edit which causes an exception. |
protected void |
stopListeningForEnablingEvents()
Stop listening for enabling cursor changes. |
abstract void |
updateEnabled()
Implement this method to indicate whether the command is enabled or not. |
Methods inherited from class dsto.dfc.swing.commands.AbstractMutableCommand |
---|
addPropertyChangeListener, clone, isEnabled, removePropertyChangeListener, setEnabled, setIcon |
Methods inherited from class dsto.dfc.swing.commands.AbstractCommand |
---|
actionPerformed, canReplace, getAccelerator, getDefaultDisplayName, getDescription, getDisplayName, getIcon, getLargeIcon, getLogString, getMnemonic, setDisplayName |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String name
protected MonitoredUndoManager undoManager
protected dsto.dfc.swing.undo.CursorUpdatePolicy cursorUpdatePolicy
protected EditExceptionHandler exceptionHandler
Constructor Detail |
---|
public AbstractUndoableCommand(MonitoredUndoManager undoManager)
MonitoredUndoManager
being
listened to and construct the cursor update policy.
Method Detail |
---|
public abstract void execute(UndoableEdit edit)
public abstract UndoableEdit selectedEdit()
public abstract void updateEnabled()
public abstract void skip()
skip
in interface EditExceptionPolicy
public void retry()
retry
in interface EditExceptionPolicy
public void pause()
pause
in interface EditExceptionPolicy
public void execute()
execute
in interface Command
execute
in class AbstractCommand
protected int handleNonExecutableEdit()
public void listenForEnablingEvents(boolean listen)
protected void listenForEnablingEvents()
protected void stopListeningForEnablingEvents()
public boolean isInteractive()
Command
isInteractive
in interface Command
isInteractive
in class AbstractCommand
public String getName()
Command
getName
in interface Command
getName
in interface Iconic
getName
in class AbstractCommand
public String getGroupInView(String viewName)
Command
If the command changes its group in any view it should generate a groupInView property change event with the old value set to the old group and the new value set to the new group.
getGroupInView
in interface Command
getGroupInView
in class AbstractCommand
viewName
- The name of the view.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |