org.eclipse.viatra.query.tooling.ui.queryexplorer.adapters

## Class EMFModelConnector

- java.lang.Object
- - org.eclipse.viatra.query.tooling.ui.queryexplorer.adapters.EMFModelConnector

- All Implemented Interfaces:
    IModelConnector
  Direct Known Subclasses:
    VQLEditorModelConnector

      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 and Description
    --- | ---
    `protected org.eclipse.ui.IEditorPart` | `editorPart`
    `protected org.eclipse.core.runtime.ILog` | `logger`
    `protected org.eclipse.ui.IWorkbenchPage` | `workbenchPage`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EMFModelConnector(org.eclipse.ui.IEditorPart editorPart)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addListener(IModelConnectorListener listener)`
    `protected org.eclipse.jface.viewers.TreePath` | `createTreePath(org.eclipse.ui.IEditorPart editorPart, org.eclipse.emf.ecore.EObject obj)`
    `protected org.eclipse.jface.viewers.ISelection` | `getCurrentSelection()`
    `PatternMatcherRootContentKey` | `getKey()` Deprecated.
    `org.eclipse.emf.common.notify.Notifier` | `getNotifier(IModelConnectorTypeEnum modelConnectorTypeEnum)`
    `org.eclipse.ui.IWorkbenchPart` | `getOwner()`
    `java.util.Collection<org.eclipse.emf.ecore.EObject>` | `getSelectedEObjects()` Returns the objects currently selected at the adapted model.
    `protected java.util.Collection<org.eclipse.emf.ecore.EObject>` | `getSelectedEObjects(org.eclipse.jface.viewers.ISelection selection)`
    `void` | `loadModel(IModelConnectorTypeEnum modelConnectorTypeEnum)` Loads the instance model into the model connector with the given type.
    `protected void` | `navigateToElements(org.eclipse.ui.IEditorPart editorPart, org.eclipse.jface.viewers.IStructuredSelection selection)`
    `protected org.eclipse.jface.viewers.TreeSelection` | `prepareSelection(java.lang.Object[] locationObjects)`
    `boolean` | `removeListener(IModelConnectorListener listener)`
    `void` | `showLocation(java.lang.Object[] locationObjects)`
    `void` | `unloadModel()` Unloads the instance model from the model connector.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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.

    - #### unloadModel

          public void unloadModel()

      Description copied from interface: `IModelConnector`
      Unloads the instance model from the model connector.
      Specified by:
        `unloadModel` in interface `IModelConnector`

    - #### 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.

    - #### getKey

          public PatternMatcherRootContentKey getKey()

      Deprecated.
      No Reference:
        This method is only used by the Query Explorer

    - #### 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)

    - #### addListener

          public boolean addListener(IModelConnectorListener listener)

    - #### removeListener

          public boolean removeListener(IModelConnectorListener listener)