|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.operations.AbstractOperation
org.eclipse.emf.workspace.AbstractEMFOperation
org.eclipse.emf.workspace.CompositeEMFOperation
org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand
public class CompositeTransactionalCommand
An undoable operation that is composed of child IUndoableOperation
s
that are expected to modify EMF model resources.
The operation provides a list of IFile
s that are expected to be
modified when the operation is executed, undone or redone. An
IOperationApprover
is registered with the
OperationHistoryFactory.getOperationHistory()
to validate the
modification to these resources.
This class is meant to be instantiated by clients.
Constructor Summary | |
---|---|
CompositeTransactionalCommand(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
java.lang.String label)
Initializes me with the editing domain in which I am making model changes and a label. |
|
CompositeTransactionalCommand(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
java.lang.String label,
java.util.List children)
Initializes me with the editing domain, a label, and child operations. |
|
CompositeTransactionalCommand(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
java.lang.String label,
java.util.List children,
java.util.Map options)
Initializes me with the editing domain, a label, and child operations, and transaction options. |
|
CompositeTransactionalCommand(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
java.lang.String label,
java.util.Map options)
Initializes me with the editing domain, a label, and transaction options. |
Method Summary | |
---|---|
protected IStatus |
aggregateStatuses(java.util.List statuses)
Overrides the superclass implementation to set the command result. |
boolean |
canExecute()
I can execute if I am not empty and all of my children can execute. |
boolean |
canRedo()
I can redo if I am not empty and all my children can all be redone. |
boolean |
canUndo()
I can undo if I am not empty and all my children can all be undone. |
ICommand |
compose(IUndoableOperation operation)
Returns a new command object that represents a composition of this command with the specified command parameter. |
java.util.List |
getAffectedFiles()
Returns the IFile s for resources that may be modified when the
operation is executed, undone or redone. |
CommandResult |
getCommandResult()
Retrieves the result of executing, undoing, or redoing this command, depending on which of these operations was last performed. |
protected java.util.List |
getReturnValues()
Returns a list containing all of the return values from ICommand children. |
void |
internalSetResult(CommandResult result)
Deprecated. internal API |
boolean |
isEmpty()
Answers whether or not this composite operation has children. |
ICommand |
reduce()
Returns the simplest form of this command that is equivalent. |
protected void |
setResult(CommandResult result)
Sets the command result. |
Methods inherited from class org.eclipse.emf.workspace.CompositeEMFOperation |
---|
add, assertNotExecuted, didCommit, dispose, doExecute, doRedo, doUndo, getChildren, isTransactionNestingEnabled, iterator, listIterator, listIterator, remove, setTransactionNestingEnabled, size |
Methods inherited from class org.eclipse.emf.workspace.AbstractEMFOperation |
---|
didRedo, didUndo, execute, getChange, getEditingDomain, getOptions, redo, undo |
Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation |
---|
addContext, getContexts, getLabel, hasContext, removeContext, setLabel, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.gmf.runtime.common.core.command.ICompositeCommand |
---|
add, iterator, listIterator, listIterator, remove, size |
Methods inherited from interface org.eclipse.gmf.runtime.common.core.command.ICommand |
---|
setLabel |
Methods inherited from interface org.eclipse.core.commands.operations.IUndoableOperation |
---|
addContext, dispose, execute, getContexts, getLabel, hasContext, redo, removeContext, undo |
Constructor Detail |
---|
public CompositeTransactionalCommand(org.eclipse.emf.transaction.TransactionalEditingDomain domain, java.lang.String label)
domain
- my editing domainlabel
- my user-readable label, should never be null
.public CompositeTransactionalCommand(org.eclipse.emf.transaction.TransactionalEditingDomain domain, java.lang.String label, java.util.Map options)
domain
- my editing domainlabel
- my user-readable label, should never be null
.options
- for the transaction in which I execute myself, or
null
for the default optionspublic CompositeTransactionalCommand(org.eclipse.emf.transaction.TransactionalEditingDomain domain, java.lang.String label, java.util.List children)
domain
- my editing domainlabel
- my user-readable label, should never be null
.children
- a list of operations to composepublic CompositeTransactionalCommand(org.eclipse.emf.transaction.TransactionalEditingDomain domain, java.lang.String label, java.util.List children, java.util.Map options)
domain
- my editing domainlabel
- my user-readable label, should never be null
.children
- a list of operations to composeoptions
- for the transaction in which I execute myself, or
null
for the default optionsMethod Detail |
---|
public java.util.List getAffectedFiles()
IFile
s for resources that may be modified when the
operation is executed, undone or redone.
getAffectedFiles
in interface ICommand
IFile
s that will be modifiedpublic CommandResult getCommandResult()
ICommand
null
if the operation has no meaningful result.
The value of this result is undefined if the command has not yet been executed, undone or redone.
getCommandResult
in interface ICommand
protected void setResult(CommandResult result)
result
- the new result for this command.protected java.util.List getReturnValues()
ICommand
children.
protected IStatus aggregateStatuses(java.util.List statuses)
aggregateStatuses
in class org.eclipse.emf.workspace.AbstractEMFOperation
public final ICommand compose(IUndoableOperation operation)
ICommand
command
parameter.
compose
in interface ICommand
operation
- The operation that is to be composed with this command.
public ICommand reduce()
If the composite has a single command, it returns the reduction of that single command. Otherwise, it returns itself.
reduce
in interface ICommand
public final boolean isEmpty()
isEmpty
in interface ICompositeCommand
true
if the operation does not have children,
false
otherwise.public boolean canExecute()
canExecute
in interface IUndoableOperation
canExecute
in class org.eclipse.emf.workspace.CompositeEMFOperation
public boolean canRedo()
canRedo
in interface IUndoableOperation
canRedo
in class org.eclipse.emf.workspace.CompositeEMFOperation
public boolean canUndo()
canUndo
in interface IUndoableOperation
canUndo
in class org.eclipse.emf.workspace.CompositeEMFOperation
public void internalSetResult(CommandResult result)
internalSetResult
in interface org.eclipse.gmf.runtime.common.core.internal.command.ICommandWithSettableResult
result
- CommandResult to set
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.