public class InitializeCopyCommand extends AbstractOverrideableCommand
An initialize copy command is an OverrideableCommand.
AbstractCommand.NonDirtying| Modifier and Type | Field and Description |
|---|---|
protected EObject |
copy
This is the object (copy) being initialized.
|
protected CopyCommand.Helper |
copyHelper
This is a map of objects to their copies
|
protected static java.lang.String |
DESCRIPTION
This caches the description.
|
protected static java.lang.String |
LABEL
This caches the label.
|
protected EObject |
owner
This is the object being copied.
|
domain, overrideCommanddescription, isExecutable, isPrepared, label| Constructor and Description |
|---|
InitializeCopyCommand(EditingDomain domain,
EObject owner,
CopyCommand.Helper copyHelper)
This constructs an instance that will copy the attribute values of value to those of owner.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
copyAttributes()
This method will iterate over the attributes of the owner object and set them
accordingly in the copy.
|
protected void |
copyReferences()
This method will iterate over the references of the owner object and sets them.
|
static Command |
create(EditingDomain domain,
java.lang.Object owner,
CopyCommand.Helper copyHelper) |
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<?> |
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.
|
protected java.util.Collection<? extends EAttribute> |
getAttributesToCopy() |
EObject |
getCopy()
This is the object (copy) being initialized.
|
CopyCommand.Helper |
getCopyHelper()
This is the map of objects to their copies.
|
EObject |
getOwner()
This is the object being copied.
|
protected java.util.Collection<? extends EReference> |
getReferencesToCopy() |
protected boolean |
prepare()
Called at most once in
AbstractCommand.canExecute() to give the command an opportunity to ready itself for execution. |
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.
|
canExecute, canUndo, dispose, doCanExecute, doCanUndo, doDispose, doGetChildrenToCopy, doGetDescription, doGetLabel, execute, getAffectedObjects, getChildrenToCopy, getDescription, getDomain, getLabel, getOverride, getOwnerList, getResult, redo, setOverride, undo, updateEMapchain, setDescription, setLabelprotected static final java.lang.String LABEL
protected static final java.lang.String DESCRIPTION
protected EObject owner
protected EObject copy
protected CopyCommand.Helper copyHelper
public InitializeCopyCommand(EditingDomain domain, EObject owner, CopyCommand.Helper copyHelper)
public static Command create(EditingDomain domain, java.lang.Object owner, CopyCommand.Helper copyHelper)
public EObject getOwner()
public EObject getCopy()
public CopyCommand.Helper getCopyHelper()
protected boolean prepare()
AbstractCommandAbstractCommand.canExecute() to give the command an opportunity to ready itself for execution.
The returned value is stored in AbstractCommand.canExecute().
In other words, you can override this method to initialize
and to yield a cached value for the all subsequent calls to canExecute.prepare in class AbstractCommandpublic void doExecute()
OverrideableCommanddoExecute in interface OverrideableCommanddoExecute in class AbstractOverrideableCommandprotected java.util.Collection<? extends EAttribute> getAttributesToCopy()
protected void copyAttributes()
protected java.util.Collection<? extends EReference> getReferencesToCopy()
protected void copyReferences()
public void doUndo()
OverrideableCommanddoUndo in interface OverrideableCommanddoUndo in class AbstractOverrideableCommandpublic void doRedo()
OverrideableCommanddoRedo in interface OverrideableCommanddoRedo in class AbstractOverrideableCommandpublic java.util.Collection<?> doGetResult()
OverrideableCommanddoGetResult in interface OverrideableCommanddoGetResult in class AbstractOverrideableCommandpublic java.util.Collection<?> doGetAffectedObjects()
OverrideableCommanddoGetAffectedObjects in interface OverrideableCommanddoGetAffectedObjects in class AbstractOverrideableCommandpublic java.lang.String toString()
toString in class AbstractOverrideableCommand