# ViewData (ARX GUI Documentation)

org.deidentifier.arx.gui.view.impl.common

## Class ViewData

- java.lang.Object
- - org.deidentifier.arx.gui.view.impl.common.ViewData

- All Implemented Interfaces:
    IView
  Direct Known Subclasses:
    ViewDataInput, ViewDataOutput

      public abstract class ViewData
      extends java.lang.Object
      implements IView

  A view on a `Data` object.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Controller` | `controller` Controller
    `protected Model` | `model` Model
    `protected ComponentDataTable` | `table` Widget

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ViewData(org.eclipse.swt.widgets.Composite parent, Controller controller, java.lang.String helpid, java.lang.String title)` Creates a new data view.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `actionCellSelected(org.eclipse.nebula.widgets.nattable.selection.event.CellSelectionEvent arg1)` Cell selection event.
    `protected void` | `actionColumnSelected(org.eclipse.nebula.widgets.nattable.selection.event.ColumnSelectionEvent arg1)` Column selection event.
    `protected abstract void` | `actionSort()` Called when the sort button is pressed.
    `void` | `addScrollBarListener(org.eclipse.swt.widgets.Listener listener)` Add a scrollbar listener to this view.
    `void` | `addSelectionListener(org.eclipse.swt.events.SelectionListener listener)` Adds a listener to the folder
    `org.eclipse.swt.widgets.Composite` | `createAdditionalItem(java.lang.String title, java.lang.String helpid)` Adds an additional item to the folder
    `void` | `dispose()` Disposes the view.
    `protected void` | `enableSorting()` Enable sorting.
    `protected abstract DataDefinition` | `getDefinition()` Returns the data definition.
    `protected abstract DataHandle` | `getHandle()` Returns the data definition.
    `int` | `getSelectionIndex()` Returns the selection index of the folder
    `org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer` | `getViewportLayer()` Returns the NatTable viewport layer.
    `void` | `reset()` Resets the view.
    `void` | `setSelectedItem(int index)` Sets the selection
    `void` | `setSelectionIndex(int index)` Sets the selection index of the folder
    `void` | `update(ModelEvent event)` Updates the view.
    `protected void` | `updateHeaderImage(int index, AttributeType type)` Updates the header image in the table.

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

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

- - ### Field Detail

    - #### table

          protected final ComponentDataTable table

      Widget

    - #### controller

          protected final Controller controller

      Controller

    - #### model

          protected Model model

      Model

  - ### Constructor Detail

    - #### ViewData

          public ViewData(org.eclipse.swt.widgets.Composite parent,
                  Controller controller,
                  java.lang.String helpid,
                  java.lang.String title)

      Creates a new data view.
      Parameters:
        `parent` -
        `controller` -
        `title` -
        `helpid` -

  - ### Method Detail

    - #### addScrollBarListener

          public void addScrollBarListener(org.eclipse.swt.widgets.Listener listener)

      Add a scrollbar listener to this view.
      Parameters:
        `listener` -

    - #### addSelectionListener

          public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)

      Adds a listener to the folder
      Parameters:
        `listener` -

    - #### createAdditionalItem

          public org.eclipse.swt.widgets.Composite createAdditionalItem(java.lang.String title,
                                                               java.lang.String helpid)

      Adds an additional item to the folder
      Parameters:
        `title` -
        `helpid` -
      Returns:

    - #### dispose

          public void dispose()

      Description copied from interface: `IView`
      Disposes the view.
      Specified by:
        `dispose` in interface `IView`

    - #### getSelectionIndex

          public int getSelectionIndex()

      Returns the selection index of the folder
      Returns:

    - #### getViewportLayer

          public org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer getViewportLayer()

      Returns the NatTable viewport layer.
      Returns:

    - #### reset

          public void reset()

      Description copied from interface: `IView`
      Resets the view.
      Specified by:
        `reset` in interface `IView`

    - #### setSelectedItem

          public void setSelectedItem(int index)

      Sets the selection
      Parameters:
        `index` -

    - #### setSelectionIndex

          public void setSelectionIndex(int index)

      Sets the selection index of the folder
      Parameters:
        `index` -

    - #### update

          public void update(ModelEvent event)

      Description copied from interface: `IView`
      Updates the view.
      Specified by:
        `update` in interface `IView`

    - #### actionCellSelected

          protected void actionCellSelected(org.eclipse.nebula.widgets.nattable.selection.event.CellSelectionEvent arg1)

      Cell selection event.
      Parameters:
        `arg1` -

    - #### actionColumnSelected

          protected void actionColumnSelected(org.eclipse.nebula.widgets.nattable.selection.event.ColumnSelectionEvent arg1)

      Column selection event.
      Parameters:
        `arg1` -

    - #### actionSort

          protected abstract void actionSort()

      Called when the sort button is pressed.

    - #### enableSorting

          protected void enableSorting()

      Enable sorting.

    - #### getDefinition

          protected abstract DataDefinition getDefinition()

      Returns the data definition.
      Returns:

    - #### getHandle

          protected abstract DataHandle getHandle()

      Returns the data definition.
      Returns:

    - #### updateHeaderImage

          protected void updateHeaderImage(int index,
                               AttributeType type)

      Updates the header image in the table.
      Parameters:
        `index` -
        `type` -