Class 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 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:

    • 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 are

    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.

    Since:
    1.4
    Author:
    Eugen Neufeld
    • 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 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultReferenceService

        public DefaultReferenceService()
    • Method Detail

      • getPriority

        public int getPriority()
        Description copied from interface: ViewModelService
        Returns the priority for this view service.
        Specified by:
        getPriority in interface ViewModelService
        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 the EReference. The implementation is responsible for providing a selection meachsims, e.g. a dialog.
        Specified by:
        addNewModelElements in interface ReferenceService
        Parameters:
        eObject - the EObject to add
        eReference - the EReference to add the EObject 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 the EReference. The implementation is responsible for providing a selection mechanism, e.g. a dialog.
        Specified by:
        addNewModelElements in interface ReferenceService
        Parameters:
        eObject - the EObject to add
        eReference - the EReference to add the EObject to
        openInNewContext - 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 an EObject in a new context.
        Specified by:
        openInNewContext in interface ReferenceService
        Parameters:
        eObject - the EObject 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 the EReference. The implementation is responsible for providing a selection meachsims, e.g. a dialog.
        Specified by:
        addExistingModelElements in interface ReferenceService
        Parameters:
        eObject - the EObject to add
        eReference - the EReference to add the EObject to