|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OverrideableCommand
This represents a command that can be overridden by another command.
The intended use of this is that an overrideable command should call
EditingDomain.createOverrideCommand
in its constructor to set up the override command.
All its Command
methods should then be guarded as follows:
public void execute() { if (getOverride() != null) { getOverride().execute(); } else { doExecute(); } }The contract with the overriding command is that the overrideable command will implement all its methods in corresponding doXxx methods, e.g., execute() is implemented in doExecute(), so that the overriding command can call back to the overrideable command's doXxx methods if it wants to extend rather than replace the original implementation.
AbstractOverrideableCommand
provides a convenient base implementation for overrideable commands.
Method Summary | |
---|---|
boolean |
doCanExecute()
This is overrideable command's implementation of canExecute. |
boolean |
doCanUndo()
This is overrideable command's implementation of canUndo. |
void |
doDispose()
This is overrideable command's implementation of dispose. |
void |
doExecute()
This is overrideable command's implementation of execute. |
java.util.Collection<?> |
doGetAffectedObjects()
This is overrideable command's implementation of getAffectedObjects. |
java.lang.String |
doGetDescription()
This is overrideable command's implementation of getDescription. |
java.lang.String |
doGetLabel()
This is overrideable command's implementation of getLabel. |
java.util.Collection<?> |
doGetResult()
This is overrideable command's implementation of getResult. |
void |
doRedo()
This is overrideable command's implementation of redo. |
void |
doUndo()
This is overrideable command's implementation of undo. |
Command |
getOverride()
This returns the command that overrides this command. |
void |
setOverride(Command overrideCommand)
This sets the command that overrides this command. |
Methods inherited from interface org.eclipse.emf.common.command.Command |
---|
canExecute, canUndo, chain, dispose, execute, getAffectedObjects, getDescription, getLabel, getResult, redo, undo |
Method Detail |
---|
Command getOverride()
void setOverride(Command overrideCommand)
boolean doCanExecute()
void doExecute()
boolean doCanUndo()
void doUndo()
void doRedo()
java.util.Collection<?> doGetResult()
java.util.Collection<?> doGetAffectedObjects()
java.lang.String doGetLabel()
java.lang.String doGetDescription()
void doDispose()
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |