|
|||||||||
| PREV CLASS SOURCE NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.eclipse.emf.common.command.AbstractCommand
|
+--org.eclipse.emf.edit.command.AbstractOverrideableCommand
This is a convenient base class for classes that implement OverrideableCommand.
Subclasses of AbstractOverrideableCommand should provide implementations of the doXxx methods
(e.g., doExecute) from OverrideableCommand instead of the base command methods (e.g.,
execute), which have final implementations here.
| Field Summary | |
protected EditingDomain |
domain
This is the editing doman in which this command operates. |
protected Command |
overrideCommand
This is the command that overrides this command. |
| Fields inherited from class org.eclipse.emf.common.command.AbstractCommand |
description, isExecutable, isPrepared, label |
| Constructor Summary | |
protected |
AbstractOverrideableCommand(EditingDomain domain)
This constructs an instance in this editing domain. |
protected |
AbstractOverrideableCommand(EditingDomain domain,
java.lang.String label)
This constructs an instance with the given label and in this editing domain. |
protected |
AbstractOverrideableCommand(EditingDomain domain,
java.lang.String label,
java.lang.String description)
This constructs an instance with the given label and description, in this editing domain. |
| Method Summary | |
boolean |
canExecute()
Returns whether the comamad is valid to execute. |
boolean |
canUndo()
Returns whether the command can be undone. |
void |
dispose()
Called to indicate that the command will never be used again. |
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. |
abstract void |
doExecute()
This is overrideable command's implementation of execute. |
java.util.Collection |
doGetAffectedObjects()
This is overrideable command's implementation of getAffectedObjects. |
java.util.Collection |
doGetChildrenToCopy()
|
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. |
abstract void |
doRedo()
This is overrideable command's implementation of redo. |
abstract void |
doUndo()
This is overrideable command's implementation of undo. |
void |
execute()
Performs the command activity required for the effect. |
java.util.Collection |
getAffectedObjects()
Returns the collection of things which this command wishes to present as the objects affected by the command. |
java.util.Collection |
getChildrenToCopy()
|
java.lang.String |
getDescription()
Returns a string suitable to help describe the effect of this command. |
EditingDomain |
getDomain()
This returns the editing domain that contains this. |
java.lang.String |
getLabel()
Returns a string suitable to represent the label that identifies this command. |
Command |
getOverride()
This returns the command that overrides this command. |
static EList |
getOwnerList(EObject owner,
EStructuralFeature feature)
|
java.util.Collection |
getResult()
Returns a collection of things which this command wishes to present as it's result. |
void |
redo()
Performs the command activity required to redo the effect after undoing the effect. |
void |
setOverride(Command overrideCommand)
This sets the command that overrides this command. |
java.lang.String |
toString()
This gives an abbreviated name using this object's own class' name, without package qualification, followed by a space separated list of field:value pairs. |
void |
undo()
Performs the command activity required to undo the effects of a preceding execute (or redo). |
| Methods inherited from class org.eclipse.emf.common.command.AbstractCommand |
chain, prepare, setDescription, setLabel |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.emf.common.command.Command |
chain |
| Field Detail |
protected EditingDomain domain
protected Command overrideCommand
| Constructor Detail |
protected AbstractOverrideableCommand(EditingDomain domain)
protected AbstractOverrideableCommand(EditingDomain domain,
java.lang.String label)
protected AbstractOverrideableCommand(EditingDomain domain,
java.lang.String label,
java.lang.String description)
| Method Detail |
public EditingDomain getDomain()
public Command getOverride()
getOverride in interface OverrideableCommandpublic void setOverride(Command overrideCommand)
setOverride in interface OverrideableCommandpublic final boolean canExecute()
Commandexecute.
The UnexecutableCommand.INSTANCE.canExecute() always returns false.
This must be called before calling execute.canExecute in interface CommandcanExecute in class AbstractCommandorg.eclipse.emf.common.command.Commandexecute.public boolean doCanExecute()
OverrideableCommanddoCanExecute in interface OverrideableCommandpublic final void execute()
Commandexecute when canExecute returns false,
or when canExecute hasn't been called, is undefined.execute in interface Commandpublic abstract void doExecute()
OverrideableCommanddoExecute in interface OverrideableCommandpublic final boolean canUndo()
Commandexecute is well defined,
but the result of calling this before calling canExecute is undefined, i.e.,
a command that returns false for canExecute may return true for canUndo,
even though that is a contradiction.canUndo in interface CommandcanUndo in class AbstractCommandorg.eclipse.emf.common.command.Commandpublic boolean doCanUndo()
OverrideableCommanddoCanUndo in interface OverrideableCommandpublic final void undo()
Commandundo the effects of a preceding execute (or redo).
The effect, if any, of calling undo before execute or redo have been called,
or when canUndo returns false, is undefined.undo in interface Commandundo in class AbstractCommandorg.eclipse.emf.common.command.AbstractCommandUnsupportedOperationException - always.public abstract void doUndo()
OverrideableCommanddoUndo in interface OverrideableCommandpublic final void redo()
Commandredo the effect after undoing the effect.
The effect, if any, of calling redo before undo is called is undefined.
Note that if you implement redo to call execute
then any derived class will be restricted by that decision also.redo in interface Commandpublic abstract void doRedo()
OverrideableCommanddoRedo in interface OverrideableCommandpublic final java.util.Collection getResult()
Commandexecute or redo, or after an undo, is undefined.getResult in interface CommandgetResult in class AbstractCommandorg.eclipse.emf.common.command.Commandpublic java.util.Collection doGetResult()
OverrideableCommanddoGetResult in interface OverrideableCommandpublic final java.util.Collection getAffectedObjects()
Commandexecute, redo, or undo is undefined.
The result may be different after an undo than it is after an execute or redo,
but the result should be the same (equivalent) after either an execute or redo.getAffectedObjects in interface CommandgetAffectedObjects in class AbstractCommandorg.eclipse.emf.common.command.Commandpublic java.util.Collection doGetAffectedObjects()
OverrideableCommanddoGetAffectedObjects in interface OverrideableCommandpublic final java.lang.String getLabel()
CommandgetLabel in interface CommandgetLabel in class AbstractCommandorg.eclipse.emf.common.command.Commandpublic java.lang.String doGetLabel()
OverrideableCommanddoGetLabel in interface OverrideableCommandpublic final java.lang.String getDescription()
CommandgetDescription in interface CommandgetDescription in class AbstractCommandorg.eclipse.emf.common.command.Commandpublic java.lang.String doGetDescription()
OverrideableCommanddoGetDescription in interface OverrideableCommandpublic final void dispose()
Commanddispose in interface Commanddispose in class AbstractCommandpublic void doDispose()
OverrideableCommanddoDispose in interface OverrideableCommandpublic final java.util.Collection getChildrenToCopy()
public java.util.Collection doGetChildrenToCopy()
public static EList getOwnerList(EObject owner,
EStructuralFeature feature)
public java.lang.String toString()
toString in class AbstractCommandorg.eclipse.emf.common.command.AbstractCommand
|
Copyright 2001-2002 IBM Corporation and others. All Rights Reserved. |
||||||||
| PREV CLASS SOURCE NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||