net.officefloor.eclipse.common.action
Class OperationUtil

java.lang.Object
  extended by net.officefloor.eclipse.common.action.OperationUtil

public class OperationUtil
extends Object

Utility class to aid working with an Operation.

Author:
Daniel Sagenschneider

Method Summary
static void execute(Operation operation, int x, int y, org.eclipse.gef.EditPart firstSelectedEditPart, org.eclipse.gef.EditPart... remainingSelectedEditParts)
          Performs the Operation.
static org.eclipse.gef.commands.Command getCommand(Operation operation, int x, int y, org.eclipse.gef.EditPart editPart)
           Obtains the Command from the Operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

execute

public static void execute(Operation operation,
                           int x,
                           int y,
                           org.eclipse.gef.EditPart firstSelectedEditPart,
                           org.eclipse.gef.EditPart... remainingSelectedEditParts)
Performs the Operation.

Parameters:
operation - Operation.
x - X of location.
y - Y of location.
firstSelectedEditPart - First selected EditPart instance to ensure at least one.
remainingSelectedEditParts - Remaining EditPart instances.

getCommand

public static org.eclipse.gef.commands.Command getCommand(Operation operation,
                                                          int x,
                                                          int y,
                                                          org.eclipse.gef.EditPart editPart)

Obtains the Command from the Operation.

Note should the Operation provide more than one Command, only the last Command is returned.

Parameters:
operation - Operation.
x - X of location.
y - Y of location.
editPart - EditPart to perform the Operation on.
Returns:
Command or null if Operation does not provide one.


Copyright © 2005-2013. All Rights Reserved.