Class DefaultReferenceService
- java.lang.Object
-
- org.eclipse.emf.ecp.ui.view.swt.DefaultReferenceService
-
- All Implemented Interfaces:
ReferenceService
,ViewModelService
- Direct Known Subclasses:
EcoreReferenceService
public class DefaultReferenceService extends java.lang.Object implements ReferenceService
The
DefaultReferenceService
is the standard implementation of theReferenceService
. It is customizable by registration of vendors of customization strategies as OSGi service components that participate in a bazaar to provide their customizations for theReferenceService
operations to which they apply. In thecontext
of that bazaar, theDefaultReferenceService
supplies supplies the following context variables for injection into customization vendors:- the
EObject
that owns the reference that is being edited - the
EReference
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
areAttachmentStrategy
CreateNewModelElementStrategy
EObjectSelectionStrategy
OpenInNewContextStrategy
ReferenceStrategy
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, theReferenceStrategy.Provider
interface.- Since:
- 1.4
- Author:
- Eugen Neufeld
-
-
Constructor Summary
Constructors Constructor Description DefaultReferenceService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addExistingModelElements(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference eReference)
Adds existing model elements to theEReference
.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 theEReference
.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 anEObject
in a new context.
-
-
-
Method Detail
-
instantiate
public void instantiate(ViewModelContext context)
Description copied from interface:ViewModelService
Instantiate the view service.- Specified by:
instantiate
in interfaceViewModelService
- Parameters:
context
- theViewModelContext
-
dispose
public void dispose()
Description copied from interface:ViewModelService
Dispose.- Specified by:
dispose
in interfaceViewModelService
-
getPriority
public int getPriority()
Description copied from interface:ViewModelService
Returns the priority for this view service.- Specified by:
getPriority
in interfaceViewModelService
- Returns:
- the priority
-
addNewModelElements
@Deprecated public void addNewModelElements(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference eReference)
Deprecated.Description copied from interface:ReferenceService
Adds new model elements to theEReference
. The implementation is responsible for providing a selection meachsims, e.g. a dialog.- Specified by:
addNewModelElements
in interfaceReferenceService
- Parameters:
eObject
- theEObject
to addeReference
- theEReference
to add theEObject
to
-
addNewModelElements
public Optional<org.eclipse.emf.ecore.EObject> addNewModelElements(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference eReference, boolean openInNewContext)
Description copied from interface:ReferenceService
Adds new model elements to theEReference
. The implementation is responsible for providing a selection mechanism, e.g. a dialog.- Specified by:
addNewModelElements
in interfaceReferenceService
- Parameters:
eObject
- theEObject
to addeReference
- theEReference
to add theEObject
toopenInNewContext
- Hints the reference service whether the created model element should be opened in a new context- Returns:
- The created model element
- Since:
- 1.17
-
openInNewContext
public void openInNewContext(org.eclipse.emf.ecore.EObject eObject)
Description copied from interface:ReferenceService
Opens anEObject
in a new context.- Specified by:
openInNewContext
in interfaceReferenceService
- Parameters:
eObject
- theEObject
to open in a new context
-
addExistingModelElements
public void addExistingModelElements(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference eReference)
Description copied from interface:ReferenceService
Adds existing model elements to theEReference
. The implementation is responsible for providing a selection meachsims, e.g. a dialog.- Specified by:
addExistingModelElements
in interfaceReferenceService
- Parameters:
eObject
- theEObject
to addeReference
- theEReference
to add theEObject
to
-
-