org.eclipse.graphiti.pattern
Class DefaultFeatureProviderWithPatterns

java.lang.Object
  extended by org.eclipse.graphiti.features.impl.AbstractFeatureProvider
      extended by org.eclipse.graphiti.ui.features.DefaultFeatureProvider
          extended by org.eclipse.graphiti.pattern.DefaultFeatureProviderWithPatterns
All Implemented Interfaces:
IFeatureProvider, IMappingProvider, IFeatureProviderWithPatterns, IPatternContainer

public class DefaultFeatureProviderWithPatterns
extends DefaultFeatureProvider
implements IFeatureProviderWithPatterns

The Class DefaultFeatureProviderWithPatterns.


Field Summary
private  List<IConnectionPattern> connectionPatters
           
private  List<IPattern> patterns
           
 
Fields inherited from class org.eclipse.graphiti.features.impl.AbstractFeatureProvider
EMPTY_PICTOGRAM_ELEMENTS, NO_OBJECTS
 
Constructor Summary
DefaultFeatureProviderWithPatterns(IDiagramTypeProvider dtp)
          Creates a new DefaultFeatureProviderWithPatterns.
 
Method Summary
 void activateDirectEditingForPatterns(PictogramElement mainPictogramElement, Object bo)
          Activate direct editing for patterns.
 void activateDirectEditingForPatterns(PictogramElement mainPictogramElement, Object bo, String keyProperty)
          Activate direct editing for patterns.
 void addConnectionPattern(IConnectionPattern pattern)
          Adds a connection pattern.
 void addPattern(IPattern pattern)
          Adds the pattern.
protected  boolean checkFeatureAndContext(IFeature feature, IContext context)
          Check feature and context.
protected  boolean checkPattern(IPattern pattern, Object object)
          Check pattern.
 IAddFeature getAddFeature(IAddContext context)
          Add features create graphical representations of domain model objects.
protected  IAddFeature getAddFeatureAdditional(IAddContext context)
          Gets the additional add feature.
 Object getBusinessObjectForPictogramElement(PictogramElement pictogramElement)
          Returns the first of possibly several business objects which are linked to the given pictogram element.
protected  List<IConnectionPattern> getConnectionPatterns()
          Gets the connection patterns.
 ICreateConnectionFeature[] getCreateConnectionFeatures()
          Gets the create connection features.
protected  ICreateConnectionFeature[] getCreateConnectionFeaturesAdditional()
          Gets the additional create connection features.
 ICreateFeature[] getCreateFeatures()
          Provides all create features.
protected  ICreateFeature[] getCreateFeaturesAdditional()
          Gets the additional create features.
 IDeleteFeature getDeleteFeature(IDeleteContext context)
          Delete features remove the grapical representations of domain model objects as well as the domain model objects itself.
protected  IDeleteFeature getDeleteFeatureAdditional(IDeleteContext context)
          Gets the additional delete feature.
 IDirectEditingFeature getDirectEditingFeature(IDirectEditingContext context)
          Direct editing features handle direct editing functionality (including drop down lists and text completion).
protected  IDirectEditingFeature getDirectEditingFeatureAdditional(IDirectEditingContext context)
          Gets the additional direct editing feature.
 ILayoutFeature getLayoutFeature(ILayoutContext context)
          Layout features do the layouting work (sizes and dimensions) inside (and/or) outside a pictogram element.
protected  ILayoutFeature getLayoutFeatureAdditional(ILayoutContext context)
          Gets the additional layout feature.
 IMoveShapeFeature getMoveShapeFeature(IMoveShapeContext context)
          Move shape features respond to user's move requests.
protected  IMoveShapeFeature getMoveShapeFeatureAdditional(IMoveShapeContext context)
          Gets the additional move shape feature.
 IPattern getPatternForPictogramElement(PictogramElement pe)
          Gets the pattern for pictogram element.
