|
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 IUndoableOperations
that are expected to modify EMF model resources.
The operation provides a list of IFiles 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(TransactionalEditingDomain domain,
java.lang.String label)
Initializes me with the editing domain in which I am making model changes and a label. |
|
CompositeTransactionalCommand(TransactionalEditingDomain domain,
java.lang.String label,
java.util.List children)
Initializes me with the editing domain, a label, and child operations. |
|
CompositeTransactionalCommand(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(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 IFiles 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(TransactionalEditingDomain domain,
java.lang.String label)
domain - my editing domainlabel - my user-readable label
public CompositeTransactionalCommand(TransactionalEditingDomain domain,
java.lang.String label,
java.util.Map options)
domain - my editing domainlabel - my user-readable labeloptions - for the transaction in which I execute myself, or
null for the default options
public CompositeTransactionalCommand(TransactionalEditingDomain domain,
java.lang.String label,
java.util.List children)
domain - my editing domainlabel - my user-readable labelchildren - a list of operations to compose
public CompositeTransactionalCommand(TransactionalEditingDomain domain,
java.lang.String label,
java.util.List children,
java.util.Map options)
domain - my editing domainlabel - my user-readable labelchildren - a list of operations to composeoptions - for the transaction in which I execute myself, or
null for the default options| Method Detail |
|---|
public java.util.List getAffectedFiles()
IFiles for resources that may be modified when the
operation is executed, undone or redone.
getAffectedFiles in interface ICommandIFiles that will be modifiedpublic CommandResult getCommandResult()
ICommandnull 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 ICommandprotected 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 AbstractEMFOperationpublic final ICommand compose(IUndoableOperation operation)
ICommandcommand parameter.
compose in interface ICommandoperation - 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 ICommandpublic final boolean isEmpty()
isEmpty in interface ICompositeCommandtrue if the operation does not have children,
false otherwise.public boolean canExecute()
canExecute in interface IUndoableOperationcanExecute in class CompositeEMFOperationpublic boolean canRedo()
canRedo in interface IUndoableOperationcanRedo in class CompositeEMFOperationpublic boolean canUndo()
canUndo in interface IUndoableOperationcanUndo in class CompositeEMFOperationpublic void internalSetResult(CommandResult result)
internalSetResult in interface org.eclipse.gmf.runtime.common.core.internal.command.ICommandWithSettableResultresult - 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.