Class LinkServiceImpl
java.lang.Object
org.eclipse.graphiti.internal.services.impl.LinkServiceImpl
- All Implemented Interfaces:
ILinkService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.emf.ecore.EObject[]
getAllBusinessObjectsForLinkedPictogramElement
(PictogramElement pictogramElement) Returns all business objects which are linked to the given pictogram element.org.eclipse.emf.ecore.EObject
getBusinessObjectForLinkedPictogramElement
(PictogramElement pictogramElement) Returns the first of possibly several business objects which are linked to the given pictogram element.getLinkForPictogramElement
(PictogramElement pictogramElement) Returns the pictogram link referencing the given pictogram element.getLinkProperty
(PictogramElement pictogramElement) Gets the link property to a given pictogram element.getPictogramElements
(Diagram diagram, List<org.eclipse.emf.ecore.EObject> eObjects, boolean onlyActive) Gets the pictogram elements.getPictogramElements
(Diagram diagram, org.eclipse.emf.ecore.EObject eObject) get all pictogram elements which references the given eObject.boolean
hasLinkProperty
(PictogramElement pictogramElement, String propertyValue) Checks existence and value of the link property to a given pictogram element.void
setLinkProperty
(PictogramElement pictogramElement, String propertyValue) Adds or modifies the link property to a given pictogram element.
-
Constructor Details
-
LinkServiceImpl
public LinkServiceImpl()
-
-
Method Details
-
getAllBusinessObjectsForLinkedPictogramElement
public org.eclipse.emf.ecore.EObject[] getAllBusinessObjectsForLinkedPictogramElement(PictogramElement pictogramElement) Returns all business objects which are linked to the given pictogram element.- Specified by:
getAllBusinessObjectsForLinkedPictogramElement
in interfaceILinkService
- 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.
-
getBusinessObjectForLinkedPictogramElement
public org.eclipse.emf.ecore.EObject getBusinessObjectForLinkedPictogramElement(PictogramElement pictogramElement) Returns the first of possibly several business objects which are linked to the given pictogram element. This is a convenience method for#getAllBusinessObjectsForPictogramElement(PictogramElement)
, because in many use cases only a single business object is linked.- Specified by:
getBusinessObjectForLinkedPictogramElement
in interfaceILinkService
- Parameters:
pictogramElement
- The pictogram element for which to return the business objects.- Returns:
- The first of possibly several business objects which are linked to the given pictogram element. Can be null.
-
getLinkForPictogramElement
Returns the pictogram link referencing the given pictogram element.- Specified by:
getLinkForPictogramElement
in interfaceILinkService
- Parameters:
pictogramElement
- the pictogram element- Returns:
- the pictogram link referencing the given pictogram element
-
getPictogramElements
public List<PictogramElement> getPictogramElements(Diagram diagram, org.eclipse.emf.ecore.EObject eObject) get all pictogram elements which references the given eObject.- Specified by:
getPictogramElements
in interfaceILinkService
- Parameters:
eObject
- the ref objectdiagram
- the diagram- Returns:
- the pictogram elements
-
getPictogramElements
public List<PictogramElement> getPictogramElements(Diagram diagram, List<org.eclipse.emf.ecore.EObject> eObjects, boolean onlyActive) Gets the pictogram elements.- Specified by:
getPictogramElements
in interfaceILinkService
- Parameters:
diagram
- the diagrameObjects
- business objectsonlyActive
- if true, then only active pictogram elements of the diagram will be considered; if false all pictogram elements will be considered- Returns:
- all (active) pictogram elements in the diagram, which have at least one reference to one of the business objects
-
hasLinkProperty
Checks existence and value of the link property to a given pictogram element. It is intended to use this property to be able to distinguish multiple pictogram elements linked to same domain model object.- Specified by:
hasLinkProperty
in interfaceILinkService
- Parameters:
pictogramElement
- the pictogram elementpropertyValue
- the value to check against the property- Returns:
- true if link property exists and has the given value; false if not
-
setLinkProperty
Adds or modifies the link property to a given pictogram element. It is intended to use this property to be able to distinguish multiple pictogram elements linked to same domain model object.- Specified by:
setLinkProperty
in interfaceILinkService
- Parameters:
pictogramElement
- the pictogram elementpropertyValue
- the new value for the link property
-
getLinkProperty
Gets the link property to a given pictogram element.- Specified by:
getLinkProperty
in interfaceILinkService
- Parameters:
pictogramElement
- the pictogram element- Returns:
- the link property
-