protected  List<IPattern> getPatterns()
          Gets the patterns.
 IRemoveFeature getRemoveFeature(IRemoveContext context)
          Remove features remove the grapical representations of domain model objects.
protected  IRemoveFeature getRemoveFeatureAdditional(IRemoveContext context)
          Gets the additional remove feature.
 IResizeShapeFeature getResizeShapeFeature(IResizeShapeContext context)
          Resize shape features respond to user's resize requests.
protected  IResizeShapeFeature getResizeShapeFeatureAdditional(IResizeShapeContext context)
          Gets the additional resize shape feature.
 IUpdateFeature getUpdateFeature(IUpdateContext context)
          Update features do the synchronization work and transport data from domain model to pictograms model elements.
protected  IUpdateFeature getUpdateFeatureAdditional(IUpdateContext context)
          Gets additional the update feature.
protected  void traceWarning(String string, IPattern pattern, IPattern choosenPattern)
          Trace warning.
 
Methods inherited from class org.eclipse.graphiti.ui.features.DefaultFeatureProvider
getAddBendpointFeature, getCopyFeature, getCustomFeatures, getMoveAnchorFeature, getMoveBendpointFeature, getMoveConnectionDecoratorFeature, getPasteFeature, getRemoveBendpointFeature
 
Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeatureProvider
addIfPossible, canAdd, canLayout, canUpdate, dispose, getAllBusinessObjectsForPictogramElement, getAllPictogramElementsForBusinessObject, getDiagramTypeProvider, getDirectEditingInfo, getDragAndDropFeatures, getIndependenceSolver, getLinkService, getPictogramElementForBusinessObject, getPrintFeature, getReconnectionFeature, getSaveImageFeature, hasPictogramElementForBusinessObject, layoutIfPossible, link, link, setIndependenceSolver, updateIfPossible, updateIfPossibleAndNeeded, updateNeeded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patterns

private List<IPattern> patterns

connectionPatters

private List<IConnectionPattern> connectionPatters
Constructor Detail

DefaultFeatureProviderWithPatterns

public DefaultFeatureProviderWithPatterns(IDiagramTypeProvider dtp)
Creates a new DefaultFeatureProviderWithPatterns.

Parameters:
dtp - the diagram type provider
Method Detail

addPattern

public void addPattern(IPattern pattern)
Description copied from interface: IPatternContainer
Adds the pattern.

Specified by:
addPattern in interface IPatternContainer
Parameters:
pattern - the pattern

addConnectionPattern

public void addConnectionPattern(IConnectionPattern pattern)
Adds a connection pattern.

Parameters:
pattern - the connection pattern

getPatterns

protected List<IPattern> getPatterns()
Gets the patterns.

Returns:
the patterns

getConnectionPatterns

protected List<IConnectionPattern> getConnectionPatterns()
Gets the connection patterns.

Returns:
the connection patterns

checkFeatureAndContext

protected boolean checkFeatureAndContext(IFeature feature,
                                         IContext context)
Check feature and context.

Parameters:
feature - the feature
context - the context
Returns:
true, if successful

getAddFeature

public IAddFeature getAddFeature(IAddContext context)
Description copied from interface: IFeatureProvider
Add features create graphical representations of domain model objects.

Specified by:
getAddFeature in interface IFeatureProvider
Overrides:
getAddFeature in class AbstractFeatureProvider
Parameters:
context - the context
Returns:
add feature according to the given context
See Also:
IAddFeature

getAddFeatureAdditional

protected IAddFeature getAddFeatureAdditional(IAddContext context)
Gets the additional add feature.

Parameters:
context - the add context
Returns:
the additional add feature

getCreateFeatures

public ICreateFeature[] getCreateFeatures()
Description copied from interface: IFeatureProvider
Provides all create features. In the graphics framework they will be visualized in an editor as create tools.

Specified by:
getCreateFeatures in interface IFeatureProvider
Overrides:
getCreateFeatures in class AbstractFeatureProvider
Returns:
all create features
See Also:
ICreateFeature

getCreateFeaturesAdditional

