|
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.gmf.runtime.common.core.command.AbstractCommand
public abstract class AbstractCommand
An abstract superclass for GMF IUndoableOperations that do not
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 extended by clients.
ICommand| Constructor Summary | |
|---|---|
AbstractCommand(java.lang.String label)
Initializes me with a label. |
|
AbstractCommand(java.lang.String label,
java.util.List affectedFiles)
Initializes me with a label and a list of IFiles that anticipate modifying
when I am executed, undone or redone. |
|
| Method Summary | |
|---|---|
ICommand |
compose(IUndoableOperation operation)
Returns a new command object that represents a composition of this command with the specified command parameter. |
void |
dispose()
|
protected abstract CommandResult |
doExecuteWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
Performs the actual work of executing this command. |
protected abstract CommandResult |
doRedoWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
Performs the actual work of redoing this command. |
protected abstract CommandResult |
doUndoWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
Performs the actual work of undoing this command. |
IStatus |
execute(IProgressMonitor progressMonitor,
IAdaptable info)
Delegates to doExecuteWithResult(IProgressMonitor, IAdaptable) and sets
the command result. |
java.util.List |
getAffectedFiles()
Returns the IFiles 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. |
void |
internalSetResult(CommandResult result)
Deprecated. internal API |
IStatus |
redo(IProgressMonitor progressMonitor,
IAdaptable info)
Delegates to doRedoWithResult(IProgressMonitor, IAdaptable) and sets the
command result. |
ICommand |
reduce()
Returns the simplest form of this command that is equivalent. |
protected void |
setResult(CommandResult result)
Sets the command result. |
IStatus |
undo(IProgressMonitor progressMonitor,
IAdaptable info)
Delegates to doUndoWithResult(IProgressMonitor, IAdaptable) and sets the
command result. |
| Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation |
|---|
addContext, canExecute, canRedo, canUndo, 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.ICommand |
|---|
setLabel |
| Methods inherited from interface org.eclipse.core.commands.operations.IUndoableOperation |
|---|
addContext, canExecute, canRedo, canUndo, getContexts, getLabel, hasContext, removeContext |
| Constructor Detail |
|---|
public AbstractCommand(java.lang.String label)
label - the operation label
public AbstractCommand(java.lang.String label,
java.util.List affectedFiles)
IFiles that anticipate modifying
when I am executed, undone or redone.
label - the operation labelaffectedFiles - the list of affected IFiles; may be null| Method Detail |
|---|
public java.util.List getAffectedFiles()
IFiles 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 final void setResult(CommandResult result)
result - the new result for this command.public ICommand compose(IUndoableOperation operation)
ICommandcommand parameter.
compose in interface ICommandoperation - The operation that is to be composed with this command.
public ICommand reduce()
ICommand
reduce in interface ICommand
public IStatus execute(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
doExecuteWithResult(IProgressMonitor, IAdaptable) and sets
the command result.
execute in interface IUndoableOperationexecute in class AbstractOperationExecutionException
protected abstract CommandResult doExecuteWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
progressMonitor - the progress monitor provided by the operation history. Must
never be null.info - the IAdaptable (or null) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class.
null
if the execution status is OK, but there is no meaningful result
to be returned.
ExecutionException - if, for some reason, I fail to complete the operation
public IStatus redo(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
doRedoWithResult(IProgressMonitor, IAdaptable) and sets the
command result.
redo in interface IUndoableOperationredo in class AbstractOperationExecutionException
protected abstract CommandResult doRedoWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
progressMonitor - the progress monitor provided by the operation history. Must
never be null.info - the IAdaptable (or null) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class.
null
if the execution status is OK, but there is no meaningful result
to be returned.
ExecutionException - on failure to redo
public IStatus undo(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
doUndoWithResult(IProgressMonitor, IAdaptable) and sets the
command result.
undo in interface IUndoableOperationundo in class AbstractOperationExecutionException
protected abstract CommandResult doUndoWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
progressMonitor - the progress monitor provided by the operation history. Must
never be null.info - the IAdaptable (or null) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class.
null
if the execution status is OK, but there is no meaningful result
to be returned.
ExecutionException - on failure to undopublic void dispose()
dispose in interface IUndoableOperationdispose in class AbstractOperationpublic 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.