Runtime

org.eclipse.gmf.runtime.diagram.ui.commands
Class CommandProxy

java.lang.Object
  extended byorg.eclipse.core.commands.operations.AbstractOperation
      extended byorg.eclipse.gmf.runtime.common.core.command.AbstractCommand
          extended byorg.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy
All Implemented Interfaces:
ICommand, org.eclipse.gmf.runtime.common.core.internal.command.ICommandWithSettableResult, IUndoableOperation

public class CommandProxy
extends AbstractCommand

ICommand that delegates to a GEF Command.


Constructor Summary
CommandProxy(Command command)
          Method CommandProxy.
 
Method Summary
 boolean canExecute()
           
 boolean canRedo()
           
 boolean canUndo()
           
 void dispose()
           
protected  CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info)
          Performs the actual work of executing this command.
protected  CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info)
          Performs the actual work of redoing this command.
protected  CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info)
          Performs the actual work of undoing this command.
 Command getCommand()
          Returns the wrapped command.
 
Methods inherited from class org.eclipse.gmf.runtime.common.core.command.AbstractCommand
compose, execute, getAffectedFiles, getCommandResult, internalSetResult, redo, reduce, setResult, 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.core.commands.operations.IUndoableOperation
addContext, getContexts, getLabel, hasContext, removeContext
 

Constructor Detail

CommandProxy

public CommandProxy(Command command)
Method CommandProxy.

Parameters:
command -
Method Detail

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:
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:
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:
ExecutionException - on failure to undo

getCommand

public Command getCommand()
Returns the wrapped command.

Returns:
Command

canUndo

public boolean canUndo()

canRedo

public boolean canRedo()

canExecute

public boolean canExecute()

dispose

public void dispose()
Specified by:
dispose in interface IUndoableOperation
Overrides:
dispose in class AbstractCommand

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.