org.eclipse.graphiti.pattern
Class CreateFeatureForPattern

java.lang.Object
  extended by org.eclipse.graphiti.features.impl.AbstractFeature
      extended by org.eclipse.graphiti.features.impl.AbstractCreateFeature
          extended by org.eclipse.graphiti.pattern.CreateFeatureForPattern
All Implemented Interfaces:
ICreateFeature, ICustomUndoableFeature, IFeature, IFeatureProviderHolder, ICreate, ICreateInfo, IDescription, IName

public class CreateFeatureForPattern
extends AbstractCreateFeature
implements ICustomUndoableFeature

This feature wraps the create functionality of a pattern for calls of the Graphiti framework. Clients should not need to use this class directly.


Field Summary
private  IFeatureForPattern delegate
           
 
Fields inherited from interface org.eclipse.graphiti.func.ICreate
EMPTY
 
Constructor Summary
CreateFeatureForPattern(IFeatureProvider featureProvider, IPattern pattern)
          Creates a new CreateFeatureForPattern.
 
Method Summary
 boolean canCreate(ICreateContext context)
          Checks if business object can be created for the given context.
 boolean canRedo(IContext context)
          Decides if the processed feature can be re-done.
 boolean canUndo(IContext context)
          Decides if the current feature can be undone - this is the undo of the execute operation.
 java.lang.Object[] create(ICreateContext context)
          Creates the business object for the given context.
 java.lang.String getCreateImageId()
          Gets the create image id.
 java.lang.String getCreateLargeImageId()
          Gets the create large image id.
 IPattern getPattern()
          Gets the pattern.
 void redo(IContext context)
          This method will be called to actually do the work needed for redo.
 void undo(IContext context)
          This method will be called to actually do the work needed for undo.
 
Methods inherited from class org.eclipse.graphiti.features.impl.AbstractCreateFeature
canExecute, execute, getCreateDescription, getCreateName, getDescription, getName
 
Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature
addGraphicalRepresentation, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDiagram, getDiagramEditor, getFeatureProvider, getProgressCallback, getUserDecision, hasDoneChanges, isAvailable, layoutPictogramElement, link, link, manageColor, manageColor, setProgressCallback, toString, updatePictogramElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.graphiti.features.IFeature
hasDoneChanges, isAvailable
 
Methods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder
getFeatureProvider
 

Field Detail

delegate

private IFeatureForPattern delegate
Constructor Detail

CreateFeatureForPattern

public CreateFeatureForPattern(IFeatureProvider featureProvider,
                               IPattern pattern)
Creates a new CreateFeatureForPattern.

Parameters:
featureProvider - the feature provider
pattern - the pattern
Method Detail

canCreate

public boolean canCreate(ICreateContext context)
Description copied from interface: ICreate
Checks if business object can be created for the given context.

Specified by:
canCreate in interface ICreate
Parameters:
context - the context
Returns:
true if create is possible.

create

public java.lang.Object[] create(ICreateContext context)
Description copied from interface: ICreate
Creates the business object for the given context.

Specified by:
create in interface ICreate
Parameters:
context - the context
Returns:
the newly created objects

getCreateImageId

public java.lang.String getCreateImageId()
Description copied from interface: ICreateInfo
Gets the create image id.

Specified by:
getCreateImageId in interface ICreateInfo
Overrides:
getCreateImageId in class AbstractCreateFeature
Returns:
image for UI representation

getCreateLargeImageId

public java.lang.String getCreateLargeImageId()
Description copied from interface: ICreateInfo
Gets the create large image id.

Specified by:
getCreateLargeImageId in interface ICreateInfo
Overrides:
getCreateLargeImageId in class AbstractCreateFeature
Returns:
large image for UI representation

getPattern

public IPattern getPattern()
Gets the pattern.

Returns:
the pattern

canUndo

public boolean canUndo(IContext context)
Description copied from interface: IFeature
Decides if the current feature can be undone - this is the undo of the execute operation.

Specified by:
canUndo in interface ICustomUndoableFeature
Specified by:
canUndo in interface IFeature
Overrides:
canUndo in class AbstractFeature
Parameters:
context - this is the general input for this method
Returns:
true if the feature can be undone, false if not
See Also:
IContext

undo

public void undo(IContext context)
Description copied from interface: ICustomUndoableFeature
This method will be called to actually do the work needed for undo. Customers may revert their non-EMF changes done by the feature here.

Specified by:
undo in interface ICustomUndoableFeature
Parameters:
context - this is the instance of the IContext object that was in use when executing the feature
Since:
0.8

canRedo

public boolean canRedo(IContext context)
Description copied from interface: ICustomUndoableFeature
Decides if the processed feature can be re-done.

Note that as soon as any feature reports false here, also all consecutive entries in the command stack are no longer reachable for redo.

Specified by:
canRedo in interface ICustomUndoableFeature
Parameters:
context - this is the instance of the IContext object that was in use when executing the feature
Returns:
true if the feature can be re-done, false if not
Since:
0.8

redo

public void redo(IContext context)
Description copied from interface: ICustomUndoableFeature
This method will be called to actually do the work needed for redo. Customers may re-apply their non-EMF changes done by the feature here. (Usually it might be sufficient to delegate to the execution method of the feature.)

Specified by:
redo in interface ICustomUndoableFeature
Parameters:
context - this is the instance of the IContext object that was in use when executing the feature
Since:
0.8


Copyright (c) SAP AG 2005, 2012.