Package org.eclipse.emf.common.command
Class IdentityCommand
java.lang.Object
org.eclipse.emf.common.command.AbstractCommand
org.eclipse.emf.common.command.IdentityCommand
- All Implemented Interfaces:
Command
A command that always produces the same result.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.emf.common.command.AbstractCommand
AbstractCommand.NonDirtying -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IdentityCommandAn empty instance of this object.protected Collection<?> Keeps track of the result returned fromgetResult().Fields inherited from class org.eclipse.emf.common.command.AbstractCommand
description, isExecutable, isPrepared, label -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty instance.IdentityCommand(Object result) Creates an instance with a result collection containing the given result object.IdentityCommand(String label) Creates an instance with the given label.IdentityCommand(String label, Object result) Creates an instance with the given label and a result collection containing the given result object.IdentityCommand(String label, String description) Creates an instance with the given label and description.IdentityCommand(String label, String description, Object result) Creates an instance with the given label, description, and a result collection containing the given result object.IdentityCommand(String label, String description, Collection<?> result) Creates an instance with the given label, description, result collection.IdentityCommand(String label, Collection<?> result) Creates an instance with the given label the result collection.IdentityCommand(Collection<?> result) Creates an instance with the given result collection. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrue.voidexecute()Do nothing.Returns a string suitable to help describe the effect of this command.getLabel()Returns a string suitable to represent the label that identifies this command.Collection<?> Return the identity result.voidredo()Do nothing.voidundo()Do nothing.Methods inherited from class org.eclipse.emf.common.command.AbstractCommand
canUndo, chain, dispose, getAffectedObjects, prepare, setDescription, setLabel, toString
-
Field Details
-
INSTANCE
An empty instance of this object. -
result
Keeps track of the result returned fromgetResult().
-
-
Constructor Details
-
IdentityCommand
public IdentityCommand()Creates an empty instance. -
IdentityCommand
Creates an instance with a result collection containing the given result object.- Parameters:
result- the one object in the result collection.
-
IdentityCommand
Creates an instance with the given result collection.- Parameters:
result- the result collection.
-
IdentityCommand
Creates an instance with the given label.- Parameters:
label- the label.
-
IdentityCommand
Creates an instance with the given label and a result collection containing the given result object.- Parameters:
label- the label.result- the one object in the result collection.
-
IdentityCommand
Creates an instance with the given label the result collection.- Parameters:
label- the label.result- the result collection.
-
IdentityCommand
Creates an instance with the given label and description.- Parameters:
label- the label.description- the description.
-
IdentityCommand
Creates an instance with the given label, description, and a result collection containing the given result object.- Parameters:
label- the label.description- the description.result- the one object in the result collection.
-
IdentityCommand
Creates an instance with the given label, description, result collection.- Parameters:
label- the label.description- the description.result- the result collection.
-
-
Method Details
-
canExecute
public boolean canExecute()Returnstrue.- Specified by:
canExecutein interfaceCommand- Overrides:
canExecutein classAbstractCommand- Returns:
true.
-
execute
public void execute()Do nothing. -
undo
public void undo()Do nothing.- Specified by:
undoin interfaceCommand- Overrides:
undoin classAbstractCommand
-
redo
public void redo()Do nothing. -
getLabel
Description copied from interface:CommandReturns a string suitable to represent the label that identifies this command.- Specified by:
getLabelin interfaceCommand- Overrides:
getLabelin classAbstractCommand- Returns:
- a string suitable to represent the label that identifies this command.
-
getDescription
Description copied from interface:CommandReturns a string suitable to help describe the effect of this command.- Specified by:
getDescriptionin interfaceCommand- Overrides:
getDescriptionin classAbstractCommand- Returns:
- a string suitable to help describe the effect of this command.
-
getResult
Return the identity result.- Specified by:
getResultin interfaceCommand- Overrides:
getResultin classAbstractCommand- Returns:
- the identity result.
-