Package docking.widgets.table.constraint
Class EnumColumnConstraint<T extends Enum<T>>
java.lang.Object
docking.widgets.table.constraint.EnumColumnConstraint<T>
- Type Parameters:
T
- the Enum column type.
- All Implemented Interfaces:
ColumnConstraint<T>
,Comparable<ColumnConstraint<T>>
Column Constraint where acceptable column values are Enum values that match one of a set of
selected values from the Enum.
-
Constructor Summary
ConstructorDescriptionEnumColumnConstraint
(Class<T> enumClass, Set<T> acceptableValues) Construct an EnumColumnConstraint with a set of acceptable Enum values. -
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 otherwiseboolean
Returns the column type that this constraint can be used to filter.Returns the "value" of the constraint in string formreturns 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.Return the class of the column's Enum type.getGroup()
Returns a "group" string that is used to logically group column constraints for presentation to the usergetName()
Returns the name of the constraintReturns the set of acceptable (matching) Enum values that are acceptable to this constraint.int
hashCode()
parseConstraintValue
(String newValue, Object dataSource) Parses the constraint value string for deserialization purposes.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface docking.widgets.table.constraint.ColumnConstraint
asString, compareTo
-
Constructor Details
-
EnumColumnConstraint
Construct an EnumColumnConstraint with a set of acceptable Enum values.- Parameters:
enumClass
- the Enum class.acceptableValues
- the set of acceptable Enum values.
-
-
Method Details
-
getGroup
Description copied from interface:ColumnConstraint
Returns a "group" string that is used to logically group column constraints for presentation to the user- Specified by:
getGroup
in interfaceColumnConstraint<T extends Enum<T>>
- Returns:
- the group this constraint belongs to.
-
getName
Description copied from interface:ColumnConstraint
Returns the name of the constraint- Specified by:
getName
in interfaceColumnConstraint<T extends Enum<T>>
- Returns:
- the name of the constraint.
-
accepts
Description copied from interface:ColumnConstraint
Compares value against the current constraint value to determine acceptance; true if value satisfies the constraints' value, false otherwise- Specified by:
accepts
in interfaceColumnConstraint<T extends Enum<T>>
- 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
-
getEditor
Description copied from interface:ColumnConstraint
Returns a ColumnConstraintEditor which will provide gui components for users to edit the constraint values.- Specified by:
getEditor
in interfaceColumnConstraint<T extends Enum<T>>
- 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.
-
getColumnType
Description copied from interface:ColumnConstraint
Returns the column type that this constraint can be used to filter.- Specified by:
getColumnType
in interfaceColumnConstraint<T extends Enum<T>>
- Returns:
- the column type
-
getEnumClass
Return the class of the column's Enum type.- Returns:
- the class of the column's Enum type.
-
getSelectedValues
Returns the set of acceptable (matching) Enum values that are acceptable to this constraint.- Returns:
- the set of acceptable (matching) Enum values that are acceptable to this constraint.
-
getConstraintValueTooltip
Description copied from interface:ColumnConstraint
returns a description of the constraint suitable for displaying in a tooltip- Specified by:
getConstraintValueTooltip
in interfaceColumnConstraint<T extends Enum<T>>
- Returns:
- a description of the constraint.
-
getConstraintValueString
Description copied from interface:ColumnConstraint
Returns the "value" of the constraint in string formThis is used for serializing the constraint.
- Specified by:
getConstraintValueString
in interfaceColumnConstraint<T extends Enum<T>>
- Returns:
- the "value" of the constraint in string form.
-
parseConstraintValue
Description copied from interface:ColumnConstraint
Parses the constraint value string for deserialization purposes.- Specified by:
parseConstraintValue
in interfaceColumnConstraint<T extends Enum<T>>
- Parameters:
newValue
- the value of the constraint in string form.dataSource
- the DataSource from the Table.- Returns:
- a new ColumnConstraint
-
hashCode
public int hashCode() -
equals
-