org.eclipse.viatra.addon.viewers.runtime.extensions

## Class ViatraViewersViewSupport

- java.lang.Object
- - org.eclipse.viatra.addon.viewers.runtime.extensions.ViatraViewersPartSupport
  - - org.eclipse.viatra.addon.viewers.runtime.extensions.ViatraViewersViewSupport

- Direct Known Subclasses:
    ViatraViewersJFaceViewSupport

      public abstract class ViatraViewersViewSupport
      extends ViatraViewersPartSupport

  Utility class to serve as an extension for `ViewPart`s wishing to use VIATRA Viewers.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected IModelConnectorTypeEnum` | `connectorType` Defines the matching scope for the underlying `ViatraQueryEngine`.
    `protected EMFScope` | `modelSource`
    `protected ViewerState` | `state` The `ViewerState` that represents the stateful model behind the contents shown by the owner.

    - ### Fields inherited from class org.eclipse.viatra.addon.viewers.runtime.extensions.ViatraViewersPartSupport

      `configuration, owner`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ViatraViewersViewSupport(org.eclipse.ui.IViewPart _owner, ViewersComponentConfiguration _config, IModelConnectorTypeEnum _scope)` Constructs a new View support instance.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `bindModel()` Subclasses bind their viewer models here.
    `void` | `createPartControl(org.eclipse.swt.widgets.Composite _parent, org.eclipse.swt.widgets.Control _contents)` Create the SWT UI for the owner.
    `void` | `dispose()` Dispose the support instance.
    `protected EMFScope` | `extractModelSource(java.util.List<java.lang.Object> objects)`
    `protected ViatraQueryEngine` | `getEngine()`
    `protected org.eclipse.ui.IViewPart` | `getOwner()`
    `protected void` | `onSelectionChanged(java.util.List<java.lang.Object> objects)`
    `protected abstract void` | `unbindModel()` Subclasses unbind their viewer models here.

    - ### Methods inherited from class org.eclipse.viatra.addon.viewers.runtime.extensions.ViatraViewersPartSupport

      `init`

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

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

- - ### Field Detail

    - #### connectorType

          protected IModelConnectorTypeEnum connectorType

      Defines the matching scope for the underlying `ViatraQueryEngine`. TODO is `IModelConnectorTypeEnum` the proper choice for this?

    - #### state

          protected ViewerState state

      The `ViewerState` that represents the stateful model behind the contents shown by the owner.

    - #### modelSource

          protected EMFScope modelSource

  - ### Constructor Detail

    - #### ViatraViewersViewSupport

          public ViatraViewersViewSupport(org.eclipse.ui.IViewPart _owner,
                                          ViewersComponentConfiguration _config,
                                          IModelConnectorTypeEnum _scope)

      Constructs a new View support instance.

  - ### Method Detail

    - #### getOwner

          protected org.eclipse.ui.IViewPart getOwner()

    - #### dispose

          public void dispose()

      Description copied from class: `ViatraViewersPartSupport`
      Dispose the support instance. Should be called when the owner `IWorkbenchPart` it starting to dispose itself.
      Overrides:
        `dispose` in class `ViatraViewersPartSupport`

    - #### onSelectionChanged

          protected void onSelectionChanged(java.util.List<java.lang.Object> objects)

      Specified by:
        `onSelectionChanged` in class `ViatraViewersPartSupport`

    - #### extractModelSource

          protected EMFScope extractModelSource(java.util.List<java.lang.Object> objects)
                                         throws ViatraQueryException

      Throws:
        `ViatraQueryException`

    - #### getEngine

          protected ViatraQueryEngine getEngine()

    - #### createPartControl

          public void createPartControl(org.eclipse.swt.widgets.Composite _parent,
                                        org.eclipse.swt.widgets.Control _contents)

      Create the SWT UI for the owner.
      Parameters:
        `_parent` - the SWT part received by the owner in its createPartControl method
        `_contents` - the SWT UI to be displayed for actual contents

    - #### bindModel

          protected abstract void bindModel()

      Subclasses bind their viewer models here.

    - #### unbindModel

          protected abstract void unbindModel()

      Subclasses unbind their viewer models here.