public final class FilterColumn extends Object
Modifier and Type | Method and Description |
---|---|
SortLevel |
addSort()
Adds a
SortLevel to this column. |
void |
clearFilter()
Clears the filter from this
FilterColumn . |
void |
clearSort()
Clears the sort level from this
FilterColumn . |
Filter |
getFilter()
Gets the filter settings applied to this column or
null if no filter settings are applied to this column. |
int |
getIndex()
Gets the column index relative to the
range that this column filter applies to. |
Predicate<ExcelCell> |
getMatch()
Gets the method that defines a set of criteria and determines whether the specified
ExcelCell meets those criteria. |
SortLevel |
getSort()
Gets the sort settings applied to this column or
null if no sort settings are applied to this column. |
boolean |
isHiddenAutoButton()
Gets a value indicating whether the
AutoFilter button for this column is hidden. |
boolean |
isShowButton()
Gets a value indicating whether the filter button is visible.
|
CustomFilter |
setCustomFilter()
Sets a
CustomFilter to this column. |
DynamicFilter |
setDynamicFilter()
Sets a
DynamicFilter to this column. |
void |
setHiddenAutoButton(boolean hiddenAutoButton)
Sets a value indicating whether the
AutoFilter button for this column is hidden. |
void |
setMatch(Predicate<ExcelCell> match)
Sets the method that defines a set of criteria and determines whether the specified
ExcelCell meets those criteria. |
void |
setShowButton(boolean showButton)
Sets a value indicating whether the filter button is visible.
|
SortLevel |
setSort()
Sets a
SortLevel to this column. |
Top10Filter |
setTop10Filter()
Sets a
Top10Filter to this column. |
ValuesFilter |
setValuesFilter()
Sets a
ValuesFilter to this column. |
String |
toString()
Returns a
String that represents this FilterColumn instance. |
public SortLevel addSort()
Adds a SortLevel
to this column.
Previous sort levels are maintained. If this FilterColumn
already specifies a sort level (getSort()
is not equal to null
) it will be removed before a new one is added.
Use members of a returned SortLevel
to specify sort settings.
SortLevel
.public void clearFilter()
FilterColumn
.public void clearSort()
FilterColumn
.public Filter getFilter()
null
if no filter settings are applied to this column.null
if no filter settings are applied to this column.public int getIndex()
Gets the column index relative to the range
that this column filter applies to.
Value is equal to or greater than zero and less than width
of the range
.
range
that this filter column applies to.public Predicate<ExcelCell> getMatch()
Gets the method that defines a set of criteria and determines whether the specified ExcelCell
meets those criteria.
Default value is default method based on the settings of this filter.
This member is not loaded from and saved to XLSX file since it is not supported by Office Open XML specification. It is used to customize GemBox.Spreadsheet functionality.
ExcelCell
meets those criteria.public SortLevel getSort()
null
if no sort settings are applied to this column.null
if no sort settings are applied to this column.public boolean isHiddenAutoButton()
Gets a value indicating whether the AutoFilter
button for this column is hidden.
Default value is false
.
true
if the AutoFilter
button for this column is hidden; otherwise, false
.public boolean isShowButton()
Gets a value indicating whether the filter button is visible.
For example, when the cell containing the filter button is merged with another cell, the filter button may be hidden, and not drawn.
Default value is true
.
true
if the filter button is visible; otherwise, false
.public CustomFilter setCustomFilter()
Sets a CustomFilter
to this column.
CustomFilter
filters by a one or two conditions (operators and values).
Use members of a returned CustomFilter
to specify filter settings.
If this FilterColumn
already specifies a filter (getFilter()
is not equal to null
), it will be overridden.
CustomFilter
.public DynamicFilter setDynamicFilter()
Sets a DynamicFilter
to this column.
DynamicFilter
filters by a dynamic criteria that can change, either with the data itself (e.g., "above average") or with the current system date (e.g., show values for "today").
Use members of a returned DynamicFilter
to specify filter settings.
If this FilterColumn
already specifies a filter (getFilter()
is not equal to null
), it will be overridden.
DynamicFilter
.public void setHiddenAutoButton(boolean hiddenAutoButton)
Sets a value indicating whether the AutoFilter
button for this column is hidden.
Default value is false
.
hiddenAutoButton
- true
if the AutoFilter
button for this column is hidden; otherwise, false
.public void setMatch(Predicate<ExcelCell> match)
Sets the method that defines a set of criteria and determines whether the specified ExcelCell
meets those criteria.
Default value is default method based on the settings of this filter.
Use this method to override default method that is based on the settings of this filter.
This member is not loaded from and saved to XLSX file since it is not supported by Office Open XML specification. It is used to customize GemBox.Spreadsheet functionality.
If set to null
, reverts to default method based on the settings of this filter.
match
- The method that defines a set of criteria and determines whether the specified ExcelCell
meets those criteria.public void setShowButton(boolean showButton)
Sets a value indicating whether the filter button is visible.
For example, when the cell containing the filter button is merged with another cell, the filter button may be hidden, and not drawn.
Default value is true
.
showButton
- true
if the filter button is visible; otherwise, false
.public SortLevel setSort()
Sets a SortLevel
to this column.
All other sort levels are cleared.
Use members of a returned SortLevel
to specify sort settings.
SortLevel
.public Top10Filter setTop10Filter()
Sets a Top10Filter
to this column.
Top10Filter
filters by a top N (percent or number of items).
Use members of a returned Top10Filter
to specify filter settings.
If this FilterColumn
already specifies a filter (getFilter()
is not equal to null
), it will be overridden.
Top10Filter
.public ValuesFilter setValuesFilter()
Sets a ValuesFilter
to this column.
ValuesFilter
filters by a list of values.
Use members of a returned ValuesFilter
to specify filter settings.
If this FilterColumn
already specifies a filter (filter
is not equal to null
), it will be overridden.
ValuesFilter
.public String toString()
String
that represents this FilterColumn
instance.
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
toString
in class Object
String
that represents this FilterColumn
instance.© GemBox Ltd. — All rights reserved.