|
 |
|
|
org.eclipse.gmf.runtime.common.core.command
Class UnexecutableCommand
java.lang.Object
org.eclipse.core.commands.operations.AbstractOperation
org.eclipse.gmf.runtime.common.core.command.AbstractCommand
org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand
-
All Implemented Interfaces:
-
IUndoableOperation,
ICommand, org.eclipse.gmf.runtime.common.core.internal.command.ICommandWithSettableResult
-
public class UnexecutableCommand
- extends
AbstractCommand
A command that cannot be executed. This is an implementation of the Null
Object pattern that can be used to provide a command object that can't be
executed to clients who require an
ICommand .
Constructor Summary
|
protected
|
UnexecutableCommand
()
Creates an instance of an unexecutable command. |
|
UnexecutableCommand
(
IStatus status)
Specific instances of the UnexecutableCommand can be created in order
to provide feedback. |
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
|
INSTANCE
public static final
UnexecutableCommand INSTANCE
- The shared instance.
UnexecutableCommand
protected UnexecutableCommand()
- Creates an instance of an unexecutable command.
UnexecutableCommand
public UnexecutableCommand(
IStatus status)
- Specific instances of the UnexecutableCommand can be created in order
to provide feedback. If no feedback is required, the shared instance should be used.
-
Since:
- 1.2
doExecuteWithResult
protected
CommandResult doExecuteWithResult(
IProgressMonitor progressMonitor,
IAdaptable info)
throws
ExecutionException
-
Description copied from class:
AbstractCommand
- Performs the actual work of executing this command. Subclasses must
implement this method to perform some operation.
-
-
Specified by:
-
doExecuteWithResult
in class
AbstractCommand
-
-
Parameters:
-
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.
-
Returns:
- The result of executing this command. May be
null
if the execution status is OK, but there is no meaningful result
to be returned.
-
Throws:
-
java.lang.UnsupportedOperationException
-
ExecutionException
- if, for some reason, I fail to complete the operation
doRedoWithResult
protected
CommandResult doRedoWithResult(
IProgressMonitor progressMonitor,
IAdaptable info)
throws
ExecutionException
-
Description copied from class:
AbstractCommand
- Performs the actual work of redoing this command. Subclasses must
implement this method to perform the redo.
-
-
Specified by:
-
doRedoWithResult
in class
AbstractCommand
-
-
Parameters:
-
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.
-
Returns:
- The result of redoing this command. May be
null
if the execution status is OK, but there is no meaningful result
to be returned.
-
Throws:
-
java.lang.UnsupportedOperationException
-
ExecutionException
- on failure to redo
doUndoWithResult
protected
CommandResult doUndoWithResult(
IProgressMonitor progressMonitor,
IAdaptable info)
throws
ExecutionException
-
Description copied from class:
AbstractCommand
- Performs the actual work of undoing this command. Subclasses must
implement this method to perform the undo.
-
-
Specified by:
-
doUndoWithResult
in class
AbstractCommand
-
-
Parameters:
-
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.
-
Returns:
- The result of undoing this command. May be
null
if the execution status is OK, but there is no meaningful result
to be returned.
-
Throws:
-
java.lang.UnsupportedOperationException
-
ExecutionException
- on failure to undo
canExecute
public boolean canExecute()
-
-
Specified by:
-
canExecute
in interface
IUndoableOperation
-
Overrides:
-
canExecute
in class
AbstractOperation
-
-
Returns:
- false.
canRedo
public boolean canRedo()
-
-
Specified by:
-
canRedo
in interface
IUndoableOperation
-
Overrides:
-
canRedo
in class
AbstractOperation
-
-
Returns:
- false.
canUndo
public boolean canUndo()
-
-
Specified by:
-
canUndo
in interface
IUndoableOperation
-
Overrides:
-
canUndo
in class
AbstractOperation
-
-
Returns:
- false.
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.
|
|
|