Runtime

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

java.lang.Object
  extended byorg.eclipse.core.commands.operations.AbstractOperation
      extended byorg.eclipse.emf.workspace.AbstractEMFOperation
          extended byorg.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand
              extended byorg.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand
All Implemented Interfaces:
ICommand, org.eclipse.gmf.runtime.common.core.internal.command.ICommandWithSettableResult, IUndoableOperation

public class SetBoundsCommand
extends AbstractTransactionalCommand

A command to set the bounds (location/size) of a View


Constructor Summary
SetBoundsCommand(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, java.lang.String label, IAdaptable adapter, Dimension size)
          Creates a SetBoundsCommand for the given view adapter with a given size.
SetBoundsCommand(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, java.lang.String label, IAdaptable adapter, Point location)
          Creates a SetBoundsCommand for the given view adapter with a given location.
SetBoundsCommand(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, java.lang.String label, IAdaptable adapter, Rectangle bounds)
          Creates a SetBoundsCommand for the given view adapter with a given bounds.
 
Method Summary
protected  CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
          Implemented by subclasses to perform the model changes.
 java.util.List getAffectedFiles()
          Returns the IFiles for resources that may be modified when the operation is executed, undone or redone.
 
Methods inherited from class org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand
aggregateStatuses, cleanup, compose, didRedo, didUndo, doExecute, doRedo, doUndo, getCommandResult, getWorkspaceFiles, getWorkspaceFiles, internalSetResult, reduce, setResult
 
Methods inherited from class org.eclipse.emf.workspace.AbstractEMFOperation
canRedo, canUndo, didCommit, dispose, execute, getChange, getEditingDomain, getOptions, redo, undo
 
Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation
addContext, canExecute, 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, canExecute, canRedo, canUndo, dispose, execute, getContexts, getLabel, hasContext, redo, removeContext, undo
 

Constructor Detail

SetBoundsCommand

public SetBoundsCommand(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                        java.lang.String label,
                        IAdaptable adapter,
                        Rectangle bounds)
Creates a SetBoundsCommand for the given view adapter with a given bounds.

Parameters:
editingDomain - the editing domain through which model changes are made
label - The command label
adapter - An adapter to the View
bounds - The new bounds

SetBoundsCommand

public SetBoundsCommand(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                        java.lang.String label,
                        IAdaptable adapter,
                        Point location)
Creates a SetBoundsCommand for the given view adapter with a given location.

Parameters:
editingDomain - the editing domain through which model changes are made
label - The command label
adapter - An adapter to the View
location - The new location

SetBoundsCommand

public SetBoundsCommand(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                        java.lang.String label,
                        IAdaptable adapter,
                        Dimension size)
Creates a SetBoundsCommand for the given view adapter with a given size.

Parameters:
editingDomain - the editing domain through which model changes are made
label - The command label
adapter - An adapter to the View
size - The new size
Method Detail

doExecuteWithResult

protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
                                            IAdaptable info)
                                     throws ExecutionException
Description copied from class: AbstractTransactionalCommand
Implemented by subclasses to perform the model changes. These changes are applied by manipulation of the EMF metamodel's API, not by executing commands on the editing domain's command stack.

Specified by:
doExecuteWithResult in class AbstractTransactionalCommand
Parameters:
monitor - the progress monitor provided by the operation history
info - the adaptable provided by the operation history
Returns:
the result of the execution
Throws:
ExecutionException - if, for some reason, I fail to complete the operation

getAffectedFiles

public java.util.List getAffectedFiles()
Description copied from class: AbstractTransactionalCommand
Returns the IFiles for resources that may be modified when the operation is executed, undone or redone.

Specified by:
getAffectedFiles in interface ICommand
Overrides:
getAffectedFiles in class AbstractTransactionalCommand

Runtime

Guidelines for using Eclipse APIs.

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