Package org.eclipse.graphiti.features
Class DefaultFeatureProviderWrapper
java.lang.Object
org.eclipse.graphiti.features.DefaultFeatureProviderWrapper
- All Implemented Interfaces:
IFeatureProvider
,IMappingProvider
- Direct Known Subclasses:
ConfigurableFeatureProviderWrapper
The Class DefaultFeatureProviderWrapper.
-
Constructor Summary
ConstructorDescriptionDefaultFeatureProviderWrapper
(IFeatureProvider innerFeatureProvider) Creates a newDefaultFeatureProviderWrapper
. -
Method Summary
Modifier and TypeMethodDescriptionaddIfPossible
(IAddContext context) Adds the if possible.canAdd
(IAddContext context) Can add.canLayout
(ILayoutContext context) Checks if an layout process can be processed.canUpdate
(IUpdateContext context) Checks if an update process can be processed.void
dispose()
This is called to dispose the object.Add bendpoint features handle the user's requst to have more connection bendpoints.getAddFeature
(IAddContext context) Add features create graphical representations of domain model objects.Object[]
getAllBusinessObjectsForPictogramElement
(PictogramElement pictogramElement) Returns all business objects which are linked to the given pictogram element.getAllPictogramElementsForBusinessObject
(Object businessObject) Provides the pictogram elements which represents the given business object.getBusinessObjectForPictogramElement
(PictogramElement pictogramElement) Returns the first of possibly several business objects which are linked to the given pictogram element.getCopyFeature
(ICopyContext context) Copy features fill the clipboard.Gets the create connection features.Provides all create features.getCustomFeatures
(ICustomContext context) Custom features can do anything.getDeleteFeature
(IDeleteContext context) Delete features remove the grapical representations of domain model objects as well as the domain model objects itself.Returns the diagram type provider.Direct editing features handle direct editing functionality (including drop down lists and text completion).If a creation feature wants to switch directly into the direct editing mode (after the object creation),
it must provide the necessary information via this object.IFeature[]
if the user should be able to create connections directly from a pictogram element without using the connection tool you can provide an array of features.Gets the inner feature provider.getLayoutFeature
(ILayoutContext context) Layout features do the layouting work (sizes and dimensions) inside (and/or) outside a pictogram element.getMoveAnchorFeature
(IMoveAnchorContext context) Move features respond to user's move requests.Move features respond to user's move requests.Move features respond to user's move requests.getMoveShapeFeature
(IMoveShapeContext context) Move shape features respond to user's move requests.getPasteFeature
(IPasteContext context) Paste features bring clipboard content to the diagram.getPictogramElementForBusinessObject
(Object businessObject) This method is similar to the method getAllPictogramElementsForBusinessObject, but only return the first PictogramElement.It is planned to use this for printing support.Reconnection features handle the change of a connection's start or end anchor.Add bendpoint features handle the user's requst to remove connection bendpoints.getRemoveFeature
(IRemoveContext context) Remove features remove the grapical representations of domain model objects.getResizeShapeFeature
(IResizeShapeContext context) Resize shape features respond to user's resize requests.It is planned to use this for save as image support.getUpdateFeature
(IUpdateContext context) Update features do the synchronization work and transport data from domain model to pictograms model elements.boolean
hasPictogramElementForBusinessObject
(Object businessObject) Check does there have pictogram element linked to this business object.layoutIfPossible
(ILayoutContext context) Process the layout process.void
link
(PictogramElement pictogramElement, Object businessObject) Links the pictogram element with a business object.void
link
(PictogramElement pictogramElement, Object[] businessObjects) Links the pictogram element with several business objects.updateIfPossible
(IUpdateContext context) Process the update process.updateIfPossibleAndNeeded
(IUpdateContext context) Update if possible and needed.updateNeeded
(IUpdateContext context) Checks if an update process is needed and has be processed.
-
Constructor Details
-
DefaultFeatureProviderWrapper
Creates a newDefaultFeatureProviderWrapper
.- Parameters:
innerFeatureProvider
- the inner feature provider
-
-
Method Details
-
addIfPossible
Description copied from interface:IFeatureProvider
Adds the if possible.- Specified by:
addIfPossible
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- added pictogram elements
-
canAdd
Description copied from interface:IFeatureProvider
Can add.- Specified by:
canAdd
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- status and reason
-
canLayout
Description copied from interface:IFeatureProvider
Checks if an layout process can be processed. Usually implementers have to check the context.- Specified by:
canLayout
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- status and reason
-
canUpdate
Description copied from interface:IFeatureProvider
Checks if an update process can be processed. Usually implementers have to check the context.- Specified by:
canUpdate
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- status and reason
-
getAddBendpointFeature
Description copied from interface:IFeatureProvider
Add bendpoint features handle the user's requst to have more connection bendpoints.- Specified by:
getAddBendpointFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- add feature according to the given context
- See Also:
-
getAddFeature
Description copied from interface:IFeatureProvider
Add features create graphical representations of domain model objects.- Specified by:
getAddFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- add feature according to the given context
- See Also:
-
getAllBusinessObjectsForPictogramElement
Description copied from interface:IMappingProvider
Returns all business objects which are linked to the given pictogram element. Equality is determined by calling theEcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
method, but this might be changed by clients by overridingIToolBehaviorProvider.equalsBusinessObjects(Object, Object)
.- Specified by:
getAllBusinessObjectsForPictogramElement
in interfaceIMappingProvider
- Parameters:
pictogramElement
- The pictogram element for which to return the business objects.- Returns:
- The business objects which are linked to the given pictogram element. Can be empty but not null.
- See Also:
-
getAllPictogramElementsForBusinessObject
Description copied from interface:IMappingProvider
Provides the pictogram elements which represents the given business object.- Specified by:
getAllPictogramElementsForBusinessObject
in interfaceIMappingProvider
- Parameters:
businessObject
- the given business object- Returns:
- the pictogram elements
-
getBusinessObjectForPictogramElement
Description copied from interface:IMappingProvider
Returns the first of possibly several business objects which are linked to the given pictogram element. Equality is determined by calling theEcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
method, but this might be changed by clients by overridingIToolBehaviorProvider.equalsBusinessObjects(Object, Object)
. This is a convenience method forIMappingProvider.getAllBusinessObjectsForPictogramElement(PictogramElement)
, because in many usecases only a single business object is linked.- Specified by:
getBusinessObjectForPictogramElement
in interfaceIMappingProvider
- 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:
-
getCopyFeature
Description copied from interface:IFeatureProvider
Copy features fill the clipboard.- Specified by:
getCopyFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- copy feature according to the given context
- See Also:
-
getCreateConnectionFeatures
Description copied from interface:IFeatureProvider
Gets the create connection features.- Specified by:
getCreateConnectionFeatures
in interfaceIFeatureProvider
- Returns:
- all features to create connections
- See Also:
-
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 interfaceIFeatureProvider
- Returns:
- all create features
- See Also:
-
getCustomFeatures
Description copied from interface:IFeatureProvider
Custom features can do anything. Their functionality can not be planned by the graphics framework (team).- Specified by:
getCustomFeatures
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- custom feature according to the given context
- See Also:
-
getDeleteFeature
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 interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- delete feature according to the given context
- See Also:
-
getDiagramTypeProvider
Description copied from interface:IFeatureProvider
Returns the diagram type provider.- Specified by:
getDiagramTypeProvider
in interfaceIFeatureProvider
- Returns:
- the diagram type provider
- See Also:
-
getDirectEditingFeature
Description copied from interface:IFeatureProvider
Direct editing features handle direct editing functionality (including drop down lists and text completion).- Specified by:
getDirectEditingFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- direct editing feature according to the given context
- See Also:
-
getDirectEditingInfo
Description copied from interface:IFeatureProvider
If a creation feature wants to switch directly into the direct editing mode (after the object creation),
it must provide the necessary information via this object.- Specified by:
getDirectEditingInfo
in interfaceIFeatureProvider
- Returns:
IDirectEditingInfo
-
getDragAndDropFeatures
Description copied from interface:IFeatureProvider
if the user should be able to create connections directly from a pictogram element without using the connection tool you can provide an array of features. By providing one feature this feature will be executed directly on drop. By providing 2 or more features a popup menu will let the user select the feature.- Specified by:
getDragAndDropFeatures
in interfaceIFeatureProvider
- Parameters:
context
- - the pictogram element the drag and drop should be initiated on- Returns:
- an array of features or null.
-
getInnerFeatureProvider
Gets the inner feature provider.- Returns:
- the inner feature provider
-
getLayoutFeature
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 interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- layout feature according to the given context
- See Also:
-
getMoveAnchorFeature
Description copied from interface:IFeatureProvider
Move features respond to user's move requests. This one is especially for fix point anchors (FixPointAnchor
).- Specified by:
getMoveAnchorFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- move feature according to the given context
- See Also:
-
getMoveBendpointFeature
Description copied from interface:IFeatureProvider
Move features respond to user's move requests. This one is especially for fix point anchors (FixPointAnchor
).- Specified by:
getMoveBendpointFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- move feature according to the given context
- See Also:
-
getMoveConnectionDecoratorFeature
public IMoveConnectionDecoratorFeature getMoveConnectionDecoratorFeature(IMoveConnectionDecoratorContext context) Description copied from interface:IFeatureProvider
Move features respond to user's move requests.- Specified by:
getMoveConnectionDecoratorFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- move feature according to the given context
- See Also:
-
getMoveShapeFeature
Description copied from interface:IFeatureProvider
Move shape features respond to user's move requests.- Specified by:
getMoveShapeFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- move feature according to the given context
- See Also:
-
getPasteFeature
Description copied from interface:IFeatureProvider
Paste features bring clipboard content to the diagram.- Specified by:
getPasteFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- copy feature according to the given context
- See Also:
-
getPictogramElementForBusinessObject
Description copied from interface:IMappingProvider
This method is similar to the method getAllPictogramElementsForBusinessObject, but only return the first PictogramElement.- Specified by:
getPictogramElementForBusinessObject
in interfaceIMappingProvider
- Parameters:
businessObject
- the business object- Returns:
- linked pictogram element
- See Also:
-
getPrintFeature
Description copied from interface:IFeatureProvider
It is planned to use this for printing support. Not yet supported perfectly. The default implementation inAbstractFeatureProvider
returns the an instance ofDefaultPrintFeature
which could be overridden to influence the standard behaviour.
Returnnull
to disable printing.- Specified by:
getPrintFeature
in interfaceIFeatureProvider
- Returns:
- The print feature to use or
null
to disable printing. - See Also:
-
getReconnectionFeature
Description copied from interface:IFeatureProvider
Reconnection features handle the change of a connection's start or end anchor.- Specified by:
getReconnectionFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- reconnection feature according to the given context
- See Also:
-
getRemoveBendpointFeature
Description copied from interface:IFeatureProvider
Add bendpoint features handle the user's requst to remove connection bendpoints.- Specified by:
getRemoveBendpointFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- remove feature according to the given context
- See Also:
-
getRemoveFeature
Description copied from interface:IFeatureProvider
Remove features remove the grapical representations of domain model objects.- Specified by:
getRemoveFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- remove feature according to the given context
- See Also:
-
getResizeShapeFeature
Description copied from interface:IFeatureProvider
Resize shape features respond to user's resize requests.- Specified by:
getResizeShapeFeature
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- resize feature according to the given context
- See Also:
-
getSaveImageFeature
Description copied from interface:IFeatureProvider
It is planned to use this for save as image support. Not yet supported perfectly. The default implementation inAbstractFeatureProvider
returns the an instance ofDefaultSaveImageFeature
which could be overridden to influence the standard behaviour.
Returnnull
to disable save as image.- Specified by:
getSaveImageFeature
in interfaceIFeatureProvider
- Returns:
- The save feature to use or
null
to disable save as image.
-
getUpdateFeature
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 interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- update feature according to the given context
- See Also:
-
hasPictogramElementForBusinessObject
Description copied from interface:IMappingProvider
Check does there have pictogram element linked to this business object.- Specified by:
hasPictogramElementForBusinessObject
in interfaceIMappingProvider
- Parameters:
businessObject
- the business object- Returns:
- true when at least one pictogram element is linked, otherwise return false.
-
layoutIfPossible
Description copied from interface:IFeatureProvider
Process the layout process.- Specified by:
layoutIfPossible
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- status and reason, simply a
true
IReason
in case the layout operation was executed, afalse
IReason
otherwise.
-
link
Description copied from interface:IMappingProvider
Links the pictogram element with a business object. This deletes all previous links of this pictogram element.- Specified by:
link
in interfaceIMappingProvider
- Parameters:
pictogramElement
- The pictogram element which to link to a new business object.businessObject
- The business object to link. Can be null to just delete previous links.
-
link
Description copied from interface:IMappingProvider
Links the pictogram element with several business objects. This deletes all previous links of this pictogram element.- Specified by:
link
in interfaceIMappingProvider
- Parameters:
pictogramElement
- The pictogram element which to link to new business objects.businessObjects
- The business objects to link. Can be null or empty to just delete previous links.
-
updateIfPossible
Description copied from interface:IFeatureProvider
Process the update process. Usually reads businees data and modifies pictograms model.- Specified by:
updateIfPossible
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- status and reason
-
updateIfPossibleAndNeeded
Description copied from interface:IFeatureProvider
Update if possible and needed.- Specified by:
updateIfPossibleAndNeeded
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- status and reason
-
updateNeeded
Description copied from interface:IFeatureProvider
Checks if an update process is needed and has be processed. Usually implementers have to compare pictograms and business data.- Specified by:
updateNeeded
in interfaceIFeatureProvider
- Parameters:
context
- the context- Returns:
- status and reason
-
dispose
public void dispose()Description copied from interface:IFeatureProvider
This is called to dispose the object.- Specified by:
dispose
in interfaceIFeatureProvider
-