Class GroupDataGridColumn<E>
- Type Parameters:
E- item type
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,GroupColumn<E>,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.groupgridflowui.component.DataGridColumn
DataGridColumn.DataGeneratorWrapper -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected final Grid<?>protected GroupCellValueFormatter<E>protected booleanprotected GroupDataGridHeaderGrouperprotected UiComponentsFields inherited from class io.jmix.groupgridflowui.component.DataGridColumn
applicationContext, dataGridFilter, groupPartNameGenerator, groupTooltipGenerator, isGroupAllowed, partNameGenerator, storedHeaderComponent, storedHeaderText, tooltipGenerator -
Constructor Summary
ConstructorsConstructorDescriptionGroupDataGridColumn(GroupDataGrid<E> grid, String columnId, com.vaadin.flow.data.renderer.Renderer<E> renderer) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidattachRenderer(com.vaadin.flow.data.renderer.Renderer<E> renderer) protected GroupDataGridHeaderGrouperprotected List<Grid.Column<?>>Gets recursively the child components of this component that are instances of Column.com.vaadin.flow.component.ComponentReturns the footer component of the column.default StringGets the custom part name of the footer cell.Returns the footer text of the column.com.vaadin.flow.component.icon.Iconcom.vaadin.flow.component.ComponentReturns the header component of the column.default StringGets the custom part name of the header cell.Returns the header text of the column.com.vaadin.flow.data.renderer.Renderer<E>Get the renderer used for this column.default ColumnTextAlignGets the column text align.protected booleanbooleanbooleanbooleandefault booleanisFrozen()Gets the this column's frozen state.default booleanGets the this column's frozen state.booleanprotected booleanprotected booleandefault booleanGets whether this column is user-resizable.protected voidmoveFooterContent(io.jmix.groupgridflowui.kit.vaadin.grid.AbstractColumn<?> otherColumn) Moves the current footer content, either a text or a component, to a different column or column group.protected voidmoveHeaderContent(io.jmix.groupgridflowui.kit.vaadin.grid.AbstractColumn<?> otherColumn) Moves the current header content, either a text or a component, to a different column or column group.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) voidRefreshes theGroupDataGridHeaderGrouperin the column.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetAutoHidden(boolean autoHidden) Sets whether the column is automatically hidden when there are no grouping columns.voidsetDisplayColumnsGrouperOnIconClick(boolean displayOnIcon) Sets whether the column displays a button that opens a popup that manages columns grouping.voidsetDisplayItemsCount(boolean displayItemsCount) Sets whether the column displays the number of items in each group.voidsetFilterable(boolean filterable) Sets the filtering for a column.protected voidsetFooterComponent(com.vaadin.flow.component.Component component) default Grid.Column<E>setFooterPartName(String footerPartName) Sets a custom part name for the footer cell.protected voidsetFooterText(String text) default Grid.Column<E>setFrozen(boolean frozen) Sets this column's frozen state.default Grid.Column<E>setFrozenToEnd(boolean frozenToEnd) Sets this column's frozen state.voidsetGroupCellValueFormatter(GroupCellValueFormatter<E> groupCellValueFormatter) Sets a formatter for group cell values.voidsetGroupIcon(com.vaadin.flow.component.icon.Icon icon) Sets the icon for the Columns Grouper button.voidsetGroupIconVisible(boolean visible) Sets whether the icon for the Columns Grouper button is visible.setHeader(com.vaadin.flow.component.Component headerComponent) Sets a header component to the column.Sets a header text to the column.protected voidsetHeaderComponent(com.vaadin.flow.component.Component component) default Grid.Column<E>setHeaderPartName(String headerPartName) Sets a custom part name for the header cell.protected voidsetHeaderText(String text) setRenderer(com.vaadin.flow.data.renderer.Renderer<E> renderer) Set the renderer for this column.default Grid.Column<E>setResizable(boolean resizable) When set totrue, the column is user-resizable.protected voidsetSortingIndicators(boolean sortingIndicators) Sets this component to show sorting indicators or not.default Grid.Column<E>setTextAlign(ColumnTextAlign textAlign) Sets the column text align.protected voidprotected voidupdateSortingIndicators(boolean sortable) Updates this component to either have sorting indicators according to the sortable state of the underlying column, or removes the sorting indicators.Methods inherited from class io.jmix.groupgridflowui.component.DataGridColumn
_getComparator, _getEditorComponentCallback, _getSortOrderProvider, addColumnVisibilityChangedListener, addDataGenerator, getGrid, getGroupPartNameGenerator, getGroupTooltipGenerator, getInternalId, getPartNameGenerator, getStoredHeaderComponent, getStoredHeaderText, getTooltipGenerator, groupDataGrid, isFilterable, isGroupAllowed, onPartNameGenerator, onTooltipGenerator, setClassNameGenerator, setGroupAllowed, setGroupPartNameGenerator, setGroupTooltipGenerator, setPartNameGenerator, setTooltipGenerator, setVisibleMethods inherited from class io.jmix.groupgridflowui.kit.vaadin.grid.Grid.Column
destroyDataGenerators, getBottomLevelColumn, getClassNameGenerator, getComparator, getEditorComponent, getElement, getFlexGrow, getKey, getSortOrder, getWidth, isAutoWidth, isRowHeader, isSortable, setAutoWidth, setComparator, setComparator, setEditorComponent, setEditorComponent, setFlexGrow, setFooter, setFooter, setKey, setRowHeader, setSortable, setSortOrderProvider, setSortProperty, setWidthMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setIdMethods 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.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
uiComponents
-
groupCellValueFormatter
-
headerGrouper
-
autoHidden
protected boolean autoHidden -
displayItemsCount
protected boolean displayItemsCount -
groupIconVisible
protected boolean groupIconVisible -
grid
-
-
Constructor Details
-
GroupDataGridColumn
public GroupDataGridColumn(GroupDataGrid<E> grid, String columnId, com.vaadin.flow.data.renderer.Renderer<E> renderer)
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Overrides:
setApplicationContextin classDataGridColumn<E>- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
isAutoHidden
public boolean isAutoHidden()- Specified by:
isAutoHiddenin interfaceGroupColumn<E>- Returns:
trueif the column is automatically hidden when there are no grouping columns
-
setAutoHidden
public void setAutoHidden(boolean autoHidden) Description copied from interface:GroupColumnSets whether the column is automatically hidden when there are no grouping columns.The default value is
false.- Specified by:
setAutoHiddenin interfaceGroupColumn<E>- Parameters:
autoHidden- autoHidden option
-
isDisplayItemsCount
public boolean isDisplayItemsCount()- Specified by:
isDisplayItemsCountin interfaceGroupColumn<E>- Returns:
trueif the column displays the number of items in each group
-
setDisplayItemsCount
public void setDisplayItemsCount(boolean displayItemsCount) Description copied from interface:GroupColumnSets whether the column displays the number of items in each group.The default value is
true.- Specified by:
setDisplayItemsCountin interfaceGroupColumn<E>- Parameters:
displayItemsCount- displayItemsCount option
-
isDisplayColumnsGrouperOnIconClick
public boolean isDisplayColumnsGrouperOnIconClick()- Specified by:
isDisplayColumnsGrouperOnIconClickin interfaceGroupColumn<E>- Returns:
trueif the column displays a button that opens a popup that manages columns grouping
-
setDisplayColumnsGrouperOnIconClick
public void setDisplayColumnsGrouperOnIconClick(boolean displayOnIcon) Description copied from interface:GroupColumnSets whether the column displays a button that opens a popup that manages columns grouping.The default value is
true.- Specified by:
setDisplayColumnsGrouperOnIconClickin interfaceGroupColumn<E>- Parameters:
displayOnIcon- displayColumnsGrouper option
-
getGroupIcon
@Nullable public com.vaadin.flow.component.icon.Icon getGroupIcon()- Specified by:
getGroupIconin interfaceGroupColumn<E>- Returns:
- the icon for the Columns Grouper button or
nullif the default icon is used
-
setGroupIcon
public void setGroupIcon(@Nullable com.vaadin.flow.component.icon.Icon icon) Description copied from interface:GroupColumnSets the icon for the Columns Grouper button.- Specified by:
setGroupIconin interfaceGroupColumn<E>- Parameters:
icon- the icon to set, ornullto set the default icon
-
isGroupIconVisible
public boolean isGroupIconVisible()- Specified by:
isGroupIconVisiblein interfaceGroupColumn<E>- Returns:
trueif the icon for the Columns Grouper button is visible
-
setGroupIconVisible
public void setGroupIconVisible(boolean visible) Description copied from interface:GroupColumnSets whether the icon for the Columns Grouper button is visible.The default value is
true.- Specified by:
setGroupIconVisiblein interfaceGroupColumn<E>- Parameters:
visible- visible option
-
setHeader
Description copied from class:Grid.ColumnSets a header text to the column.If there are no header rows when calling this method, the first header row will be created. If there are header rows, the header will be set on the first created header row and it will override any existing header.
- Overrides:
setHeaderin classDataGridColumn<E>- Parameters:
labelText- the text to be shown at the column header- Returns:
- this column, for method chaining
-
setHeader
Description copied from class:Grid.ColumnSets a header component to the column.If there are no header rows when calling this method, the first header row will be created. If there are header rows, the header will be set on the first created header row and it will override any existing header.
- Overrides:
setHeaderin classDataGridColumn<E>- Parameters:
headerComponent- the component to be used in the header of the column- Returns:
- this column, for method chaining
-
setFilterable
public void setFilterable(boolean filterable) Description copied from class:DataGridColumnSets the filtering for a column. If the filtering is enabled, a filter button will be added to the column header. The filtering is disabled by default.- Overrides:
setFilterablein classDataGridColumn<E>- Parameters:
filterable- whether to add a filter to the header
-
getGroupCellValueFormatter
- Specified by:
getGroupCellValueFormatterin interfaceGroupColumn<E>- Returns:
- a formatter for group cell values or
nullif no formatter is set.
-
setGroupCellValueFormatter
public void setGroupCellValueFormatter(@Nullable GroupCellValueFormatter<E> groupCellValueFormatter) Description copied from interface:GroupColumnSets a formatter for group cell values.- Specified by:
setGroupCellValueFormatterin interfaceGroupColumn<E>- Parameters:
groupCellValueFormatter- a formatter to set, ornullto remove the formatter
-
refreshHeader
public void refreshHeader()Refreshes theGroupDataGridHeaderGrouperin the column. -
getRenderer
Description copied from class:Grid.ColumnGet the renderer used for this column.Note: Mutating the renderer after the Grid has been rendered on the client will not change the column, and can lead to undefined behavior.
- Overrides:
getRendererin classGrid.Column<E>- Returns:
- the renderer used for this column, should never be
null
-
setRenderer
Description copied from class:Grid.ColumnSet the renderer for this column.- Overrides:
setRendererin classGrid.Column<E>- Parameters:
renderer- the new renderer to be used for this column, must not benull
-
isHeaderGrouperAdded
protected boolean isHeaderGrouperAdded() -
isHeaderRowAppended
protected boolean isHeaderRowAppended() -
updateHeaderGrouper
protected void updateHeaderGrouper() -
createHeaderGrouper
-
attachRenderer
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
getHeaderText
Returns the header text of the column.- Returns:
- the header text
-
setHeaderText
-
getHeaderComponent
public com.vaadin.flow.component.Component getHeaderComponent()Returns the header component of the column.- Returns:
- the header component
-
setHeaderComponent
protected void setHeaderComponent(com.vaadin.flow.component.Component component) -
moveHeaderContent
protected void moveHeaderContent(io.jmix.groupgridflowui.kit.vaadin.grid.AbstractColumn<?> otherColumn) Moves the current header content, either a text or a component, to a different column or column group. Also clears the content of this column.- Parameters:
otherColumn- the column or group to move the content to
-
updateSortingIndicators
protected void updateSortingIndicators(boolean sortable) Updates this component to either have sorting indicators according to the sortable state of the underlying column, or removes the sorting indicators.- Parameters:
sortable-trueto have sorting indicators if the column is sortable,falseto not have sorting indicators
-
setSortingIndicators
protected void setSortingIndicators(boolean sortingIndicators) Sets this component to show sorting indicators or not.- Parameters:
sortingIndicators-trueto show sorting indicators,falseto remove them
-
hasSortingIndicators
protected boolean hasSortingIndicators() -
getBottomChildColumns
Gets recursively the child components of this component that are instances of Column.- Returns:
- the Column children of this component
-
setResizable
When set totrue, the column is user-resizable. By default this is set tofalse.- Parameters:
resizable- whether to allow user resizing of this column- Returns:
- this column, for method chaining
-
isResizable
@Synchronize("resizable-changed") default boolean isResizable()Gets whether this column is user-resizable.- Returns:
- whether this column is user-resizable
-
setFrozen
Sets this column's frozen state.Note: Columns are frozen in-place, freeze columns from left to right for a consistent outcome.
- Parameters:
frozen- whether to freeze or unfreeze this column- Returns:
- this column, for method chaining
-
isFrozen
@Synchronize("frozen-changed") default boolean isFrozen()Gets the this column's frozen state.- Returns:
- whether this column is frozen
-
setFrozenToEnd
Sets this column's frozen state.Note: Columns are frozen in-place, freeze columns from right to left for a consistent outcome.
- Parameters:
frozenToEnd- whether to freeze or unfreeze this column- Returns:
- this column, for method chaining
- Since:
- 23.1
-
isFrozenToEnd
@Synchronize("frozen-to-end-changed") default boolean isFrozenToEnd()Gets the this column's frozen state.- Returns:
- whether this column is frozen to end
- Since:
- 23.1
-
setTextAlign
Sets the column text align.- Parameters:
textAlign- the text alignment of the column. Setting it tonullresets the alignment to the default valueColumnTextAlign.START.- Returns:
- this column, for method chaining
-
getTextAlign
Gets the column text align. The default isColumnTextAlign.START.- Returns:
- the column text align, not
null
-
setHeaderPartName
Sets a custom part name for the header cell.- Parameters:
headerPartName- the part name to set- Returns:
- this column, for method chaining
-
getHeaderPartName
Gets the custom part name of the header cell.- Returns:
- the part name
-