Interface ColumnConstraint<T>

Type Parameters:
T - The column type
All Superinterfaces:
Comparable<ColumnConstraint<T>>
All Known Implementing Classes:
AtLeastColumnConstraint, AtLeastDateColumnConstraint, AtMostColumnConstraint, AtMostDateColumnConstraint, BooleanMatchColumnConstraint, EnumColumnConstraint, InDateRangeColumnConstraint, InRangeColumnConstraint, MappedColumnConstraint, NotInDateRangeColumnConstraint, NotInRangeColumnConstraint, RangeColumnConstraint, SingleValueColumnConstraint, StringColumnConstraint, StringContainsColumnConstraint, StringEndsWithColumnConstraint, StringIsEmptyColumnConstraint, StringIsNotEmptyColumnConstraint, StringMatchesColumnConstraint, StringNotContainsColumnConstraint, StringNotEndsWithColumnConstraint, StringNotMatchesColumnConstraint, StringNotStartsWithColumnConstraint, StringStartsWithColumnConstraint

public interface ColumnConstraint<T> extends Comparable<ColumnConstraint<T>>
ColumnConstraints are objects used to filter table rows based on values from a particular column.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accepts(T value, TableFilterContext context)
    Compares value against the current constraint value to determine acceptance; true if value satisfies the constraints' value, false otherwise
    default String
    Returns a reasonable String version of this constraint useful for debugging.
    default int
    ColumnConstraints are displayed by group and then by name
    Returns the column type that this constraint can be used to filter.
    Returns the "value" of the constraint in string form
    default String
    returns a description of the constraint suitable for displaying in a tooltip
    getEditor(ColumnData<T> columnDataSource)
    Returns a ColumnConstraintEditor which will provide gui components for users to edit the constraint values.
    Returns a "group" string that is used to logically group column constraints for presentation to the user
    Returns the name of the constraint
    parseConstraintValue(String constraintValueString, Object dataSource)
    Parses the constraint value string for deserialization purposes.
  • Method Details

    • accepts

      boolean accepts(T value, TableFilterContext context)
      Compares value against the current constraint value to determine acceptance; true if value satisfies the constraints' value, false otherwise
      Parameters:
      value - the column value to be tested.
      context - provides additional information about the the table and its data. This allows the filter to base its decision on information other than just the column value.
      Returns:
      true if the column value passes the constraint, false otherwise
    • asString

      default String asString()
      Returns a reasonable String version of this constraint useful for debugging.
      Returns:
      the String representation of this constraint
    • getName

      String getName()
      Returns the name of the constraint
      Returns:
      the name of the constraint.
    • getColumnType

      Class<T> getColumnType()
      Returns the column type that this constraint can be used to filter.
      Returns:
      the column type
    • getEditor

      ColumnConstraintEditor<T> getEditor(ColumnData<T> columnDataSource)
      Returns a ColumnConstraintEditor which will provide gui components for users to edit the constraint values.
      Parameters:
      columnDataSource - This provides the constraint with access to the column data in the table model as well as the DataProvider of the table (if it has one)
      Returns:
      A columnConstraintEditor for editing the constraints value.
    • getGroup

      String getGroup()
      Returns a "group" string that is used to logically group column constraints for presentation to the user
      Returns:
      the group this constraint belongs to.
    • getConstraintValueTooltip

      default String getConstraintValueTooltip()
      returns a description of the constraint suitable for displaying in a tooltip
      Returns:
      a description of the constraint.
    • getConstraintValueString

      String getConstraintValueString()
      Returns the "value" of the constraint in string form

      This is used for serializing the constraint.

      Returns:
      the "value" of the constraint in string form.
    • parseConstraintValue

      ColumnConstraint<T> parseConstraintValue(String constraintValueString, Object dataSource)
      Parses the constraint value string for deserialization purposes.
      Parameters:
      constraintValueString - the value of the constraint in string form.
      dataSource - the DataSource from the Table.
      Returns:
      a new ColumnConstraint
    • compareTo

      default int compareTo(ColumnConstraint<T> other)
      ColumnConstraints are displayed by group and then by name
      Specified by:
      compareTo in interface Comparable<T>