Package docking.widgets.table.constraint
Interface ColumnConstraint<T>
-
- Type Parameters:
T- The column type
- All Superinterfaces:
java.lang.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,StringMatcherColumnConstraint,StringNotContainsColumnConstraint,StringNotEndsWithColumnConstraint,StringNotStartsWithColumnConstraint,StringStartsWithColumnConstraint
public interface ColumnConstraint<T> extends java.lang.Comparable<ColumnConstraint<T>>
ColumnConstraints are objects used to filter table rows based on values from a particular column.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanaccepts(T value, TableFilterContext context)Compares value against the current constraint value to determine acceptance; true if value satisfies the constraints' value, false otherwisedefault java.lang.StringasString()Returns a reasonable String version of this constraint useful for debugging.default intcompareTo(ColumnConstraint<T> other)ColumnConstraints are displayed by group and then by namejava.lang.Class<T>getColumnType()Returns the column type that this constraint can be used to filter.java.lang.StringgetConstraintValueString()Returns the "value" of the constraint in string formdefault java.lang.StringgetConstraintValueTooltip()returns a description of the constraint suitable for displaying in a tooltipColumnConstraintEditor<T>getEditor(ColumnData<T> columnDataSource)Returns a ColumnConstraintEditor which will provide gui components for users to edit the constraint values.java.lang.StringgetGroup()Returns a "group" string that is used to logically group column constraints for presentation to the userjava.lang.StringgetName()Returns the name of the constraintColumnConstraint<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 formThis 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:
compareToin interfacejava.lang.Comparable<T>
-
-