# DataTableDecorator (ARX GUI Documentation)

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

## Class DataTableDecorator

- java.lang.Object
- - org.eclipse.nebula.widgets.nattable.painter.cell.AbstractCellPainter
  - - org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
    - - org.deidentifier.arx.gui.view.impl.common.datatable.DataTableDecorator

- All Implemented Interfaces:
    org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter

      public class DataTableDecorator
      extends org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper

  A table decorator. Based on code from Dirk Fauth.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `BOTTOM_LINE_BORDER_LABEL` Label for adding a border at the bottom of a cell.
    `static java.lang.String` | `LEFT_LINE_BORDER_LABEL` Label for adding a border at the left of a cell.
    `static java.lang.String` | `RIGHT_LINE_BORDER_LABEL` Label for adding a border at the right of a cell.
    `static java.lang.String` | `TOP_LINE_BORDER_LABEL` Label for adding a border at the top of a cell.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataTableDecorator(org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter interiorPainter)` Creates a new LabelLineBorderDecorator wrapping the given interior painter and no default border style.
    `DataTableDecorator(org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter interiorPainter, org.eclipse.nebula.widgets.nattable.style.BorderStyle defaultBorderStyle)` Creates a new LabelLineBorderDecorator wrapping the given interior painter using the given BorderStyle as default.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getPreferredHeight(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)`
    `int` | `getPreferredWidth(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)`
    `void` | `paintCell(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)`

    - ### Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper

      `getCellPainterAt, getWrappedPainter, getWrappedPainterBounds, setWrappedPainter`

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

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

- - ### Field Detail

    - #### TOP_LINE_BORDER_LABEL

          public static final java.lang.String TOP_LINE_BORDER_LABEL

      Label for adding a border at the top of a cell.
      See Also:
        Constant Field Values

    - #### BOTTOM_LINE_BORDER_LABEL

          public static final java.lang.String BOTTOM_LINE_BORDER_LABEL

      Label for adding a border at the bottom of a cell.
      See Also:
        Constant Field Values

    - #### LEFT_LINE_BORDER_LABEL

          public static final java.lang.String LEFT_LINE_BORDER_LABEL

      Label for adding a border at the left of a cell.
      See Also:
        Constant Field Values

    - #### RIGHT_LINE_BORDER_LABEL

          public static final java.lang.String RIGHT_LINE_BORDER_LABEL

      Label for adding a border at the right of a cell.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DataTableDecorator

          public DataTableDecorator(org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter interiorPainter)

      Creates a new LabelLineBorderDecorator wrapping the given interior painter and no default border style.
      Parameters:
        `interiorPainter` - The painter to be wrapped by this decorator.

    - #### DataTableDecorator

          public DataTableDecorator(org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter interiorPainter,
                            org.eclipse.nebula.widgets.nattable.style.BorderStyle defaultBorderStyle)

      Creates a new LabelLineBorderDecorator wrapping the given interior painter using the given BorderStyle as default.
      Parameters:
        `interiorPainter` - The painter to be wrapped by this decorator.
        `defaultBorderStyle` - The BorderStyle to use as default if there is no BorderStyle configured via cell styles. Can be `null`.

  - ### Method Detail

    - #### getPreferredHeight

          public int getPreferredHeight(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell,
                               org.eclipse.swt.graphics.GC gc,
                               org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)

      Specified by:
        `getPreferredHeight` in interface `org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter`
      Overrides:
        `getPreferredHeight` in class `org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper`

    - #### getPreferredWidth

          public int getPreferredWidth(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell,
                              org.eclipse.swt.graphics.GC gc,
                              org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)

      Specified by:
        `getPreferredWidth` in interface `org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter`
      Overrides:
        `getPreferredWidth` in class `org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper`

    - #### paintCell

          public void paintCell(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell,
                       org.eclipse.swt.graphics.GC gc,
                       org.eclipse.swt.graphics.Rectangle rectangle,
                       org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)

      Specified by:
        `paintCell` in interface `org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter`
      Overrides:
        `paintCell` in class `org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper`