Class GroupDataGridHeaderGrouper
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
io.jmix.groupgridflowui.component.headergrouper.GroupDataGridHeaderGrouper
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
@CssImport("./src/headergrouper/jmix-header-grouper.css")
public class GroupDataGridHeaderGrouper
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
A UI component used for displaying a button for managing grouping columns in the header of
GroupDataGridColumn in GroupDataGrid. The button opens a pop-up with a
ColumnsGrouper component.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextstatic final Stringprotected Grid.Column<?>protected ColumnsGrouper<?>protected com.vaadin.flow.component.icon.SvgIconstatic final Stringprotected GroupDataGrid<?>protected static final Stringstatic final Stringstatic final Stringprotected JmixButtonprotected com.vaadin.flow.component.Componentprotected com.vaadin.flow.component.popover.Popoverprotected com.vaadin.flow.component.Componentprotected Stringprotected com.vaadin.flow.component.Componentprotected UiComponents -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGrid.Column<?>protected intgetGroupDataGridIndex(com.vaadin.flow.component.Component component, GroupDataGrid<?> groupDataGrid) com.vaadin.flow.component.icon.IconDeprecated, for removal: This API element is subject to removal in a future version.com.vaadin.flow.component.Componentcom.vaadin.flow.component.Componentprotected voidprotected com.vaadin.flow.component.orderedlayout.HorizontalLayoutprotected voidprotected voidprotected voidbooleanprotected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) voidRefreshes the header.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetColumn(Grid.Column<?> column) Sets the column associated with this header.voidsetDisplayColumnsGrouperOnIconClick(boolean displayOnIconClick) voidsetGroupDataGrid(GroupDataGrid<?> groupDataGrid) Sets aGroupDataGridthat should be managed by this component.voidsetGroupIcon(com.vaadin.flow.component.icon.Icon icon) Deprecated, for removal: This API element is subject to removal in a future version.UsesetGroupIconComponent(Component)insteadvoidsetGroupIconComponent(com.vaadin.flow.component.Component icon) Sets the icon for the grouper button.voidsetHeader(com.vaadin.flow.component.Component headerComponent) Sets a component to be displayed next to the grouper button.voidSets a text to be displayed next to the grouper button.protected voidsetHeaderInternal(com.vaadin.flow.component.Component headerComponent) protected voidMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, 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.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
ATTRIBUTE_JMIX_ROLE_NAME
- See Also:
-
GROUPER_BUTTON_ROLE
- See Also:
-
GROUPER_POPOVER_CN
- See Also:
-
GROUP_ICON_CN
- See Also:
-
GROUPER_BUTTON_ID_SUFFIX
- See Also:
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
uiComponents
-
groupDataGrid
-
column
-
grouperButton
-
defaultGroupIcon
protected com.vaadin.flow.component.icon.SvgIcon defaultGroupIcon -
groupIcon
protected com.vaadin.flow.component.Component groupIcon -
groupingPopover
protected com.vaadin.flow.component.popover.Popover groupingPopover -
columnsGrouper
-
internalHeaderComponent
protected com.vaadin.flow.component.Component internalHeaderComponent -
headerComponent
protected com.vaadin.flow.component.Component headerComponent -
headerText
-
-
Constructor Details
-
GroupDataGridHeaderGrouper
public GroupDataGridHeaderGrouper()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
initContent
protected com.vaadin.flow.component.orderedlayout.HorizontalLayout initContent()- Overrides:
initContentin classcom.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
-
getGroupDataGrid
- Returns:
- the
GroupDataGridthat is managed by this component
-
setGroupDataGrid
Sets aGroupDataGridthat should be managed by this component.- Parameters:
groupDataGrid- theGroupDataGrid
-
getColumn
- Returns:
- the column associated with this header or
nullif not set
-
setColumn
Sets the column associated with this header.- Parameters:
column- the column
-
setHeader
Sets a text to be displayed next to the grouper button.- Parameters:
labelText- the text to be shown
-
setHeader
public void setHeader(@Nullable com.vaadin.flow.component.Component headerComponent) Sets a component to be displayed next to the grouper button.- Parameters:
headerComponent- the component to be shown
-
getHeaderComponent
@Nullable public com.vaadin.flow.component.Component getHeaderComponent()- Returns:
- the column header component except the grouping button
-
getHeaderText
-
getGroupIcon
@Deprecated(since="2.8", forRemoval=true) @Nullable public com.vaadin.flow.component.icon.Icon getGroupIcon()Deprecated, for removal: This API element is subject to removal in a future version.UsegetGroupIconComponent()instead- Returns:
- the icon for the grouper button or
nullif the default icon is used
-
setGroupIcon
@Deprecated(since="2.8", forRemoval=true) public void setGroupIcon(@Nullable com.vaadin.flow.component.icon.Icon icon) Deprecated, for removal: This API element is subject to removal in a future version.UsesetGroupIconComponent(Component)insteadSets the icon for the grouper button.- Parameters:
icon- the icon to set ornullto use the default icon
-
getGroupIconComponent
@Nullable public com.vaadin.flow.component.Component getGroupIconComponent()- Returns:
- the icon for the grouper button or
nullif the default icon is used
-
setGroupIconComponent
public void setGroupIconComponent(@Nullable com.vaadin.flow.component.Component icon) Sets the icon for the grouper button.- Parameters:
icon- the icon to set ornullto use the default icon
-
isDisplayColumnsGrouperOnIconClick
public boolean isDisplayColumnsGrouperOnIconClick() -
setDisplayColumnsGrouperOnIconClick
public void setDisplayColumnsGrouperOnIconClick(boolean displayOnIconClick) -
refreshHeader
public void refreshHeader()Refreshes the header. -
initDefaultGroupIcon
protected void initDefaultGroupIcon() -
initGrouperButton
protected void initGrouperButton() -
initPopover
protected void initPopover() -
initColumnsGrouper
protected void initColumnsGrouper() -
updateGrouperButtonId
protected void updateGrouperButtonId() -
setHeaderInternal
protected void setHeaderInternal(@Nullable com.vaadin.flow.component.Component headerComponent) -
getGroupDataGridIndex
protected int getGroupDataGridIndex(com.vaadin.flow.component.Component component, GroupDataGrid<?> groupDataGrid) -
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
getGroupIconComponent()instead