|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICommand
A self-composing undoable operation that has a CommandResult
and a
list of affected IFile
s.
Executing, undoing or redoing a command can have a result which clients can
obtain by using the getCommandResult()
method. For example,
executing a command that create a new entity may wish to make the new entity
accessible to clients through the getCommandResult()
method.
The command provides a list of IFile
s that are expected to be
modified when the it is executed, undone or redone. An
IOperationApprover
is registered with the
OperationHistoryFactory.getOperationHistory()
to validate the
modification to these resources.
If an error occurs, or the progress monitor is canceled during execute, undo or redo, the command should make every effort to roll back the changes it has made up to that point.
Method Summary | |
---|---|
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 list of IFile s that are expected to be modified by
this command. |
CommandResult |
getCommandResult()
Retrieves the result of executing, undoing, or redoing this command, depending on which of these operations was last performed. |
ICommand |
reduce()
Returns the simplest form of this command that is equivalent. |
void |
setLabel(java.lang.String label)
Since not all commands have names, reduce() should propogate label from an upper command that may be thrown away to the resultant reduced command. |
Methods inherited from interface org.eclipse.core.commands.operations.IUndoableOperation |
---|
addContext, canExecute, canRedo, canUndo, dispose, execute, getContexts, getLabel, hasContext, redo, removeContext, undo |
Method Detail |
---|
CommandResult getCommandResult()
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.
java.util.List getAffectedFiles()
IFile
s that are expected to be modified by
this command.
IFile
s that will be modifiedICommand compose(IUndoableOperation operation)
command
parameter.
operation
- The operation that is to be composed with this command.
ICommand reduce()
void setLabel(java.lang.String label)
IUndoableOperation
is missing this method.
label
- command's new label
|
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.