public class PasteFromClipboardCommand extends AbstractOverrideableCommand
AddCommand but the things to be added are copied from the EditingDomain clipboard.
If the copied clipboard instance is of the same type as the original clipboard instance,
the clipboard instance is replaced by the copied instance and the original instance is used for the add.AbstractCommand.NonDirtying| Modifier and Type | Field and Description |
|---|---|
protected StrictCompoundCommand |
command
This is the command that does the actual pasting.
|
protected static java.lang.String |
DESCRIPTION
This caches the description.
|
protected java.lang.Object |
feature
This is feature of the owner where the clipboard copy is pasted.
|
protected int |
index
This is index in the feature of the owner where the clipboard copy is pasted.
|
protected static java.lang.String |
LABEL
This caches the label.
|
protected boolean |
optimize
This controls whether or not to optimize the canExecute (prepare)
|
protected java.lang.Object |
owner
This is object where the clipboard copy is pasted.
|
domain, overrideCommanddescription, isExecutable, isPrepared, label| Constructor and Description |
|---|
PasteFromClipboardCommand(EditingDomain domain,
java.lang.Object owner,
java.lang.Object feature,
int index)
This constructs an instance from the domain, which provides access the clipboard collection
via
EditingDomain.getCommandStack(). |
PasteFromClipboardCommand(EditingDomain domain,
java.lang.Object owner,
java.lang.Object feature,
int index,
boolean optimize) |
| Modifier and Type | Method and Description |
|---|---|
static Command |
create(EditingDomain domain,
java.lang.Object owner,
java.lang.Object feature)
This creates a command to add copies from the clipboard to the specified feature of the owner.
|
static Command |
create(EditingDomain domain,
java.lang.Object owner,
java.lang.Object feature,
int index)
This creates a command to add copies from the clipboard to the specified feature of the owner and at the given index.
|
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.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.
|
java.lang.Object |
getFeature() |
int |
getIndex() |
java.lang.Object |
getOwner() |
protected boolean |
optimizedCanExecute() |
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, 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 StrictCompoundCommand command
protected java.lang.Object owner
protected java.lang.Object feature
protected int index
protected boolean optimize
public PasteFromClipboardCommand(EditingDomain domain, java.lang.Object owner, java.lang.Object feature, int index)
EditingDomain.getCommandStack().public PasteFromClipboardCommand(EditingDomain domain, java.lang.Object owner, java.lang.Object feature, int index, boolean optimize)
public static Command create(EditingDomain domain, java.lang.Object owner, java.lang.Object feature)
public static Command create(EditingDomain domain, java.lang.Object owner, java.lang.Object feature, int index)
public java.lang.Object getOwner()
public java.lang.Object getFeature()
public int getIndex()
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 AbstractCommandprotected boolean optimizedCanExecute()
public void doExecute()
OverrideableCommanddoExecute in interface OverrideableCommanddoExecute in class AbstractOverrideableCommandpublic 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 void doDispose()
OverrideableCommanddoDispose in interface OverrideableCommanddoDispose in class AbstractOverrideableCommandpublic java.lang.String toString()
toString in class AbstractOverrideableCommand