public class CopyToClipboardCommand extends AbstractOverrideableCommand implements AbstractCommand.NonDirtying
CopyCommand
but set the copy result to the EditingDomain
.
In fact, the implementation is just a proxy for copy command.AbstractCommand.NonDirtying
Modifier and Type | Field and Description |
---|---|
protected Command |
copyCommand
This is the command that does the actual copying.
|
protected static java.lang.String |
DESCRIPTION
This caches the description.
|
protected static java.lang.String |
LABEL
This caches the label.
|
protected java.util.Collection<java.lang.Object> |
oldClipboard
This is the original clipboard value before execute.
|
protected java.util.Collection<?> |
sourceObjects
This is the collection of objects to be copied to the clipboard.
|
domain, overrideCommand
description, isExecutable, isPrepared, label
Constructor and Description |
---|
CopyToClipboardCommand(EditingDomain domain,
java.util.Collection<?> collection)
This constructs a command that copies the given collection of objects to the clipboard.
|
Modifier and Type | Method and Description |
---|---|
static Command |
create(EditingDomain domain,
java.util.Collection<?> collection)
This creates a command that copies the given collection of objects to the clipboard.
|
static Command |
create(EditingDomain domain,
java.lang.Object owner)
This creates a command that copies the given object to the clipboard.
|
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.util.Collection<?> |
getSourceObjects()
This returns the collection of objects to be copied to the clipboard.
|
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, updateEMap
chain, setDescription, setLabel
protected static final java.lang.String LABEL
protected static final java.lang.String DESCRIPTION
protected java.util.Collection<?> sourceObjects
protected java.util.Collection<java.lang.Object> oldClipboard
protected Command copyCommand
public CopyToClipboardCommand(EditingDomain domain, java.util.Collection<?> collection)
public static Command create(EditingDomain domain, java.util.Collection<?> collection)
public static Command create(EditingDomain domain, java.lang.Object owner)
public java.util.Collection<?> getSourceObjects()
protected boolean prepare()
AbstractCommand
AbstractCommand.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 AbstractCommand
public void doExecute()
OverrideableCommand
doExecute
in interface OverrideableCommand
doExecute
in class AbstractOverrideableCommand
public void doUndo()
OverrideableCommand
doUndo
in interface OverrideableCommand
doUndo
in class AbstractOverrideableCommand
public void doRedo()
OverrideableCommand
doRedo
in interface OverrideableCommand
doRedo
in class AbstractOverrideableCommand
public java.util.Collection<?> doGetResult()
OverrideableCommand
doGetResult
in interface OverrideableCommand
doGetResult
in class AbstractOverrideableCommand
public java.util.Collection<?> doGetAffectedObjects()
OverrideableCommand
doGetAffectedObjects
in interface OverrideableCommand
doGetAffectedObjects
in class AbstractOverrideableCommand
public void doDispose()
OverrideableCommand
doDispose
in interface OverrideableCommand
doDispose
in class AbstractOverrideableCommand
public java.lang.String toString()
toString
in class AbstractOverrideableCommand