E
- row item typepublic interface TreeDataGrid<E extends Entity> extends DataGrid<E>
Modifier and Type | Interface and Description |
---|---|
static class |
TreeDataGrid.CollapseEvent<E extends Entity>
An event that is fired when an item is collapsed.
|
static class |
TreeDataGrid.ExpandEvent<E extends Entity>
An event that is fired when an item is expanded.
|
DataGrid.AbstractDataGridEditorEvent<E extends Entity>, DataGrid.AbstractDataGridEvent, DataGrid.ButtonRenderer<T extends Entity>, DataGrid.CellDescriptionProvider<E extends Entity>, DataGrid.CellStyleProvider<E extends Entity>, DataGrid.CheckBoxRenderer, DataGrid.ClickableTextRenderer<T extends Entity>, DataGrid.Column<E extends Entity>, DataGrid.ColumnCollapsingChangeEvent, DataGrid.ColumnEditorFieldGenerator, DataGrid.ColumnGenerator<E extends Entity,T>, DataGrid.ColumnGeneratorEvent<E extends Entity>, DataGrid.ColumnReorderEvent, DataGrid.ColumnResizeEvent, DataGrid.ColumnResizeMode, DataGrid.ComponentRenderer, DataGrid.ContextClickEvent, DataGrid.Converter<P,M>, DataGrid.DataGridClickEvent, DataGrid.DataGridStaticCellType, DataGrid.DateRenderer, DataGrid.DetailsGenerator<E extends Entity>, DataGrid.EditorCloseEvent<E extends Entity>, DataGrid.EditorFieldGenerationContext<T>, DataGrid.EditorOpenEvent<E extends Entity>, DataGrid.EditorPostCommitEvent<E extends Entity>, DataGrid.EditorPreCommitEvent<E extends Entity>, DataGrid.FooterCell, DataGrid.FooterRow, DataGrid.HasDateTimeFormatter, DataGrid.HasLocale, DataGrid.HasNullRepresentation, DataGrid.HasRendererClickListener<T extends Entity>, DataGrid.HeaderCell, DataGrid.HeaderRow, DataGrid.HtmlRenderer, DataGrid.IconRenderer<T extends Entity>, DataGrid.ImageRenderer<T extends Entity>, DataGrid.ItemClickEvent<E>, DataGrid.LocalDateRenderer, DataGrid.LocalDateTimeRenderer, DataGrid.NumberRenderer, DataGrid.ProgressBarRenderer, DataGrid.Renderer, DataGrid.RendererClickEvent<T extends Entity>, DataGrid.RowDescriptionProvider<E extends Entity>, DataGrid.RowStyleProvider<E extends Entity>, DataGrid.ScrollDestination, DataGrid.SelectionEvent<E extends Entity>, DataGrid.SelectionMode, DataGrid.SortDirection, DataGrid.SortEvent, DataGrid.SortOrder, DataGrid.StaticCell, DataGrid.StaticRow<T extends DataGrid.StaticCell>, DataGrid.TextRenderer
ListComponent.IconProvider<E extends Entity>
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.OptionsStyleProvider, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
LookupComponent.LookupSelectionChangeEvent<T extends Entity>, LookupComponent.LookupSelectionChangeNotifier<T extends Entity>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE, UNITS_PERCENTAGE, UNITS_PIXELS
Modifier and Type | Method and Description |
---|---|
Subscription |
addCollapseListener(java.util.function.Consumer<TreeDataGrid.CollapseEvent<E>> listener)
Registers a new collapse listener.
|
Subscription |
addExpandListener(java.util.function.Consumer<TreeDataGrid.ExpandEvent<E>> listener)
Registers a new expand listener.
|
void |
collapse(java.util.Collection<E> items)
Collapse the given items.
|
default void |
collapse(E... items)
Collapse the given items.
|
void |
collapseAll()
Collapses all items.
|
default void |
collapseRecursively(java.util.Collection<E> items,
int depth)
Collapse the given items and their children recursively until the given depth.
|
void |
collapseRecursively(java.util.stream.Stream<E> items,
int depth)
Collapse the given items and their children recursively until the given depth.
|
void |
expand(java.util.Collection<E> items)
Expands the given items.
|
default void |
expand(E... items)
Expands the given items.
|
void |
expandAll()
Expands all items.
|
default void |
expandRecursively(java.util.Collection<E> items,
int depth)
Expands the given items and their children recursively until the given depth.
|
void |
expandRecursively(java.util.stream.Stream<E> items,
int depth)
Expands the given items and their children recursively until the given depth.
|
default HierarchicalDatasource |
getDatasource() |
DataGrid.Column<E> |
getHierarchyColumn()
Get the currently set hierarchy column.
|
java.util.function.Predicate<E> |
getItemCollapseAllowedProvider() |
TreeDataGridItems<E> |
getItems() |
int |
getLevel(E item)
Returns the hierarchy level of an item.
|
boolean |
isExpanded(E item)
Returns whether a given item is expanded or collapsed.
|
static <T extends Entity> |
of(java.lang.Class<T> itemClass) |
default void |
setDatasource(CollectionDatasource datasource)
Sets an instance of
CollectionDatasource as the DataGrid data source. |
default void |
setDatasource(HierarchicalDatasource datasource)
Deprecated.
|
void |
setHierarchyColumn(DataGrid.Column<E> column)
Set the column that displays the hierarchy of this DataGrid's data.
|
void |
setHierarchyColumn(java.lang.String id)
Set the column that displays the hierarchy of this DataGrid's data.
|
void |
setItemCollapseAllowedProvider(java.util.function.Predicate<E> provider)
Sets the item collapse allowed provider for this TreeDataGrid.
|
addCellStyleProvider, addColumn, addColumn, addColumn, addColumn, addColumnCollapsingChangeListener, addColumnReorderListener, addColumnResizeListener, addContextClickListener, addEditorCloseListener, addEditorOpenListener, addEditorPostCommitListener, addEditorPreCommitListener, addFooterRowAt, addGeneratedColumn, addGeneratedColumn, addHeaderRowAt, addItemClickListener, addRowStyleProvider, addSelectionListener, addSortListener, appendFooterRow, appendHeaderRow, createRenderer, deselect, deselectAll, edit, editItem, getBodyRowHeight, getCellDescriptionProvider, getColumn, getColumnGenerator, getColumnNN, getColumnResizeMode, getColumns, getDefaultHeaderRow, getDetailsGenerator, getEditedItem, getEditedItemId, getEditorCancelCaption, getEditorSaveCaption, getEnterPressAction, getFooterRow, getFooterRowCount, getFooterRowHeight, getFrozenColumnCount, getHeaderRow, getHeaderRowCount, getHeaderRowHeight, getItemClickAction, getRowDescriptionProvider, getSelectionMode, getSortOrder, getSubPart, getVisibleColumns, isColumnReorderingAllowed, isColumnsCollapsingAllowed, isContextMenuEnabled, isDetailsVisible, isEditorActive, isEditorBuffered, isEditorCrossFieldValidate, isEditorEnabled, isFooterVisible, isHeaderVisible, isSortable, isTextSelectionEnabled, prependFooterRow, prependHeaderRow, removeCellStyleProvider, removeColumn, removeColumn, removeColumnCollapsingChangeListener, removeColumnReorderListener, removeColumnResizeListener, removeContextClickListener, removeEditorCloseListener, removeEditorOpenListener, removeEditorPostCommitListener, removeEditorPreCommitListener, removeFooterRow, removeFooterRow, removeHeaderRow, removeHeaderRow, removeItemClickListener, removeRowStyleProvider, removeSelectionListener, removeSortListener, repaint, scrollTo, scrollTo, scrollToEnd, scrollToStart, selectAll, setBodyRowHeight, setCellDescriptionProvider, setColumnReorderingAllowed, setColumnResizeMode, setColumnsCollapsingAllowed, setContextMenuEnabled, setDefaultHeaderRow, setDetailsGenerator, setDetailsVisible, setEditorBuffered, setEditorCancelCaption, setEditorCrossFieldValidate, setEditorEnabled, setEditorSaveCaption, setEnterPressAction, setFooterRowHeight, setFooterVisible, setFrozenColumnCount, setHeaderRowHeight, setHeaderVisible, setItemClickAction, setItems, setRowDescriptionProvider, setRowDescriptionProvider, setSelectionMode, setSortable, setTextSelectionEnabled, sort
getSelected, getSingleSelected, isMultiSelect, setSelected, setSelected
getFrame, setFrame
addAction, addAction, getAction, getActionNN, getActions, removeAction, removeAction, removeAllActions
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getHeightUnits, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, getWidthUnits, isEnabled, isEnabledItself, isEnabledRecursive, isResponsive, isVisible, isVisibleItself, isVisibleRecursive, removeStyleName, requestFocus, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition
getButtonsPanel, setButtonsPanel
getIcon, setIcon, setIconFromSet
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
getRowsCount, setRowsCount, setRowsCountTotalCountDelegate
applySettings, isSettingsEnabled, saveSettings, setSettingsEnabled
applyDataLoadingSettings
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
getLookupSelectedItems, setLookupSelectHandler
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
static final java.lang.String NAME
static <T extends Entity> com.google.common.reflect.TypeToken<TreeDataGrid<T>> of(java.lang.Class<T> itemClass)
default HierarchicalDatasource getDatasource()
getDatasource
in interface DataGrid<E extends Entity>
getDatasource
in interface ListComponent<E extends Entity>
@Deprecated default void setDatasource(HierarchicalDatasource datasource)
default void setDatasource(CollectionDatasource datasource)
DataGrid
CollectionDatasource
as the DataGrid data source.setDatasource
in interface DataGrid<E extends Entity>
datasource
- the DataGrid data source, not nullint getLevel(E item)
item
- the item to get level@Nullable TreeDataGridItems<E> getItems()
@Nullable DataGrid.Column<E> getHierarchyColumn()
null
if no column has been explicitly setvoid setHierarchyColumn(java.lang.String id)
Setting a hierarchy column by calling this method also sets the column to be visible and not hidable.
Note: Changing the Renderer of the hierarchy column is not supported.
id
- the column id to use for displaying hierarchyvoid setHierarchyColumn(DataGrid.Column<E> column)
Setting a hierarchy column by calling this method also sets the column to be visible and not hidable.
Note: Changing the Renderer of the hierarchy column is not supported.
column
- the column to use for displaying hierarchyjava.util.function.Predicate<E> getItemCollapseAllowedProvider()
void setItemCollapseAllowedProvider(java.util.function.Predicate<E> provider)
true
for any item that the user can collapse.
Note: This callback will be accessed often when sending data to the client. The callback should not do any costly operations.
provider
- the item collapse allowed provider, not null
default void expand(E... items)
If an item is currently expanded, does nothing. If an item does not have any children, does nothing.
items
- the items to expandexpand(Collection)
void expand(java.util.Collection<E> items)
If an item is currently expanded, does nothing. If an item does not have any children, does nothing.
items
- the items to expandexpand(Entity[])
default void expandRecursively(java.util.Collection<E> items, int depth)
depth
describes the maximum distance between a given item and its descendant,
meaning that expandRecursively(items, 0)
expands only the given items
while expandRecursively(items, 2)
expands the given items as well as their
children and grandchildren.
This method will not fire events for expanded nodes.
items
- the items to expand recursivelydepth
- the maximum depth of recursionexpandRecursively(Stream, int)
void expandAll()
This method will not fire events for expanded nodes.
void expandRecursively(java.util.stream.Stream<E> items, int depth)
depth
describes the maximum distance between a given item and its descendant,
meaning that expandRecursively(items, 0)
expands only the given items
while expandRecursively(items, 2)
expands the given items as well as their
children and grandchildren.
This method will not fire events for expanded nodes.
items
- the items to expand recursivelydepth
- the maximum depth of recursionexpandRecursively(Collection, int)
default void collapse(E... items)
For items that are already collapsed, does nothing.
items
- the items to collapsecollapse(Collection)
void collapse(java.util.Collection<E> items)
For items that are already collapsed, does nothing.
items
- the items to collapsecollapse(Entity[])
default void collapseRecursively(java.util.Collection<E> items, int depth)
depth
describes the maximum distance between a given item and its
descendant, meaning that collapseRecursively(items, 0)
collapses
only the given items while collapseRecursively(items, 2)
collapses the given items as well as their children and grandchildren.
This method will not fire events for collapsed nodes.
items
- the items to collapse recursivelydepth
- the maximum depth of recursioncollapseRecursively(Stream, int)
void collapseRecursively(java.util.stream.Stream<E> items, int depth)
depth
describes the maximum distance between a given item and its
descendant, meaning that collapseRecursively(items, 0)
collapses
only the given items while collapseRecursively(items, 2)
collapses the given items as well as their children and grandchildren.
This method will not fire events for collapsed nodes.
items
- the items to collapse recursivelydepth
- the maximum depth of recursioncollapseRecursively(Collection, int)
void collapseAll()
This method will not fire events for expanded nodes.
boolean isExpanded(E item)
item
- the item to checktrue
if the item is expanded, false
otherwiseSubscription addExpandListener(java.util.function.Consumer<TreeDataGrid.ExpandEvent<E>> listener)
listener
- the listener to be addedSubscription addCollapseListener(java.util.function.Consumer<TreeDataGrid.CollapseEvent<E>> listener)
listener
- the listener to be added