Class EMFModelConnector

  • All Implemented Interfaces:
    IModelConnector

    public class EMFModelConnector
    extends java.lang.Object
    implements IModelConnector
    Model connector implementation for the default EMF generated model editors.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.eclipse.ui.IEditorPart editorPart  
      protected org.eclipse.core.runtime.ILog logger  
      protected org.eclipse.ui.IWorkbenchPage workbenchPage  
    • Constructor Summary

      Constructors 
      Constructor Description
      EMFModelConnector​(org.eclipse.ui.IEditorPart editorPart)  
    • Field Detail

      • editorPart

        protected org.eclipse.ui.IEditorPart editorPart
      • logger

        protected org.eclipse.core.runtime.ILog logger
      • workbenchPage

        protected org.eclipse.ui.IWorkbenchPage workbenchPage
    • Constructor Detail

      • EMFModelConnector

        public EMFModelConnector​(org.eclipse.ui.IEditorPart editorPart)
    • Method Detail

      • loadModel

        public void loadModel​(IModelConnectorTypeEnum modelConnectorTypeEnum)
        Description copied from interface: IModelConnector
        Loads the instance model into the model connector with the given type.
        Specified by:
        loadModel in interface IModelConnector
        Parameters:
        modelConnectorTypeEnum - The model type which should be loaded.
      • showLocation

        public void showLocation​(java.lang.Object[] locationObjects)
        Specified by:
        showLocation in interface IModelConnector
        Parameters:
        locationObjects - Shows the location of these objects inside the specific editor.
      • getNotifier

        public org.eclipse.emf.common.notify.Notifier getNotifier​(IModelConnectorTypeEnum modelConnectorTypeEnum)
        Specified by:
        getNotifier in interface IModelConnector
        Returns:
        A Notifier implementation for the given IModelConnectorType.
      • prepareSelection

        protected org.eclipse.jface.viewers.TreeSelection prepareSelection​(java.lang.Object[] locationObjects)
      • navigateToElements

        protected void navigateToElements​(org.eclipse.ui.IEditorPart editorPart,
                                          org.eclipse.jface.viewers.IStructuredSelection selection)
      • createTreePath

        protected org.eclipse.jface.viewers.TreePath createTreePath​(org.eclipse.ui.IEditorPart editorPart,
                                                                    org.eclipse.emf.ecore.EObject obj)
      • getOwner

        public org.eclipse.ui.IWorkbenchPart getOwner()
        Specified by:
        getOwner in interface IModelConnector
        Returns:
        a workbench part (view, editor) which is the owner of the model adapted by the model connector
      • getSelectedEObjects

        public java.util.Collection<org.eclipse.emf.ecore.EObject> getSelectedEObjects()
        Description copied from interface: IModelConnector
        Returns the objects currently selected at the adapted model. If there are both domain and view model elements in the adapted model, it is expected that the domain model elements are returned.
        Specified by:
        getSelectedEObjects in interface IModelConnector
        Returns:
        a non-null, but possibly empty collection of model objects
      • getCurrentSelection

        protected org.eclipse.jface.viewers.ISelection getCurrentSelection()
      • getSelectedEObjects

        protected java.util.Collection<org.eclipse.emf.ecore.EObject> getSelectedEObjects​(org.eclipse.jface.viewers.ISelection selection)