public class DefaultFeatureProviderWithPatterns extends DefaultFeatureProvider implements IFeatureProviderWithPatterns
addPattern(IPattern)
and
addConnectionPattern(IConnectionPattern)
) delegate to the pattern
automatically.Constructor and Description |
---|
DefaultFeatureProviderWithPatterns(IDiagramTypeProvider dtp)
Creates a new instance of
DefaultFeatureProviderWithPatterns . |
Modifier and Type | Method and Description |
---|---|
void |
activateDirectEditingForPatterns(PictogramElement mainPictogramElement,
java.lang.Object domainObject)
Convenience method to activate the direct editing for the given
PictogramElement and domain object. |
void |
activateDirectEditingForPatterns(PictogramElement mainPictogramElement,
java.lang.Object domainObject,
java.lang.String keyProperty)
Convenience method to activate the direct editing for the given
PictogramElement and domain object. |
void |
addConnectionPattern(IConnectionPattern pattern)
Adds a pattern defined to handle connections to the list of registered
patterns.
|
void |
addPattern(IPattern pattern)
Adds a pattern defined to handle shapes to the list of registered
patterns.
|
IAddFeature |
getAddFeature(IAddContext context)
Tries to retrieve an add feature suiting the given add context from the
registered patterns.
|
java.lang.Object |
getBusinessObjectForPictogramElement(PictogramElement pictogramElement)
Helper method to find the domain object for a given
PictogramElement . |
ICreateConnectionFeature[] |
getCreateConnectionFeatures()
Retrieves an array of create connection features that are available from
the registered patterns and the super class of this feature provider.
|
ICreateFeature[] |
getCreateFeatures()
Retrieves an array of create features that are available from the
registered patterns and the super class of this feature provider.
|
IDeleteFeature |
getDeleteFeature(IDeleteContext context)
Tries to retrieve a delete feature suiting the given delete context from
the registered patterns.
|
IDirectEditingFeature |
getDirectEditingFeature(IDirectEditingContext context)
Tries to retrieve a direct editing feature suiting the given direct
editing context from the registered patterns.
|
ILayoutFeature |
getLayoutFeature(ILayoutContext context)
Tries to retrieve a layout feature suiting the given layout context from
the registered patterns.
|
IMoveShapeFeature |
getMoveShapeFeature(IMoveShapeContext context)
Tries to retrieve a move feature for shapes suiting the given move
context from the registered patterns.
|
IPattern |
getPatternForPictogramElement(PictogramElement pe)
Gets the pattern for pictogram element.
|
IRemoveFeature |
getRemoveFeature(IRemoveContext context)
Tries to retrieve a remove feature suiting the given remove context from
the registered patterns.
|
IResizeShapeFeature |
getResizeShapeFeature(IResizeShapeContext context)
Tries to retrieve a resize feature for shapes suiting the given resize
context from the registered patterns.
|
IUpdateFeature |
getUpdateFeature(IUpdateContext context)
Tries to retrieve an update feature suiting the given update context from
the registered patterns.
|
getAddBendpointFeature, getCopyFeature, getCustomFeatures, getMoveAnchorFeature, getMoveBendpointFeature, getMoveConnectionDecoratorFeature, getPasteFeature, getPrintFeature, getRemoveBendpointFeature, getSaveImageFeature
addIfPossible, canAdd, canLayout, canUpdate, dispose, getAllBusinessObjectsForPictogramElement, getAllPictogramElementsForBusinessObject, getDiagramTypeProvider, getDirectEditingInfo, getDragAndDropFeatures, getPictogramElementForBusinessObject, getReconnectionFeature, hasPictogramElementForBusinessObject, layoutIfPossible, link, link, updateIfPossible, updateIfPossibleAndNeeded, updateNeeded
public DefaultFeatureProviderWithPatterns(IDiagramTypeProvider dtp)
DefaultFeatureProviderWithPatterns
.
This is usually done from the diagram type provider.dtp
- The diagram type provider associated with this feature
provider.public void addPattern(IPattern pattern)
addConnectionPattern(IConnectionPattern)
. The pattern must not
be null
, or a IllegalArgumentException
will be
thrown.addPattern
in interface IPatternContainer
pattern
- The Pattern to addpublic void addConnectionPattern(IConnectionPattern pattern)
addPattern(IPattern)
. The pattern must not be null
,
or a IllegalArgumentException
will be thrown.pattern
- The Pattern to addpublic IAddFeature getAddFeature(IAddContext context)
getAddFeatureAdditional(IAddContext)
).getAddFeature
in interface IFeatureProvider
getAddFeature
in class AbstractFeatureProvider
context
- An IAddContext
describing the needed functionalityIAddFeature
in case a suitable functionality has been
found, null
otherwise.IAddFeature
public ICreateFeature[] getCreateFeatures()
getCreateConnectionFeaturesAdditional()
).getCreateFeatures
in interface IFeatureProvider
getCreateFeatures
in class AbstractFeatureProvider
ICreateFeature
s in case a suitable
functionality has been found, an empty array otherwise.ICreateFeature
public IDeleteFeature getDeleteFeature(IDeleteContext context)
getDeleteFeatureAdditional(IDeleteContext)
).getDeleteFeature
in interface IFeatureProvider
getDeleteFeature
in class DefaultFeatureProvider
context
- An IDeleteContext
describing the needed functionalityIDeleteFeature
in case a suitable functionality has
been found, null
otherwise.IDeleteFeature
public IRemoveFeature getRemoveFeature(IRemoveContext context)
getRemoveFeatureAdditional(IRemoveContext)
).getRemoveFeature
in interface IFeatureProvider
getRemoveFeature
in class DefaultFeatureProvider
context
- An IRemoveContext
describing the needed functionalityIRemoveFeature
in case a suitable functionality has
been found, null
otherwise.IRemoveFeature
public ILayoutFeature getLayoutFeature(ILayoutContext context)
getLayoutFeatureAdditional(ILayoutContext)
).getLayoutFeature
in interface IFeatureProvider
getLayoutFeature
in class AbstractFeatureProvider
context
- An ILayoutContext
describing the needed functionalityILayoutFeature
in case a suitable functionality has
been found, null
otherwise.ILayoutFeature
public IMoveShapeFeature getMoveShapeFeature(IMoveShapeContext context)
getMoveShapeFeatureAdditional(IMoveShapeContext)
).getMoveShapeFeature
in interface IFeatureProvider
getMoveShapeFeature
in class DefaultFeatureProvider
context
- An IMoveShapeContext
describing the needed
functionalityIMoveShapeFeature
in case a suitable functionality has
been found, null
otherwise.IMoveShapeFeature
public IResizeShapeFeature getResizeShapeFeature(IResizeShapeContext context)
getResizeShapeFeatureAdditional(IResizeShapeContext)
).getResizeShapeFeature
in interface IFeatureProvider
getResizeShapeFeature
in class DefaultFeatureProvider
context
- An IResizeShapeContext
describing the needed
functionalityIResizeShapeFeature
in case a suitable functionality
has been found, null
otherwise.IResizeShapeFeature
public IUpdateFeature getUpdateFeature(IUpdateContext context)
getUpdateFeatureAdditional(IUpdateContext)
).getUpdateFeature
in interface IFeatureProvider
getUpdateFeature
in class DefaultFeatureProvider
context
- An IUpdateContext
describing the needed functionalityIUpdateFeature
in case a suitable functionality has
been found, null
otherwise.IUpdateFeature
public IPattern getPatternForPictogramElement(PictogramElement pe)
IFeatureProviderWithPatterns
getPatternForPictogramElement
in interface IFeatureProviderWithPatterns
pe
- the pictogram elementpublic void activateDirectEditingForPatterns(PictogramElement mainPictogramElement, java.lang.Object domainObject)
PictogramElement
and domain object. The default implementation
tries to retrieve the direct editing functionality from the registered
patterns for shapes.activateDirectEditingForPatterns
in interface IFeatureProviderWithPatterns
mainPictogramElement
- The root PictogramElement
for which direct editing
shall be triggered. This pictogram element is used to find a
suitable pattern for this request via
AbstractPattern.isPatternRoot(PictogramElement)
.domainObject
- The domain object behind the direct editing request. This
object is passed to the IDirectEditingInfo
.public void activateDirectEditingForPatterns(PictogramElement mainPictogramElement, java.lang.Object domainObject, java.lang.String keyProperty)
PictogramElement
and domain object. The default implementation
tries to retrieve the direct editing functionality from the registered
patterns for shapes.activateDirectEditingForPatterns
in interface IFeatureProviderWithPatterns
mainPictogramElement
- The root PictogramElement
for which direct editing
shall be triggered. This pictogram element is used to find a
suitable pattern for this request via
AbstractPattern.isPatternRoot(PictogramElement)
.domainObject
- The domain object behind the direct editing request. This
object is passed to the IDirectEditingInfo
.keyProperty
- An additional key property that is passed to the
IDirectEditingInfo
.public ICreateConnectionFeature[] getCreateConnectionFeatures()
getCreateConnectionFeaturesAdditional()
).getCreateConnectionFeatures
in interface IFeatureProvider
getCreateConnectionFeatures
in class AbstractFeatureProvider
ICreateConnectionFeature
s in case a suitable
functionality has been found, an empty array otherwise.ICreateConnectionFeature
public IDirectEditingFeature getDirectEditingFeature(IDirectEditingContext context)
getDirectEditingFeatureAdditional(IDirectEditingContext)
).getDirectEditingFeature
in interface IFeatureProvider
getDirectEditingFeature
in class AbstractFeatureProvider
context
- An IDirectEditingContext
describing the needed
functionalityIDirectEditingFeature
in case a suitable functionality
has been found, null
otherwise.IDirectEditingFeature
public java.lang.Object getBusinessObjectForPictogramElement(PictogramElement pictogramElement)
PictogramElement
. The default implementation first delegates to
AbstractFeatureProvider.getBusinessObjectForPictogramElement(PictogramElement)
and then directly tries to follow an eventually set link property, see
ILinkService.setLinkProperty(PictogramElement, String)
.getBusinessObjectForPictogramElement
in interface IMappingProvider
getBusinessObjectForPictogramElement
in class AbstractFeatureProvider
pictogramElement
- The PictogramElement
to find the domain object for.null
otherwise.IMappingProvider.link(PictogramElement, Object)