| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 convienient 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. |
Collection | doGetAffectedObjects()
This is overrideable command's implementation of getAffectedObjects. |
String | doGetDescription()
This is overrideable command's implementation of getDescription. |
String | doGetLabel()
This is overrideable command's implementation of getLabel. |
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 |
public Command getOverride()
public void setOverride(Command overrideCommand)
public boolean doCanExecute()
public void doExecute()
public boolean doCanUndo()
public void doUndo()
public void doRedo()
public Collection doGetResult()
public Collection doGetAffectedObjects()
public String doGetLabel()
public String doGetDescription()
public void doDispose()
|
Copyright 2001-2004 IBM Corporation and others. All Rights Reserved. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |