Package org.eclipse.graphiti.services
Interface ILinkService
- All Known Implementing Classes:
LinkServiceImpl
public interface ILinkService
The interface ILinkService provides services for the link handling between
the graphical representation (pictogram elements) and the domain model
(business objects).
-
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.emf.ecore.EObject[]getAllBusinessObjectsForLinkedPictogramElement(PictogramElement pictogramElement) Returns all business objects which are linked to the given pictogram element.
Note: Identity of domain or business objects is determined by default using the methodEcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject), which relies on the compared EMF objects having different IDs or attributes.org.eclipse.emf.ecore.EObjectgetBusinessObjectForLinkedPictogramElement(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 all pictogram elements which references at least one of the given business objects.
Note: Identity of domain or business objects is determined by default using the methodEcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject), which relies on the compared EMF objects having different IDs or attributes.getPictogramElements(Diagram diagram, org.eclipse.emf.ecore.EObject eObject) Gets all pictogram elements which references the given business object.
Note: Identity of domain or business objects is determined by default using the methodEcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject), which relies on the compared EMF objects having different IDs or attributes.booleanhasLinkProperty(PictogramElement pictogramElement, String propertyValue) Checks existence and value of the link property to a given pictogram element.voidsetLinkProperty(PictogramElement pictogramElement, String propertyValue) Adds or modifies the link property to a given pictogram element.
-
Method Details
-
getAllBusinessObjectsForLinkedPictogramElement
org.eclipse.emf.ecore.EObject[] getAllBusinessObjectsForLinkedPictogramElement(PictogramElement pictogramElement) Returns all business objects which are linked to the given pictogram element.
Note: Identity of domain or business objects is determined by default using the methodEcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject), which relies on the compared EMF objects having different IDs or attributes. The way Graphiti used to compare EMF business objects can be changed by overridingIToolBehaviorProvider.equalsBusinessObjects(Object, Object).- 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
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 forgetAllBusinessObjectsForLinkedPictogramElement(PictogramElement), because in many use cases only a single business object is linked.
Note: Identity of domain or business objects is determined by default using the methodEcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject), which relies on the compared EMF objects having different IDs or attributes. The way Graphiti used to compare EMF business objects can be changed by overridingIToolBehaviorProvider.equalsBusinessObjects(Object, Object).- 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.- Parameters:
pictogramElement- the pictogram element- Returns:
- the pictogram link referencing the given pictogram element
-
getPictogramElements
Gets all pictogram elements which references the given business object.
Note: Identity of domain or business objects is determined by default using the methodEcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject), which relies on the compared EMF objects having different IDs or attributes. The way Graphiti used to compare EMF business objects can be changed by overridingIToolBehaviorProvider.equalsBusinessObjects(Object, Object).- Parameters:
diagram- the diagrameObject- the referenced business object- Returns:
- all pictogram elements in the diagram which references the given business object
-
getPictogramElements
List<PictogramElement> getPictogramElements(Diagram diagram, List<org.eclipse.emf.ecore.EObject> eObjects, boolean onlyActive) Gets all pictogram elements which references at least one of the given business objects.
Note: Identity of domain or business objects is determined by default using the methodEcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject), which relies on the compared EMF objects having different IDs or attributes. The way Graphiti used to compare EMF business objects can be changed by overridingIToolBehaviorProvider.equalsBusinessObjects(Object, Object).- Parameters:
diagram- the diagrameObjects- the referenced 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 disinguish multiple pictogram elements linked to same domain model object.- Parameters:
pictogramElement- the pictogram elementpropertyValue- the value to check against the property- Returns:
- true if link property exists an 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 disinguish multiple pictogram elements linked to same domain model object.- Parameters:
pictogramElement- the pictogram elementpropertyValue- the new value for the link property
-
getLinkProperty
Gets the link property to a given pictogram element.- Parameters:
pictogramElement- the pictogram element- Returns:
- the link property
-