public class CutToClipboardCommand extends CommandWrapper
RemoveCommand
but also sets the removed objects to the EditingDomain
.
In fact, the implementation is just a proxy for remove command.AbstractCommand.NonDirtying
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DESCRIPTION
This caches the description.
|
protected EditingDomain |
domain
This is the editing domain in which this command operates.
|
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.
|
command
description, isExecutable, isPrepared, label
Constructor and Description |
---|
CutToClipboardCommand(EditingDomain domain,
Command command)
This constructs an instance that yields the result of the given command as its clipboard.
|
Modifier and Type | Method and Description |
---|---|
static Command |
create(EditingDomain domain,
java.util.Collection<?> collection)
This creates a command to remove multiple objects
and set it to the clipboard.
|
static Command |
create(EditingDomain domain,
java.lang.Object value)
This creates a command to remove an object
and set it to the clipboard.
|
static Command |
create(EditingDomain domain,
java.lang.Object owner,
java.lang.Object feature,
java.util.Collection<?> collection)
This creates a command to remove a collection of values from the specified feature of the owner
and set it to the clipboard.
|
static Command |
create(EditingDomain domain,
java.lang.Object owner,
java.lang.Object feature,
java.lang.Object value)
This creates a command to remove a particular value from the specified feature of the owner
and set it to the clipboard.
|
void |
execute()
Delegates to the execute method of the command.
|
void |
redo()
Delegates to the redo method of the 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()
Delegates to the undo method of the command.
|
canUndo, createCommand, dispose, getAffectedObjects, getCommand, getDescription, getLabel, getResult, prepare
canExecute, chain, setDescription, setLabel
protected static final java.lang.String LABEL
protected static final java.lang.String DESCRIPTION
protected EditingDomain domain
protected java.util.Collection<java.lang.Object> oldClipboard
public CutToClipboardCommand(EditingDomain domain, Command command)
public static Command create(EditingDomain domain, java.lang.Object value)
public static Command create(EditingDomain domain, java.lang.Object owner, java.lang.Object feature, java.lang.Object value)
public static Command create(EditingDomain domain, java.util.Collection<?> collection)
public static Command create(EditingDomain domain, java.lang.Object owner, java.lang.Object feature, java.util.Collection<?> collection)
public void execute()
CommandWrapper
execute
in interface Command
execute
in class CommandWrapper
public void undo()
CommandWrapper
undo
in interface Command
undo
in class CommandWrapper
public void redo()
CommandWrapper
redo
in interface Command
redo
in class CommandWrapper
public java.lang.String toString()
toString
in class CommandWrapper