net.officefloor.eclipse.common.action
Class AbstractOperation<E extends org.eclipse.gef.EditPart>

java.lang.Object
  extended by net.officefloor.eclipse.common.action.AbstractOperation<E>
All Implemented Interfaces:
Operation
Direct Known Subclasses:
AbstractDeskChangeOperation, AbstractOfficeChangeOperation, AbstractOfficeFloorChangeOperation, AbstractSectionChangeOperation

public abstract class AbstractOperation<E extends org.eclipse.gef.EditPart>
extends Object
implements Operation

Abstract Operation.

Author:
Daniel Sagenschneider

Nested Class Summary
protected  class AbstractOperation.Context
          Context.
 
Constructor Summary
AbstractOperation(String actionText, Class<E> editPartType)
          Initiate.
 
Method Summary
 String getActionText()
          Obtains the text to use for the IAction.
 boolean isApplicable(org.eclipse.gef.EditPart[] editParts)
          Indicates if this Operation is applicable for the input EditPart instances.
protected static
<T extends org.eclipse.gef.EditPart>
boolean
isAssignable(Class<T> editPartType, org.eclipse.gef.EditPart[] editParts)
          Returns whether all the EditPart instances are assignable to the EditPart type.
protected abstract  void perform(AbstractOperation.Context context)
          Performs the Operation on the particular AbstractOfficeFloorEditPart.
 void perform(OperationContext context)
          Performs this Operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOperation

public AbstractOperation(String actionText,
                         Class<E> editPartType)
Initiate.

Parameters:
actionText - Action text.
editPartType - AbstractOfficeFloorEditPart type being handled.
Method Detail

isAssignable

protected static <T extends org.eclipse.gef.EditPart> boolean isAssignable(Class<T> editPartType,
                                                                           org.eclipse.gef.EditPart[] editParts)
Returns whether all the EditPart instances are assignable to the EditPart type.

Parameters:
editPartType - EditPart type.
editParts - EditPart instances.
Returns:
true if all assignable.

getActionText

public String getActionText()
Description copied from interface: Operation
Obtains the text to use for the IAction.

Specified by:
getActionText in interface Operation
Returns:
Text to use for the IAction.

isApplicable

public boolean isApplicable(org.eclipse.gef.EditPart[] editParts)
Description copied from interface: Operation
Indicates if this Operation is applicable for the input EditPart instances.

Specified by:
isApplicable in interface Operation
Parameters:
editParts - EditPart instances.
Returns:
true if this Operation is applicable for the input EditPart instances.

perform

public void perform(OperationContext context)
Description copied from interface: Operation
Performs this Operation.

Specified by:
perform in interface Operation
Parameters:
context - OperationContext.

perform

protected abstract void perform(AbstractOperation.Context context)
Performs the Operation on the particular AbstractOfficeFloorEditPart.

Parameters:
context - AbstractOperation.Context.


Copyright © 2005-2013. All Rights Reserved.