Class ItemFilter
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.Div
com.vaadin.flow.component.spreadsheet.ItemFilter
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.html.Div>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasOrderedComponents,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasText,SpreadsheetFilter,Serializable
A simple filter for spreadsheet filtering table, filtering cell values with
checkboxes.
Has a check box for selecting all items (cell values), and one check box per unique cell value that can be found within the cells of the table column.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
com.vaadin.flow.component.HasText.WhiteSpace -
Constructor Summary
ConstructorsConstructorDescriptionItemFilter(org.apache.poi.ss.util.CellRangeAddress filterRange, Spreadsheet spreadsheet, PopupButton popupButton, SpreadsheetFilterTable filterTable) Constructs a new item filter for the given spreadsheet, filtering range, pop-up button and filtering table. -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the filtering options.Gets the cell values of this column, excluding those whose rows are already hidden by other columns' filters.Returns the rows that should be filtered by this filter.Gets the cell values of this column that are currently visible, i.e., excluding any hidden by this column's filter or whose rows are already hidden by other columns' filters.protected voidCreates the "Select All" filter component.protected voidCreate all components of the ItemFilter.protected voidCreates the base layout for the filter components.protected voidCreates the filter selection component.protected voidInitializes the pop-up open listener that refreshes the filter options whenever the pop-up is opened.protected voidupdateFilteredItems(Collection<String> visibleValues) Updates the filtered rows to reflect the new filtered values.voidUpdates the filtering options based on the values within the column.Methods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitleMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
addMethods inherited from interface com.vaadin.flow.component.HasComponentsOfType
add, add, addComponentAsFirst, addComponentAtIndex, bindChildren, getChildren, getComponentAt, getComponentCount, indexOf, remove, remove, removeAll, replaceMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasText
bindText, getText, getWhiteSpace, setText, setWhiteSpace
-
Constructor Details
-
ItemFilter
public ItemFilter(org.apache.poi.ss.util.CellRangeAddress filterRange, Spreadsheet spreadsheet, PopupButton popupButton, SpreadsheetFilterTable filterTable) Constructs a new item filter for the given spreadsheet, filtering range, pop-up button and filtering table.- Parameters:
filterRange- Range of cells to filterspreadsheet- Target SpreadsheetpopupButton- Pop-up button to insert the filter components infilterTable- Target SpreadsheetFilterTable
-
-
Method Details
-
initComponents
protected void initComponents()Create all components of the ItemFilter. -
initLayouts
protected void initLayouts()Creates the base layout for the filter components. -
initPopupButtonListeners
protected void initPopupButtonListeners()Initializes the pop-up open listener that refreshes the filter options whenever the pop-up is opened. -
initAllItemsCheckbox
protected void initAllItemsCheckbox()Creates the "Select All" filter component. -
initOptions
protected void initOptions()Creates the filter selection component. -
updateOptions
public void updateOptions()Updates the filtering options based on the values within the column. -
getVisibleValues
Gets the cell values of this column that are currently visible, i.e., excluding any hidden by this column's filter or whose rows are already hidden by other columns' filters.- Returns:
- the cell values
-
getAllValues
Gets the cell values of this column, excluding those whose rows are already hidden by other columns' filters.- Returns:
- the cell values
-
updateFilteredItems
Updates the filtered rows to reflect the new filtered values.- Parameters:
visibleValues- the values that are NOT filtered
-
getFilteredRows
Description copied from interface:SpreadsheetFilterReturns the rows that should be filtered by this filter. In other words the returned set of rows will be hidden from the table.- Specified by:
getFilteredRowsin interfaceSpreadsheetFilter- Returns:
- Row indexes of the filtered rows, 0-based
-
clearFilter
public void clearFilter()Description copied from interface:SpreadsheetFilterClear the filtering options. After this method theSpreadsheetFilter.getFilteredRows()for this filter should return an empty set.- Specified by:
clearFilterin interfaceSpreadsheetFilter
-