|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.common.command.AbstractCommand org.eclipse.emf.edit.command.AbstractOverrideableCommand
public abstract class 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.emf.common.command.AbstractCommand |
---|
AbstractCommand.NonDirtying |
Field Summary | |
---|---|
protected EditingDomain |
domain
This is the editing domain 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()
Calls AbstractCommand.prepare() ,
caches the result in AbstractCommand.isExecutable ,
and sets AbstractCommand.isPrepared to true ;
from then on, it will yield the value of isExecutable. |
boolean |
canUndo()
Returns true because most command should be undoable. |
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 an empty list. |
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<java.lang.Object> |
getOwnerList(EObject owner,
EStructuralFeature feature)
|
java.util.Collection<?> |
getResult()
Returns an empty list. |
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()
Throws a runtime exception. |
protected void |
updateEMap(EObject owner,
EStructuralFeature feature)
If the owner and the feature aren't null, the feature is the key of a map entry class, and the owner is contained in a EMap, then the map is updated to properly reflect the change to the key's hash code. |
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 OverrideableCommand
public void setOverride(Command overrideCommand)
setOverride
in interface OverrideableCommand
public final boolean canExecute()
AbstractCommand
AbstractCommand.prepare()
,
caches the result in AbstractCommand.isExecutable
,
and sets AbstractCommand.isPrepared
to true
;
from then on, it will yield the value of isExecutable.
canExecute
in interface Command
canExecute
in class AbstractCommand
public boolean doCanExecute()
OverrideableCommand
doCanExecute
in interface OverrideableCommand
public final void execute()
Command
execute
when canExecute
returns false
,
or when canExecute
hasn't been called, is undefined.
execute
in interface Command
public abstract void doExecute()
OverrideableCommand
doExecute
in interface OverrideableCommand
public final boolean canUndo()
AbstractCommand
true
because most command should be undoable.
canUndo
in interface Command
canUndo
in class AbstractCommand
true
.public boolean doCanUndo()
OverrideableCommand
doCanUndo
in interface OverrideableCommand
public final void undo()
AbstractCommand
undo
in interface Command
undo
in class AbstractCommand
public abstract void doUndo()
OverrideableCommand
doUndo
in interface OverrideableCommand
public final void redo()
Command
redo
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 Command
public abstract void doRedo()
OverrideableCommand
doRedo
in interface OverrideableCommand
public final java.util.Collection<?> getResult()
AbstractCommand
getResult
in interface Command
getResult
in class AbstractCommand
public java.util.Collection<?> doGetResult()
OverrideableCommand
doGetResult
in interface OverrideableCommand
public final java.util.Collection<?> getAffectedObjects()
AbstractCommand
getAffectedObjects
in interface Command
getAffectedObjects
in class AbstractCommand
public java.util.Collection<?> doGetAffectedObjects()
OverrideableCommand
doGetAffectedObjects
in interface OverrideableCommand
public final java.lang.String getLabel()
Command
getLabel
in interface Command
getLabel
in class AbstractCommand
public java.lang.String doGetLabel()
OverrideableCommand
doGetLabel
in interface OverrideableCommand
public final java.lang.String getDescription()
Command
getDescription
in interface Command
getDescription
in class AbstractCommand
public java.lang.String doGetDescription()
OverrideableCommand
doGetDescription
in interface OverrideableCommand
public final void dispose()
Command
dispose
in interface Command
dispose
in class AbstractCommand
public void doDispose()
OverrideableCommand
doDispose
in interface OverrideableCommand
public final java.util.Collection<?> getChildrenToCopy()
public java.util.Collection<?> doGetChildrenToCopy()
public static EList<java.lang.Object> getOwnerList(EObject owner, EStructuralFeature feature)
protected void updateEMap(EObject owner, EStructuralFeature feature)
owner
- the owner of the feature.feature
- the feature that's been updated.public java.lang.String toString()
toString
in class AbstractCommand
|
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 |