Package docking.widgets.table.constraint.dialog

# Class ColumnFilterData<T>

java.lang.Object
docking.widgets.table.constraint.dialog.ColumnFilterData<T>

Type Parameters:
  `T` - the column type.

All Implemented Interfaces:
  `Comparable<ColumnFilterData<T>>`

public class ColumnFilterData<T> extends Object implements Comparable<ColumnFilterData<T>>
This class provides all known `ColumnConstraint`s for a given table column.

Class for maintaining information about a particular table's column for the purpose of configuring filters based on that column's values. Instances of this class are generated by examining a table's column types and finding any `ColumnConstraint`s that support that type. If column constraints are found, a `ColumnFilterData` is created for that column which then allows filtering on that columns data via the column constraints mechanism (which is different than the traditional text filter).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ColumnFilterData(RowObjectFilterModel<?> model, int columnModelIndex, int columnViewIndex, Class<T> columnClass)`
  Constructs a new ColumnFilterData for a table column

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(ColumnFilterData<T> o)`
  `int`
  `getColumnModelIndex()`
  Returns the model index for the column represented by this class.
  `ColumnConstraint<T>`
  `getConstraint(String constraintName)`
  Returns the ColumnConstraint with the given name
  `ColumnConstraint<?>[]`
  `getConstraints()`
  Returns the list of applicable constraints for this column
  `ColumnConstraint<T>`
  `getFirstConstraint()`
  Returns the first constraint in the list.
  `String`
  `getName()`
  Returns the name of the column represented by this ColumnFilterData
  `int`
  `getViewIndex()`
  Returns the view index of the column
  `boolean`
  `isFilterable()`
  Returns true if the column represented by this data has applicable column filters.
  `void`
  `replace(ColumnConstraint<T> value)`
  Replace the same named constraint with the given constraint.
  `void`
  `setViewIndex(int viewIndex)`
  Sets the viewIndex
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### ColumnFilterData

    public ColumnFilterData(RowObjectFilterModel<?> model, int columnModelIndex, int columnViewIndex, Class<T> columnClass)
    Constructs a new ColumnFilterData for a table column
    Parameters:
      `model` - the table model
      `columnModelIndex` - the model index of the column
      `columnViewIndex` - the view index of the column
      `columnClass` - the class (type) of the column

- ## Method Details

  - ### setViewIndex

    public void setViewIndex(int viewIndex)
    Sets the viewIndex

    This needs to be updated whenever columns are added, deleted, or moved.

    Parameters:
      `viewIndex` - the new view index

  - ### getViewIndex

    public int getViewIndex()
    Returns the view index of the column
    Returns:
      the view index of the column.

  - ### isFilterable

    public boolean isFilterable()
    Returns true if the column represented by this data has applicable column filters.
    Returns:
      true if the column represented by this data has applicable column filters.

  - ### getConstraints

    public ColumnConstraint<?>[] getConstraints()
    Returns the list of applicable constraints for this column
    Returns:
      the list of applicable constraints for this column

  - ### getName

    public String getName()
    Returns the name of the column represented by this ColumnFilterData
    Returns:
      the name of the column represented by this ColumnFilterData

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getConstraint

    public ColumnConstraint<T> getConstraint(String constraintName)
    Returns the ColumnConstraint with the given name
    Parameters:
      `constraintName` - the name of the constraint to retrieve
    Returns:
      the ColumnConstraint with the given name.

  - ### getColumnModelIndex

    public int getColumnModelIndex()
    Returns the model index for the column represented by this class.
    Returns:
      the model index for the column represented by this class.

  - ### getFirstConstraint

    public ColumnConstraint<T> getFirstConstraint()
    Returns the first constraint in the list.
    Returns:
      the constraint

  - ### compareTo

    public int compareTo(ColumnFilterData<T> o)
    Specified by:
      `compareTo` in interface `Comparable<T>`

  - ### replace

    public void replace(ColumnConstraint<T> value)
    Replace the same named constraint with the given constraint. This allows the column constraint to remember the last used value.
    Parameters:
      `value` - the constraint to be used to replace the existing one with the same name.