Class ColumnFilterData<T>
- java.lang.Object
-
- docking.widgets.table.constraint.dialog.ColumnFilterData<T>
-
- Type Parameters:
T
- the column type.
- All Implemented Interfaces:
java.lang.Comparable<ColumnFilterData<T>>
public class ColumnFilterData<T> extends java.lang.Object implements java.lang.Comparable<ColumnFilterData<T>>
Class for maintaining information about a table's column for the purpose of configuring filters based on that columns values. These are generated by examining a table's column types and finding out if there are any ColumnConstraints that support that type. If so, a ColumnFilterData is created for that column which then allows filtering on that columns data.
-
-
Constructor Summary
Constructors Constructor Description ColumnFilterData(RowObjectFilterModel<?> model, int columnModelIndex, int columnViewIndex, java.lang.Class<T> columnClass)
Constructs a new ColumnFilterData for a table column
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ColumnFilterData<T> o)
int
getColumnModelIndex()
Returns the model index for the column represented by this class.ColumnConstraint<T>
getConstraint(java.lang.String constraintName)
Returns the ColumnConstraint with the given nameColumnConstraint<?>[]
getConstraints()
Returns the list of applicable constraints for this columnColumnConstraint<T>
getFirstConstraint()
Returns the first constraint in the list.java.lang.String
getName()
Returns the name of the column represented by this ColumnFilterDataint
getViewIndex()
Returns the view index of the columnboolean
isFilterable()
Returns true if the column represented by this data has applicable column filters.void
replace(ColumnConstraint<T> value)
Replace the same named constraint with the given constraint.void
setViewIndex(int viewIndex)
Sets the viewIndexjava.lang.String
toString()
-
-
-
Constructor Detail
-
ColumnFilterData
public ColumnFilterData(RowObjectFilterModel<?> model, int columnModelIndex, int columnViewIndex, java.lang.Class<T> columnClass)
Constructs a new ColumnFilterData for a table column- Parameters:
model
- the table modelcolumnModelIndex
- the model index of the columncolumnViewIndex
- the view index of the columncolumnClass
- the class (type) of the column
-
-
Method Detail
-
setViewIndex
public void setViewIndex(int viewIndex)
Sets the viewIndexThis needs to be updated whenever columns are added, deleted, or moved.
- Parameters:
viewIndex
- the new view index
-
getViewIndex
public int getViewIndex()
Returns the view index of the column- Returns:
- the view index of the column.
-
isFilterable
public boolean isFilterable()
Returns true if the column represented by this data has applicable column filters.- Returns:
- true if the column represented by this data has applicable column filters.
-
getConstraints
public ColumnConstraint<?>[] getConstraints()
Returns the list of applicable constraints for this column- Returns:
- the list of applicable constraints for this column
-
getName
public java.lang.String getName()
Returns the name of the column represented by this ColumnFilterData- Returns:
- the name of the column represented by this ColumnFilterData
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getConstraint
public ColumnConstraint<T> getConstraint(java.lang.String constraintName)
Returns the ColumnConstraint with the given name- Parameters:
constraintName
- the name of the constraint to retrieve- Returns:
- the ColumnConstraint with the given name.
-
getColumnModelIndex
public int getColumnModelIndex()
Returns the model index for the column represented by this class.- Returns:
- the model index for the column represented by this class.
-
getFirstConstraint
public ColumnConstraint<T> getFirstConstraint()
Returns the first constraint in the list.- Returns:
- the constraint
-
compareTo
public int compareTo(ColumnFilterData<T> o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<T>
-
replace
public void replace(ColumnConstraint<T> value)
Replace the same named constraint with the given constraint. This allows the column constraint to remember the last used value.- Parameters:
value
- the constraint to be used to replace the existing one with the same name.
-
-