public class DefaultReferenceService extends Object implements ReferenceService
The DefaultReferenceService is the standard implementation of the ReferenceService.
It is customizable by registration of vendors
of customization strategies as OSGi service components that participate in a
bazaar to provide their customizations for the
ReferenceService operations to which they apply. In the
context of that bazaar, the DefaultReferenceService
supplies supplies the following context variables for injection into customization vendors:
EObject that owns the reference that is being editedEReference of the object that is being edited
As of the the 1.16 release, the customization strategies available to plug
application-specific behavior into the DefaultReferenceService are
AttachmentStrategyCreateNewModelElementStrategyEObjectSelectionStrategyOpenInNewContextStrategyReferenceStrategy
For the convenience of distinguishing OSGi service components providing (as bazaar vendors) these
different customization strategies, each of these interfaces defines a Provider
nested interface that is the OSGi Service Interface binding the particular customization
type as the vendor product type parameter. See, for example, the
ReferenceStrategy.Provider interface.
| Constructor and Description |
|---|
DefaultReferenceService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addExistingModelElements(org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EReference eReference)
Adds existing model elements to the
EReference. |
void |
addNewModelElements(org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EReference eReference)
Deprecated.
|
Optional<org.eclipse.emf.ecore.EObject> |
addNewModelElements(org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EReference eReference,
boolean openInNewContext)
Adds new model elements to the
EReference. |
void |
dispose()
Dispose.
|
int |
getPriority()
Returns the priority for this view service.
|
void |
instantiate(ViewModelContext context)
Instantiate the view service.
|
void |
openInNewContext(org.eclipse.emf.ecore.EObject eObject)
Opens an
EObject in a new context. |
public void instantiate(ViewModelContext context)
ViewModelServiceinstantiate in interface ViewModelServicecontext - the ViewModelContextpublic void dispose()
ViewModelServicedispose in interface ViewModelServicepublic int getPriority()
ViewModelServicegetPriority in interface ViewModelService@Deprecated public void addNewModelElements(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference eReference)
ReferenceServiceEReference.
The implementation is responsible for providing a selection meachsims, e.g. a dialog.addNewModelElements in interface ReferenceServiceeObject - the EObject to addeReference - the EReference to add the EObject topublic Optional<org.eclipse.emf.ecore.EObject> addNewModelElements(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference eReference, boolean openInNewContext)
ReferenceServiceEReference.
The implementation is responsible for providing a selection mechanism, e.g. a dialog.addNewModelElements in interface ReferenceServiceeObject - the EObject to addeReference - the EReference to add the EObject toopenInNewContext - Hints the reference service whether the created model element should be opened in a new
contextpublic void openInNewContext(org.eclipse.emf.ecore.EObject eObject)
ReferenceServiceEObject in a new context.openInNewContext in interface ReferenceServiceeObject - the EObject to open in a new contextpublic void addExistingModelElements(org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EReference eReference)
ReferenceServiceEReference.
The implementation is responsible for providing a selection meachsims, e.g. a dialog.addExistingModelElements in interface ReferenceServiceeObject - the EObject to addeReference - the EReference to add the EObject toCopyright © 2018. All rights reserved.