public class SpreadsheetFilterTable extends SpreadsheetTable implements com.vaadin.ui.Button.ClickListener
SpreadsheetFilter) inside the table's headers' pop-up buttons.
Does simple filtering by hiding the filtered rows from the table (as in Excel).
Automatically generates "item filters" (ItemFilter) for each column.
Has a "Clear Filters" button inside the PopupButtons pop-up, that
clears all the filters for that column (contained within the same pop-up).
| Modifier and Type | Field and Description |
|---|---|
static String |
CLEAR_FILTERS_BUTTON_CLASSNAME |
protected org.apache.poi.ss.util.CellRangeAddress |
filteringRegion |
protected Map<PopupButton,com.vaadin.ui.Button> |
popupButtonToClearButtonMap |
protected Map<PopupButton,HashSet<SpreadsheetFilter>> |
popupButtonToFiltersMap |
popupButtons| Constructor and Description |
|---|
SpreadsheetFilterTable(Spreadsheet spreadsheet,
org.apache.poi.ss.util.CellRangeAddress fullTableRegion)
Creates a new filter table for the given spreadsheet component, its
active sheet (
Spreadsheet.getActiveSheet() and region. |
SpreadsheetFilterTable(Spreadsheet spreadsheet,
org.apache.poi.ss.usermodel.Sheet sheet,
org.apache.poi.ss.util.CellRangeAddress fullTableRegion)
Creates a new filter table for the given spreadsheet component, sheet and
region.
|
| Modifier and Type | Method and Description |
|---|---|
void |
buttonClick(com.vaadin.ui.Button.ClickEvent event) |
void |
clear()
Clears all the pop-up buttons and their contents (filters).
|
void |
clearAllFilters()
Clears all filters for this table.
|
protected com.vaadin.ui.Button |
createClearButton()
Creates a "Clear filters" button.
|
org.apache.poi.ss.util.CellRangeAddress |
getFilteringRegion()
Gets the filtering region,
CellRangeAddress for this table. |
protected void |
initClearAllButtons()
Creates the "Clear filters" buttons for the pop-ups.
|
protected void |
initFilters()
Creates all filters for this table.
|
protected void |
initItemFilters()
Creates item filters for this table.
|
void |
onFiltersUpdated()
Called when one of the filters (
SpreadsheetFilter) has been
updated, and the sheet (SpreadsheetTable.getSheet()) and component (
SpreadsheetTable.getSpreadsheet()) need to be updated to reflect to the filters'
values. |
void |
registerFilter(PopupButton popupButton,
SpreadsheetFilter filter)
Registers a new filter to this filter table and adds it inside the given
pop-up button.
|
void |
reload()
Reloads all the pop-up buttons and the pop-up contents (filters).
|
void |
unRegisterFilter(PopupButton popupButton,
SpreadsheetFilter filter)
Unregisters the filter from this filter table and removes it from the
given pop-up button.
|
getFullTableRegion, getPopupButton, getPopupButton, getPopupButtons, getSheet, getSpreadsheet, initPopupButtons, isTableSheetCurrentlyActivepublic static final String CLEAR_FILTERS_BUTTON_CLASSNAME
protected final Map<PopupButton,HashSet<SpreadsheetFilter>> popupButtonToFiltersMap
protected final Map<PopupButton,com.vaadin.ui.Button> popupButtonToClearButtonMap
protected org.apache.poi.ss.util.CellRangeAddress filteringRegion
public SpreadsheetFilterTable(Spreadsheet spreadsheet, org.apache.poi.ss.util.CellRangeAddress fullTableRegion)
Spreadsheet.getActiveSheet() and region. Pop-up
buttons and content (filters) are created.spreadsheet - Target SpreadsheetfullTableRegion - Cell range to include in the tablepublic SpreadsheetFilterTable(Spreadsheet spreadsheet, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.util.CellRangeAddress fullTableRegion)
spreadsheet - Target Spreadsheetsheet - Target sheet within the SpreadsheetfullTableRegion - Cell range to include in the tablepublic void reload()
If the pop-up buttons and filters have been cleared (clear() has
been called) they will be recreated with "empty" filters. Otherwise the
existing pop-up buttons are just added to the component again.
reload in class SpreadsheetTablepublic void clear()
If this Table is reloaded after this method has been called, the filters will have cleared their states.
clear in class SpreadsheetTablepublic void clearAllFilters()
protected void initClearAllButtons()
protected void initFilters()
protected void initItemFilters()
protected com.vaadin.ui.Button createClearButton()
public org.apache.poi.ss.util.CellRangeAddress getFilteringRegion()
CellRangeAddress for this table.public void onFiltersUpdated()
SpreadsheetFilter) has been
updated, and the sheet (SpreadsheetTable.getSheet()) and component (
SpreadsheetTable.getSpreadsheet()) need to be updated to reflect to the filters'
values.
NOTE: The default ItemFilters will call this method automatically on change. You only need to call this method when you have implemented and added your own SpreadsheetFilter.
public void registerFilter(PopupButton popupButton, SpreadsheetFilter filter)
NOTE: Does not apply updates, if the registered filter is filtering some
rows, onFiltersUpdated() should be called.
popupButton - The pop-up button this filter is added tofilter - The filter to applypublic void unRegisterFilter(PopupButton popupButton, SpreadsheetFilter filter)
popupButton - The pop-up button this filter is removed fromfilter - The filter to removepublic void buttonClick(com.vaadin.ui.Button.ClickEvent event)
buttonClick in interface com.vaadin.ui.Button.ClickListenerCopyright © 2013–2026 Vaadin Ltd. All rights reserved.