Interface ColumnConstraint<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      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 java.lang.String asString()
      Returns a reasonable String version of this constraint useful for debugging.
      default int compareTo​(ColumnConstraint<T> other)
      ColumnConstraints are displayed by group and then by name
      java.lang.Class<T> getColumnType()
      Returns the column type that this constraint can be used to filter.
      java.lang.String getConstraintValueString()
      Returns the "value" of the constraint in string form
      default java.lang.String getConstraintValueTooltip()
      returns a description of the constraint suitable for displaying in a tooltip
      ColumnConstraintEditor<T> getEditor​(ColumnData<T> columnDataSource)
      Returns a ColumnConstraintEditor which will provide gui components for users to edit the constraint values.
      java.lang.String getGroup()
      Returns a "group" string that is used to logically group column constraints for presentation to the user
      java.lang.String getName()
      Returns the name of the constraint
      ColumnConstraint<T> parseConstraintValue​(java.lang.String constraintValueString, java.lang.Object dataSource)
      Parses the constraint value string for deserialization purposes.
    • Method Detail

      • 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 java.lang.String asString()
        Returns a reasonable String version of this constraint useful for debugging.
        Returns:
        the String representation of this constraint
      • getName

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

        java.lang.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

        java.lang.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 java.lang.String getConstraintValueTooltip()
        returns a description of the constraint suitable for displaying in a tooltip
        Returns:
        a description of the constraint.
      • getConstraintValueString

        java.lang.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​(java.lang.String constraintValueString,
                                                 java.lang.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 java.lang.Comparable<T>