Package docking.widgets.table.constraint
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
ColumnConstraints are objects used to filter table rows based on values from a particular column.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(T value, TableFilterContext context) Compares value against the current constraint value to determine acceptance; true if value satisfies the constraints' value, false otherwisedefault 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 nameReturns the column type that this constraint can be used to filter.Returns the "value" of the constraint in string formdefault String
returns a description of the constraint suitable for displaying in a tooltipgetEditor
(ColumnData<T> columnDataSource) Returns a ColumnConstraintEditor which will provide gui components for users to edit the constraint values.getGroup()
Returns a "group" string that is used to logically group column constraints for presentation to the usergetName()
Returns the name of the constraintparseConstraintValue
(String constraintValueString, Object dataSource) Parses the constraint value string for deserialization purposes.
-
Method Details
-
accepts
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
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
Returns the column type that this constraint can be used to filter.- Returns:
- the column type
-
getEditor
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
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 formThis is used for serializing the constraint.
- Returns:
- the "value" of the constraint in string form.
-
parseConstraintValue
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
ColumnConstraints are displayed by group and then by name- Specified by:
compareTo
in interfaceComparable<T>
-