protected ICreateFeature[] getCreateFeaturesAdditional()
Gets the additional create features.

Returns:
the additional create features

getDeleteFeature

public IDeleteFeature getDeleteFeature(IDeleteContext context)
Description copied from interface: IFeatureProvider
Delete features remove the grapical representations of domain model objects as well as the domain model objects itself.

Specified by:
getDeleteFeature in interface IFeatureProvider
Overrides:
getDeleteFeature in class DefaultFeatureProvider
Parameters:
context - the context
Returns:
delete feature according to the given context
See Also:
IDeleteFeature

getDeleteFeatureAdditional

protected IDeleteFeature getDeleteFeatureAdditional(IDeleteContext context)
Gets the additional delete feature.

Parameters:
context - the delete context
Returns:
the additional delete feature

getRemoveFeature

public IRemoveFeature getRemoveFeature(IRemoveContext context)
Description copied from interface: IFeatureProvider
Remove features remove the grapical representations of domain model objects.

Specified by:
getRemoveFeature in interface IFeatureProvider
Overrides:
getRemoveFeature in class DefaultFeatureProvider
Parameters:
context - the context
Returns:
remove feature according to the given context
See Also:
IRemoveFeature

getRemoveFeatureAdditional

protected IRemoveFeature getRemoveFeatureAdditional(IRemoveContext context)
Gets the additional remove feature.

Parameters:
context - the remove context
Returns:
the additional remove feature

getLayoutFeature

public ILayoutFeature getLayoutFeature(ILayoutContext context)
Description copied from interface: IFeatureProvider
Layout features do the layouting work (sizes and dimensions) inside (and/or) outside a pictogram element.

Specified by:
getLayoutFeature in interface IFeatureProvider
Overrides:
getLayoutFeature in class AbstractFeatureProvider
Parameters:
context - the context
Returns:
layout feature according to the given context
See Also:
ILayoutFeature

getLayoutFeatureAdditional

protected ILayoutFeature getLayoutFeatureAdditional(ILayoutContext context)
Gets the additional layout feature.

Parameters:
context - the layout context
Returns:
the additional layout feature

getMoveShapeFeature

public IMoveShapeFeature getMoveShapeFeature(IMoveShapeContext context)
Description copied from interface: IFeatureProvider
Move shape features respond to user's move requests.

Specified by:
getMoveShapeFeature in interface IFeatureProvider
Overrides:
getMoveShapeFeature in class DefaultFeatureProvider
Parameters:
context - the context
Returns:
move feature according to the given context
See Also:
IMoveShapeFeature

getMoveShapeFeatureAdditional

protected IMoveShapeFeature getMoveShapeFeatureAdditional(IMoveShapeContext context)
Gets the additional move shape feature.

Parameters:
context - the move shape context
Returns:
the additional move shape feature

getResizeShapeFeature

public IResizeShapeFeature getResizeShapeFeature(IResizeShapeContext context)
Description copied from interface: IFeatureProvider
Resize shape features respond to user's resize requests.

Specified by:
getResizeShapeFeature in interface IFeatureProvider
Overrides:
getResizeShapeFeature in class DefaultFeatureProvider
Parameters:
context - the context
Returns:
resize feature according to the given context
See Also:
IResizeShapeFeature

checkPattern

protected boolean checkPattern(IPattern pattern,
                               Object object)
Check pattern.

Parameters:
pattern - the pattern
object - the object
Returns:
true, if successful

getResizeShapeFeatureAdditional

protected IResizeShapeFeature getResizeShapeFeatureAdditional(IResizeShapeContext context)
Gets the additional resize shape feature.

Parameters:
context - the context
Returns:
the additional resize shape feature

getUpdateFeature

public IUpdateFeature getUpdateFeature(IUpdateContext context)
Description copied from interface: IFeatureProvider
Update features do the synchronization work and transport data from domain model to pictograms model elements.

