|
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
org.eclipse.gmf.runtime.common.core.command.OneTimeCommand
public abstract class OneTimeCommand
A command does its work once, and can never be undone or redone. It does not do any work that invalidates the undo history in a linear undo model.
By default, it is assigned the NULL_CONTEXT
when it is
constructed, and no other contexts can be added to it or removed from it.
This class is meant to be subclassed by clients who have work to do in a command that should have no effect on the operation history.
Field Summary | |
---|---|
protected static IUndoContext |
NULL_CONTEXT
The null undo context. |
Constructor Summary | |
---|---|
OneTimeCommand(java.lang.String label)
Initializes me with a label. |
|
OneTimeCommand(java.lang.String label,
java.util.List affectedFiles)
Initializes me with a label and a list of IFile s that anticipate
modifying when I am executed. |
Method Summary | |
---|---|
void |
addContext(IUndoContext context)
Does nothing. |
boolean |
canRedo()
Not redoable. |
boolean |
canUndo()
Not undoable. |
protected CommandResult |
doRedoWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
Not redoable. |
protected CommandResult |
doUndoWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
Not undoable. |
void |
removeContext(IUndoContext context)
Does nothing. |
Methods inherited from class org.eclipse.gmf.runtime.common.core.command.AbstractCommand |
---|
compose, dispose, doExecuteWithResult, execute, getAffectedFiles, getCommandResult, internalSetResult, redo, reduce, setResult, undo |
Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation |
---|
canExecute, getContexts, getLabel, hasContext, 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 |
---|
canExecute, getContexts, getLabel, hasContext |
Field Detail |
---|
protected static final IUndoContext NULL_CONTEXT
Constructor Detail |
---|
public OneTimeCommand(java.lang.String label)
label
- the operation labelpublic OneTimeCommand(java.lang.String label, java.util.List affectedFiles)
IFile
s that anticipate
modifying when I am executed.
label
- the operation labelaffectedFiles
- the list of affected IFile
s; may be null
Method Detail |
---|
public final void addContext(IUndoContext context)
addContext
in interface IUndoableOperation
addContext
in class AbstractOperation
public final void removeContext(IUndoContext context)
removeContext
in interface IUndoableOperation
removeContext
in class AbstractOperation
public final boolean canUndo()
false
.
canUndo
in interface IUndoableOperation
canUndo
in class AbstractOperation
public final boolean canRedo()
false
.
canRedo
in interface IUndoableOperation
canRedo
in class AbstractOperation
protected final CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException
doUndoWithResult
in class AbstractCommand
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 undoprotected final CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException
doRedoWithResult
in class AbstractCommand
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
|
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.