Specified by:
getUpdateFeature in interface IFeatureProvider
Overrides:
getUpdateFeature in class DefaultFeatureProvider
Parameters:
context - the context
Returns:
update feature according to the given context
See Also:
IUpdateFeature

getUpdateFeatureAdditional

protected IUpdateFeature getUpdateFeatureAdditional(IUpdateContext context)
Gets additional the update feature.

Parameters:
context - the update context
Returns:
the additional update feature

getPatternForPictogramElement

public IPattern getPatternForPictogramElement(PictogramElement pe)
Description copied from interface: IFeatureProviderWithPatterns
Gets the pattern for pictogram element.

Specified by:
getPatternForPictogramElement in interface IFeatureProviderWithPatterns
Parameters:
pe - the pictogram element
Returns:
the pattern for pictogram element

activateDirectEditingForPatterns

public void activateDirectEditingForPatterns(PictogramElement mainPictogramElement,
                                             Object bo)
Description copied from interface: IFeatureProviderWithPatterns
Activate direct editing for patterns.

Specified by:
activateDirectEditingForPatterns in interface IFeatureProviderWithPatterns
Parameters:
mainPictogramElement - the main pictogram element
bo - the business object

activateDirectEditingForPatterns

public void activateDirectEditingForPatterns(PictogramElement mainPictogramElement,
                                             Object bo,
                                             String keyProperty)
Description copied from interface: IFeatureProviderWithPatterns
Activate direct editing for patterns.

Specified by:
activateDirectEditingForPatterns in interface IFeatureProviderWithPatterns
Parameters:
mainPictogramElement - the main pictogram element
bo - the business object
keyProperty - the key property

getCreateConnectionFeatures

public ICreateConnectionFeature[] getCreateConnectionFeatures()
Description copied from interface: IFeatureProvider
Gets the create connection features.

Specified by:
getCreateConnectionFeatures in interface IFeatureProvider
Overrides:
getCreateConnectionFeatures in class AbstractFeatureProvider
Returns:
all features to create connections
See Also:
ICreateConnectionFeature

getCreateConnectionFeaturesAdditional

protected ICreateConnectionFeature[] getCreateConnectionFeaturesAdditional()
Gets the additional create connection features.

Returns:
the additional create connection features

getDirectEditingFeature

public IDirectEditingFeature getDirectEditingFeature(IDirectEditingContext context)
Description copied from interface: IFeatureProvider
Direct editing features handle direct editing functionality (including drop down lists and text completion).

Specified by:
getDirectEditingFeature in interface IFeatureProvider
Overrides:
getDirectEditingFeature in class AbstractFeatureProvider
Parameters:
context - the context
Returns:
direct editing feature according to the given context
See Also:
IDirectEditingFeature

getDirectEditingFeatureAdditional

protected IDirectEditingFeature getDirectEditingFeatureAdditional(IDirectEditingContext context)
Gets the additional direct editing feature.

Parameters:
context - the direct editing context
Returns:
the additional direct editing feature

traceWarning

protected void traceWarning(String string,
                            IPattern pattern,
                            IPattern choosenPattern)
Trace warning.

Parameters:
string - the string
pattern - the pattern
choosenPattern - the choosen pattern

getBusinessObjectForPictogramElement

public Object getBusinessObjectForPictogramElement(PictogramElement pictogramElement)
Description copied from interface: IMappingProvider
Returns the first of possibly several business objects which are linked to the given pictogram element. This is a convenience method for IMappingProvider.getAllBusinessObjectsForPictogramElement(PictogramElement), because in many usecases only a single business object is linked.

Specified by:
getBusinessObjectForPictogramElement in interface IMappingProvider
Overrides:
getBusinessObjectForPictogramElement in class AbstractFeatureProvider
Parameters:
pictogramElement - The pictogram element for which to return the business object.
Returns:
The first of possibly several business objects which are linked to the given pictogram element. Can be null.
See Also:
IMappingProvider.link(PictogramElement, Object)


Copyright (c) SAP AG 2005, 2010.