E - row item typepublic interface DataGrid<E extends Entity> extends ListComponent<E>, HasButtonsPanel, Component.HasCaption, Component.HasIcon, HasContextHelp, HasRowsCount, HasSettings, HasDataLoadingSettings, HasHtmlCaption, HasHtmlDescription, LookupComponent<E>, Component.Focusable, RowsCount.RowsCountTarget, HasSubParts, HasHtmlSanitizer, HasMinSize
| Modifier and Type | Interface and Description |
|---|---|
static class |
DataGrid.AbstractDataGridEditorEvent<E extends Entity>
The root class from which all DataGrid editor event state objects shall be derived.
|
static class |
DataGrid.AbstractDataGridEvent
The root class from which all DataGrid event state objects shall be derived.
|
static class |
DataGrid.AggregationPosition
Defines the position of aggregation row.
|
static interface |
DataGrid.ButtonRenderer<T extends Entity>
A Renderer that displays a button with a textual caption.
|
static interface |
DataGrid.CellDescriptionProvider<E extends Entity>
Deprecated.
use
DataGrid.Column.getDescriptionProvider() instead |
static interface |
DataGrid.CellStyleProvider<E extends Entity>
Deprecated.
use
DataGrid.Column.setStyleProvider(Function) instead |
static interface |
DataGrid.CheckBoxRenderer
A renderer that represents a boolean values as a graphical check box icons.
|
static interface |
DataGrid.ClickableTextRenderer<T extends Entity>
A renderer for presenting simple plain-text string values as a link with call back handler.
|
static interface |
DataGrid.Column<E extends Entity>
A column in the DataGrid.
|
static class |
DataGrid.ColumnCollapsingChangeEvent
An event that is fired when a column's collapsing changes.
|
static interface |
DataGrid.ColumnEditorFieldGenerator
Deprecated.
|
static interface |
DataGrid.ColumnGenerator<E extends Entity,T> |
static class |
DataGrid.ColumnGeneratorEvent<E extends Entity>
Event provided by a
DataGrid.ColumnGenerator |
static class |
DataGrid.ColumnReorderEvent
An event that is fired when the columns are reordered.
|
static class |
DataGrid.ColumnResizeEvent
An event that is fired when a column is resized.
|
static class |
DataGrid.ColumnResizeMode |
static interface |
DataGrid.ComponentRenderer
A renderer for UI components.
|
static class |
DataGrid.ContextClickEvent
Context click event fired by a
DataGrid. |
static interface |
DataGrid.Converter<P,M>
Deprecated.
Use
Column#setRenderer(Renderer, Function)
and presentation provider represented by a Function instead |
static class |
DataGrid.DataGridClickEvent
Class for holding information about a mouse click event.
|
static class |
DataGrid.DataGridStaticCellType
Enumeration, specifying the content type of a Cell in a DataGrid header or footer.
|
static interface |
DataGrid.DateRenderer
A renderer for presenting date values.
|
static interface |
DataGrid.DetailsGenerator<E extends Entity>
A callback interface for generating details for a particular row in Grid.
|
static class |
DataGrid.EditorCloseEvent<E extends Entity>
An event that is fired when the DataGrid editor is closed.
|
static class |
DataGrid.EditorFieldGenerationContext<T>
class which stores information that can be used
when creating a component for a
DataGrid editor. |
static class |
DataGrid.EditorOpenEvent<E extends Entity>
An event that is fired before the DataGrid editor is opened.
|
static class |
DataGrid.EditorPostCommitEvent<E extends Entity>
An event that is fired after the item is updated.
|
static class |
DataGrid.EditorPreCommitEvent<E extends Entity>
An event that is fired before the item is updated.
|
static class |
DataGrid.EmptyStateClickEvent<E extends Entity>
Describes empty state link click event.
|
static interface |
DataGrid.FooterCell
Represents a footer cell in DataGrid.
|
static interface |
DataGrid.FooterRow
Represents a footer row in DataGrid.
|
static interface |
DataGrid.GenericColumnGenerator<E extends Entity,T>
INTERNAL
|
static interface |
DataGrid.HasDateTimeFormatter
A renderer has a DateTimeFormatter.
|
static interface |
DataGrid.HasFormatString
A renderer has a format string.
|
static interface |
DataGrid.HasLocale
A renderer has a locale.
|
static interface |
DataGrid.HasNullRepresentation
A renderer has a null representation.
|
static interface |
DataGrid.HasRendererClickListener<T extends Entity>
Renderer has click listener.
|
static interface |
DataGrid.HeaderCell
Represents a header cell in DataGrid.
|
static interface |
DataGrid.HeaderRow
Represents a header row in DataGrid.
|
static interface |
DataGrid.HtmlRenderer
A renderer for presenting HTML content.
|
static interface |
DataGrid.IconRenderer<T extends Entity>
A renderer that represents
CubaIcon. |
static interface |
DataGrid.ImageRenderer<T extends Entity>
A renderer for presenting images.
|
static class |
DataGrid.ItemClickEvent<E>
Click event fired by a
DataGrid |
static interface |
DataGrid.LocalDateRenderer
A renderer for presenting LocalDate values.
|
static interface |
DataGrid.LocalDateTimeRenderer
A renderer for presenting LocalDateTime values.
|
static interface |
DataGrid.NumberRenderer
A renderer for presenting number values.
|
static interface |
DataGrid.ProgressBarRenderer
A renderer that represents a double values as a graphical progress bar.
|
static interface |
DataGrid.Renderer
Marker interface to indicate that the implementing class can be used as a renderer.
|
static class |
DataGrid.RendererClickEvent<T extends Entity>
Click event fired by a
DataGrid.HasRendererClickListener |
static interface |
DataGrid.RowDescriptionProvider<E extends Entity>
Deprecated.
use
Function instead |
static interface |
DataGrid.RowStyleProvider<E extends Entity>
Deprecated.
use
Function instead |
static class |
DataGrid.ScrollDestination
Enumeration, specifying the destinations that are supported when scrolling
rows or columns into view.
|
static class |
DataGrid.SelectionEvent<E extends Entity>
Event sent when the selection changes.
|
static class |
DataGrid.SelectionMode |
static class |
DataGrid.SortDirection
Describes sorting direction.
|
static class |
DataGrid.SortEvent
An event that is fired when a sort order is changed.
|
static class |
DataGrid.SortOrder
Sort order descriptor.
|
static interface |
DataGrid.StaticCell
Base interface for DataGrid header or footer cells.
|
static interface |
DataGrid.StaticRow<T extends DataGrid.StaticCell>
Base interface for DataGrid header and footer rows.
|
static interface |
DataGrid.TextRenderer
A renderer for presenting simple plain-text string values.
|
ListComponent.IconProvider<E extends Entity>HasContextHelp.ContextHelpIconClickEventLookupComponent.LookupSelectionChangeEvent<T extends Entity>, LookupComponent.LookupSelectionChangeNotifier<T extends Entity>| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
| Modifier and Type | Method and Description |
|---|---|
void |
addCellStyleProvider(DataGrid.CellStyleProvider<? super E> styleProvider)
Deprecated.
use
DataGrid.Column.setStyleProvider(Function) instead |
void |
addColumn(DataGrid.Column<E> column)
Adds the given column to DataGrid.
|
void |
addColumn(DataGrid.Column<E> column,
int index)
Adds the given column at the specified index to DataGrid.
|
DataGrid.Column<E> |
addColumn(java.lang.String id,
MetaPropertyPath propertyPath)
Creates new column with given Id and property, then adds this column to DataGrid.
|
DataGrid.Column<E> |
addColumn(java.lang.String id,
MetaPropertyPath propertyPath,
int index)
Creates new column with given Id and property at the specified index,
then adds this column to DataGrid.
|
Subscription |
addColumnCollapsingChangeListener(java.util.function.Consumer<DataGrid.ColumnCollapsingChangeEvent> listener)
Registers a new column collapsing change listener.
|
Subscription |
addColumnReorderListener(java.util.function.Consumer<DataGrid.ColumnReorderEvent> listener)
Registers a new column reorder listener.
|
Subscription |
addColumnResizeListener(java.util.function.Consumer<DataGrid.ColumnResizeEvent> listener)
Registers a new column resize listener.
|
Subscription |
addContextClickListener(java.util.function.Consumer<DataGrid.ContextClickEvent> listener)
Registers a new context click listener
|
Subscription |
addEditorCloseListener(java.util.function.Consumer<DataGrid.EditorCloseEvent> listener)
Registers a new DataGrid editor close listener.
|
Subscription |
addEditorOpenListener(java.util.function.Consumer<DataGrid.EditorOpenEvent> listener)
Registers a new DataGrid editor open listener.
|
Subscription |
addEditorPostCommitListener(java.util.function.Consumer<DataGrid.EditorPostCommitEvent> listener)
Registers a new DataGrid editor post commit listener.
|
Subscription |
addEditorPreCommitListener(java.util.function.Consumer<DataGrid.EditorPreCommitEvent> listener)
Registers a new DataGrid editor pre commit listener.
|
DataGrid.FooterRow |
addFooterRowAt(int index)
Inserts a new row at the given position to the footer section.
|
DataGrid.Column<E> |
addGeneratedColumn(java.lang.String columnId,
DataGrid.ColumnGenerator<E,?> generator)
Add a generated column to the DataGrid.
|
DataGrid.Column<E> |
addGeneratedColumn(java.lang.String columnId,
DataGrid.ColumnGenerator<E,?> generator,
int index)
Add a generated column to the DataGrid.
|
DataGrid.Column<E> |
addGeneratedColumn(java.lang.String columnId,
DataGrid.GenericColumnGenerator<E,?> generator)
INTERNAL
|
DataGrid.HeaderRow |
addHeaderRowAt(int index)
Inserts a new row at the given position to the header section.
|
Subscription |
addItemClickListener(java.util.function.Consumer<DataGrid.ItemClickEvent<E>> listener)
Registers a new item click listener
|
void |
addRowStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
Adds style provider for the DataGrid rows.
|
Subscription |
addSelectionListener(java.util.function.Consumer<DataGrid.SelectionEvent<E>> listener)
Registers a new selection listener
|
Subscription |
addSortListener(java.util.function.Consumer<DataGrid.SortEvent> listener)
Registers a new sort order change listener
|
DataGrid.FooterRow |
appendFooterRow()
Adds a new row at the bottom of the footer section.
|
DataGrid.HeaderRow |
appendHeaderRow()
Adds a new row at the bottom of the header section.
|
<T extends DataGrid.Renderer> |
createRenderer(java.lang.Class<T> type)
Creates renderer implementation by its type.
|
void |
deselect(E item)
Deselects the given item.
|
void |
deselectAll()
Deselects all the items in the current data source.
|
void |
edit(E item)
Opens the editor interface for the provided entity.
|
void |
editItem(java.lang.Object itemId)
Deprecated.
Use
edit(Entity) |
DataGrid.AggregationPosition |
getAggregationPosition() |
java.util.Map<java.lang.String,java.lang.Object> |
getAggregationResults() |
double |
getBodyRowHeight()
Returns the current body row height.
|
DataGrid.CellDescriptionProvider<E> |
getCellDescriptionProvider()
Deprecated.
use
DataGrid.Column.getDescriptionProvider() instead |
DataGrid.Column<E> |
getColumn(java.lang.String id)
Returns a column based on the Id.
|
DataGrid.ColumnGenerator<E,?> |
getColumnGenerator(java.lang.String columnId)
Gets the columns generator for the given column id.
|
DataGrid.Column<E> |
getColumnNN(java.lang.String id)
Returns a column by its Id.
|
DataGrid.ColumnResizeMode |
getColumnResizeMode()
Returns the current column resize mode.
|
java.util.List<DataGrid.Column<E>> |
getColumns()
Returns a copy of currently configured columns in their current visual
order in this DataGrid.
|
default CollectionDatasource |
getDatasource()
Deprecated.
use
getItems() instead |
DataGrid.HeaderRow |
getDefaultHeaderRow()
Returns the current default row of the header section.
|
DataGrid.DetailsGenerator<E> |
getDetailsGenerator() |
E |
getEditedItem()
Returns the item that is currently being edited.
|
java.lang.Object |
getEditedItemId()
Deprecated.
use
getEditedItem() instead |
java.lang.String |
getEditorCancelCaption()
Gets the current caption of the cancel button in the DataGrid editor.
|
java.lang.String |
getEditorSaveCaption()
Gets the current caption of the save button in the DataGrid editor.
|
java.util.function.Consumer<DataGrid.EmptyStateClickEvent<E>> |
getEmptyStateLinkClickHandler() |
java.lang.String |
getEmptyStateLinkMessage() |
java.lang.String |
getEmptyStateMessage() |
Action |
getEnterPressAction() |
DataGrid.FooterRow |
getFooterRow(int index)
Gets the footer row at given index.
|
int |
getFooterRowCount()
Gets the row count for the footer.
|
double |
getFooterRowHeight()
Returns the current footer row height.
|
int |
getFrozenColumnCount()
Gets the number of frozen columns in this DataGrid.
|
DataGrid.HeaderRow |
getHeaderRow(int index)
Gets the header row at given index.
|
int |
getHeaderRowCount()
Gets the row count for the header section.
|
double |
getHeaderRowHeight()
Returns the current header row height.
|
Action |
getItemClickAction() |
DataGridItems<E> |
getItems() |
java.lang.Float |
getMinHeight() |
SizeUnit |
getMinHeightSizeUnit() |
java.lang.Float |
getMinWidth() |
SizeUnit |
getMinWidthSizeUnit() |
java.util.function.Function<E,java.lang.String> |
getRowDescriptionProvider()
Returns the
RowDescriptionProvider instance used to generate
descriptions (tooltips) for DataGrid rows |
DataGrid.SelectionMode |
getSelectionMode() |
java.util.List<DataGrid.SortOrder> |
getSortOrder() |
default java.lang.Object |
getSubPart(java.lang.String name) |
java.util.List<DataGrid.Column<E>> |
getVisibleColumns()
Returns a copy of columns not hidden by security permissions.
|
boolean |
isAggregatable() |
boolean |
isColumnReorderingAllowed()
Returns whether column reordering is allowed.
|
boolean |
isColumnsCollapsingAllowed() |
boolean |
isContextMenuEnabled() |
boolean |
isDetailsVisible(E entity)
Checks whether details are visible for the given item.
|
boolean |
isEditorActive()
Returns whether an item is currently being edited in the editor.
|
boolean |
isEditorBuffered()
Gets the buffered editor mode.
|
boolean |
isEditorCrossFieldValidate() |
boolean |
isEditorEnabled()
Checks whether the item editor UI is enabled for this DataGrid.
|
boolean |
isFooterVisible()
Returns the visibility of the footer section.
|
boolean |
isHeaderVisible()
Returns the visibility of the header section.
|
boolean |
isSortable() |
boolean |
isTextSelectionEnabled() |
static <T extends Entity> |
of(java.lang.Class<T> itemClass) |
DataGrid.FooterRow |
prependFooterRow()
Adds a new row at the top of the footer section.
|
DataGrid.HeaderRow |
prependHeaderRow()
Adds a new row at the top of the header section.
|
void |
removeCellStyleProvider(DataGrid.CellStyleProvider<? super E> styleProvider)
Deprecated.
use
DataGrid.Column.setStyleProvider(Function) instead |
void |
removeColumn(DataGrid.Column<E> column)
Removes the given column from DataGrid or do nothing if column is
null. |
void |
removeColumn(java.lang.String id)
Removes a column from DataGrid by its Id or do nothing if column is not found.
|
void |
removeColumnCollapsingChangeListener(java.util.function.Consumer<DataGrid.ColumnCollapsingChangeEvent> listener)
Deprecated.
Use
Subscription instead |
void |
removeColumnReorderListener(java.util.function.Consumer<DataGrid.ColumnReorderEvent> listener)
Deprecated.
Use
Subscription instead |
void |
removeColumnResizeListener(java.util.function.Consumer<DataGrid.ColumnResizeEvent> listener)
Deprecated.
Use
Subscription instead |
void |
removeContextClickListener(java.util.function.Consumer<DataGrid.ContextClickEvent> listener)
Removes a previously registered context click listener
|
void |
removeEditorCloseListener(java.util.function.Consumer<DataGrid.EditorCloseEvent> listener)
Deprecated.
Use
Subscription instead |
void |
removeEditorOpenListener(java.util.function.Consumer<DataGrid.EditorOpenEvent> listener)
Deprecated.
Use
Subscription instead |
void |
removeEditorPostCommitListener(java.util.function.Consumer<DataGrid.EditorPostCommitEvent> listener)
Deprecated.
Use
Subscription instead |
void |
removeEditorPreCommitListener(java.util.function.Consumer<DataGrid.EditorPreCommitEvent> listener)
Deprecated.
Use
Subscription instead |
void |
removeFooterRow(DataGrid.FooterRow footerRow)
Removes the given row from the footer section.
|
void |
removeFooterRow(int index)
Removes the row at the given position from the footer section.
|
void |
removeHeaderRow(DataGrid.HeaderRow headerRow)
Removes the given row from the header section.
|
void |
removeHeaderRow(int index)
Removes the row at the given position from the header section.
|
void |
removeItemClickListener(java.util.function.Consumer<DataGrid.ItemClickEvent<E>> listener)
Removes a previously registered item click listener
|
void |
removeRowStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
Removes style provider for the DataGrid rows.
|
void |
removeSelectionListener(java.util.function.Consumer<DataGrid.SelectionEvent<E>> listener)
Deprecated.
Use
Subscription instead |
void |
removeSortListener(java.util.function.Consumer<DataGrid.SortEvent> listener)
Deprecated.
Use
Subscription instead |
void |
repaint()
Repaint UI representation of the DataGrid without refreshing the table data.
|
void |
scrollTo(E item)
Scrolls to a certain item, using
DataGrid.ScrollDestination.ANY. |
void |
scrollTo(E item,
DataGrid.ScrollDestination destination)
Scrolls to a certain item, using user-specified scroll destination.
|
void |
scrollToEnd()
Scrolls to the last data item.
|
void |
scrollToStart()
Scrolls to the first data item.
|
void |
selectAll()
Marks all the items in the current data source as selected.
|
void |
setAggregatable(boolean aggregatable)
Set to true if aggregation should be enabled.
|
void |
setAggregationPosition(DataGrid.AggregationPosition position)
Sets aggregation row position.
|
void |
setBodyRowHeight(double rowHeight)
Sets the height of a body row.
|
void |
setCellDescriptionProvider(DataGrid.CellDescriptionProvider<? super E> provider)
Deprecated.
use
DataGrid.Column.setDescriptionProvider(Function) instead |
void |
setColumnReorderingAllowed(boolean columnReorderingAllowed)
Sets whether or not column reordering is allowed.
|
void |
setColumnResizeMode(DataGrid.ColumnResizeMode mode)
Sets the column resize mode to use.
|
void |
setColumnsCollapsingAllowed(boolean columnsCollapsingAllowed)
Defines if collapsible attribute can be changed for individual column or not.
|
void |
setContextMenuEnabled(boolean contextMenuEnabled)
Sets whether or not context menu is enabled.
|
default void |
setDatasource(CollectionDatasource datasource)
Deprecated.
use
setItems(DataGridItems) instead |
void |
setDefaultHeaderRow(DataGrid.HeaderRow headerRow)
Sets the default row of the header.
|
void |
setDetailsGenerator(DataGrid.DetailsGenerator<E> detailsGenerator)
Sets a new details generator for row details.
|
void |
setDetailsVisible(E entity,
boolean visible)
Shows or hides the details for a specific item.
|
void |
setEditorBuffered(boolean editorBuffered)
Sets the buffered editor mode.
|
void |
setEditorCancelCaption(java.lang.String cancelCaption)
Sets the caption on the cancel button in the DataGrid editor.
|
void |
setEditorCrossFieldValidate(boolean validate)
Enables cross field validation in the inline editor.
|
void |
setEditorEnabled(boolean isEnabled)
Sets whether or not the item editor UI is enabled for this DataGrid.
|
void |
setEditorSaveCaption(java.lang.String saveCaption)
Sets the caption on the save button in the DataGrid editor.
|
void |
setEmptyStateLinkClickHandler(java.util.function.Consumer<DataGrid.EmptyStateClickEvent<E>> handler)
Sets click handler for link message.
|
void |
setEmptyStateLinkMessage(java.lang.String linkMessage)
Sets a link message to the middle of DataGrid body that should be appeared when DataGrid is empty.
|
void |
setEmptyStateMessage(java.lang.String message)
Sets a message to the middle of DataGrid body that should be appeared when DataGrid is empty.
|
void |
setEnterPressAction(Action action)
Assigns an action to be executed on Enter key press.
|
void |
setFooterRowHeight(double rowHeight)
Sets the body of a footer row.
|
void |
setFooterVisible(boolean footerVisible)
Sets the visibility of the footer section.
|
void |
setFrozenColumnCount(int numberOfColumns)
Sets the number of frozen columns in this grid.
|
void |
setHeaderRowHeight(double rowHeight)
Sets the body of a body row.
|
void |
setHeaderVisible(boolean headerVisible)
Sets the visibility of the header section.
|
void |
setItemClickAction(Action action)
Assigns an action to be executed on double click on a DataGrid row.
|
void |
setItems(DataGridItems<E> dataGridItems)
Sets an instance of
DataGridItems as the DataGrid data source. |
void |
setMinHeight(java.lang.String minHeight)
Sets
minHeight CSS property value to the Grid (not a composition). |
void |
setMinWidth(java.lang.String minWidth)
Sets
minWidth CSS property value to the Grid (not a composition). |
void |
setRowDescriptionProvider(java.util.function.Function<? super E,java.lang.String> provider)
Sets the
RowDescriptionProvider instance for generating
optional descriptions (tooltips) for DataGrid rows. |
void |
setRowDescriptionProvider(java.util.function.Function<? super E,java.lang.String> provider,
ContentMode contentMode)
Sets the
RowDescriptionProvider instance for generating
optional descriptions (tooltips) for DataGrid rows. |
void |
setSelectionMode(DataGrid.SelectionMode selectionMode)
Sets the DataGrid's selection mode.
|
void |
setSortable(boolean sortable)
Defines if this attribute can be changed for individual column or not.
|
void |
setTextSelectionEnabled(boolean textSelectionEnabled)
Enable or disable text selection in DataGrid cells.
|
void |
sort(java.lang.String columnId,
DataGrid.SortDirection direction)
Sorts the DataGrid data for passed column id in the chosen sort direction.
|
getSelected, getSingleSelected, isMultiSelect, setSelected, setSelectedaddAction, addAction, getAction, getActionNN, getActions, removeAction, removeAction, removeAllActionsgetButtonsPanel, setButtonsPanelgetIcon, setIcon, setIconFromSetgetContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledgetRowsCount, setRowsCount, setRowsCountTotalCountDelegateapplySettings, isSettingsEnabled, saveSettings, setSettingsEnabledapplyDataLoadingSettingsisCaptionAsHtml, setCaptionAsHtmlgetCaption, setCaptiongetDescription, setDescriptionisDescriptionAsHtml, setDescriptionAsHtmlgetLookupSelectedItems, setLookupSelectHandlerfocus, getTabIndex, isFocusable, setFocusable, setTabIndexgetFrame, setFrameisHtmlSanitizerEnabled, setHtmlSanitizerEnabledstatic final java.lang.String NAME
static <T extends Entity> com.google.common.reflect.TypeToken<DataGrid<T>> of(java.lang.Class<T> itemClass)
java.util.List<DataGrid.Column<E>> getColumns()
getVisibleColumns()java.util.List<DataGrid.Column<E>> getVisibleColumns()
getColumns()@Nullable DataGrid.Column<E> getColumn(java.lang.String id)
id - the column Idnull if not foundgetColumnNN(String)DataGrid.Column<E> getColumnNN(java.lang.String id)
id - the column Idjava.lang.IllegalStateException - if not foundgetColumn(String)void addColumn(DataGrid.Column<E> column)
column - the column to addaddColumn(Column, int),
addColumn(String, MetaPropertyPath),
addColumn(String, MetaPropertyPath, int)void addColumn(DataGrid.Column<E> column, int index)
column - the column to addindex - index of a new columnaddColumn(Column),
addColumn(String, MetaPropertyPath),
addColumn(String, MetaPropertyPath, int)DataGrid.Column<E> addColumn(java.lang.String id, @Nullable MetaPropertyPath propertyPath)
id - the column IdpropertyPath - the instance of MetaPropertyPath representing a relative path
to a property from certain MetaClassaddColumn(Column),
addColumn(Column, int),
addColumn(String, MetaPropertyPath, int)DataGrid.Column<E> addColumn(java.lang.String id, MetaPropertyPath propertyPath, int index)
id - the column IdpropertyPath - the instance of MetaPropertyPath representing a relative path
to a property from certain MetaClassindex - index of a new columnaddColumn(Column),
addColumn(Column, int),
addColumn(String, MetaPropertyPath)void removeColumn(DataGrid.Column<E> column)
null.column - the column to addremoveColumn(String)void removeColumn(java.lang.String id)
id - the columns IdremoveColumn(Column)@Nullable DataGridItems<E> getItems()
getItems in interface ListComponent<E extends Entity>void setItems(@Nullable
DataGridItems<E> dataGridItems)
DataGridItems as the DataGrid data source.dataGridItems - the DataGrid data source@Deprecated default CollectionDatasource getDatasource()
getItems() insteadgetDatasource in interface ListComponent<E extends Entity>@Deprecated default void setDatasource(CollectionDatasource datasource)
setItems(DataGridItems) insteadCollectionDatasource as the DataGrid data source.datasource - the DataGrid data source, not nullvoid selectAll()
void deselect(E item)
item - the item to deselect, not nullvoid deselectAll()
void sort(java.lang.String columnId,
DataGrid.SortDirection direction)
columnId - id of the column to sortdirection - sort directionjava.util.List<DataGrid.SortOrder> getSortOrder()
boolean isTextSelectionEnabled()
true if text selection is enabled.void setTextSelectionEnabled(boolean textSelectionEnabled)
false.textSelectionEnabled - specifies whether text selection in DataGrid cells is enabledboolean isColumnReorderingAllowed()
true.true if reordering is allowedvoid setColumnReorderingAllowed(boolean columnReorderingAllowed)
true.columnReorderingAllowed - specifies whether column reordering is allowedboolean isHeaderVisible()
true if visible, false otherwisevoid setHeaderVisible(boolean headerVisible)
headerVisible - true to show the header section, false to hideboolean isFooterVisible()
true if visible, false otherwisevoid setFooterVisible(boolean footerVisible)
footerVisible - true to show the footer section, false to hidedouble getBodyRowHeight()
void setBodyRowHeight(double rowHeight)
rowHeight - the height of a row in pixels or -1 for AUTOdouble getHeaderRowHeight()
void setHeaderRowHeight(double rowHeight)
rowHeight - the height of a row in pixels or -1 for AUTOdouble getFooterRowHeight()
void setFooterRowHeight(double rowHeight)
rowHeight - the height of a row in pixels or -1 for AUTOboolean isContextMenuEnabled()
true if context menu is enabled, false otherwisevoid setContextMenuEnabled(boolean contextMenuEnabled)
true.contextMenuEnabled - specifies whether context menu is enabledAction getItemClickAction()
setItemClickAction(Action)setItemClickAction(Action)void setItemClickAction(Action action)
If such action is not set, the table responds to pressing Enter by trying to find and execute the following actions:
shortcut propertyIf one of these actions is found and it is enabled, it is executed.
action - an action to be executed on double click on a DataGrid rowAction getEnterPressAction()
setEnterPressAction(Action)setEnterPressAction(Action)void setEnterPressAction(Action action)
If such action is not set, the table responds to pressing Enter by trying to find and execute the following actions:
setItemClickAction(Action)shortcut propertyIf one of these actions is found and it is enabled, it is executed.
action - an action to be executed on Enter key presssetItemClickAction(Action)int getFrozenColumnCount()
hidden
columns in the count.setFrozenColumnCount(int)void setFrozenColumnCount(int numberOfColumns)
The default value is 0.
numberOfColumns - the number of columns that should be frozenjava.lang.IllegalArgumentException - if the column count is < 0 or > the number of visible columnsboolean isSortable()
true if individual column sortable
attribute can be set to true, false otherwisevoid setSortable(boolean sortable)
true.sortable - true if individual column sortable
attribute can be set to true, false otherwiseboolean isColumnsCollapsingAllowed()
true if individual column collapsible attribute
can be set to true, false otherwisevoid setColumnsCollapsingAllowed(boolean columnsCollapsingAllowed)
true.columnsCollapsingAllowed - true if individual column collapsible attribute
can be set to true, false otherwiseboolean isEditorEnabled()
true if the editor is enabled for this gridsetEditorEnabled(boolean),
getEditedItem()void setEditorEnabled(boolean isEnabled)
edit(Entity) method.isEnabled - true to enable the feature, false otherwisegetEditedItem()boolean isEditorBuffered()
true if buffered editor is enabled, false otherwisevoid setEditorBuffered(boolean editorBuffered)
true).editorBuffered - true to enable buffered editor, false to disable itjava.lang.String getEditorSaveCaption()
void setEditorSaveCaption(java.lang.String saveCaption)
saveCaption - the caption to setjava.lang.String getEditorCancelCaption()
void setEditorCancelCaption(java.lang.String cancelCaption)
cancelCaption - the caption to set@Deprecated @Nullable java.lang.Object getEditedItemId()
getEditedItem() insteadnull if no item is being edited at the moment@Nullable E getEditedItem()
null if no item is being edited at the momentboolean isEditorActive()
true if the editor is open@Deprecated void editItem(java.lang.Object itemId)
edit(Entity)itemId - the id of the item to editjava.lang.IllegalStateException - if the editor is not enabled or already editing an item in buffered modejava.lang.IllegalArgumentException - if datasource doesn't contain item with given idsetEditorEnabled(boolean)void edit(E item)
item - the item to editjava.lang.IllegalStateException - if the editor is not enabled or already editing an entity in buffered modejava.lang.IllegalArgumentException - if datasource doesn't contain the entitysetEditorEnabled(boolean)void setEditorCrossFieldValidate(boolean validate)
validate - validate option, true if an editor should validate cross field rulesboolean isEditorCrossFieldValidate()
Subscription addEditorPreCommitListener(java.util.function.Consumer<DataGrid.EditorPreCommitEvent> listener)
listener - the listener to register@Deprecated void removeEditorPreCommitListener(java.util.function.Consumer<DataGrid.EditorPreCommitEvent> listener)
Subscription insteadlistener - the listener to removeSubscription addEditorPostCommitListener(java.util.function.Consumer<DataGrid.EditorPostCommitEvent> listener)
listener - the listener to register@Deprecated void removeEditorPostCommitListener(java.util.function.Consumer<DataGrid.EditorPostCommitEvent> listener)
Subscription insteadlistener - the listener to removeSubscription addEditorCloseListener(java.util.function.Consumer<DataGrid.EditorCloseEvent> listener)
listener - the listener to register@Deprecated void removeEditorCloseListener(java.util.function.Consumer<DataGrid.EditorCloseEvent> listener)
Subscription insteadlistener - the listener to removeSubscription addEditorOpenListener(java.util.function.Consumer<DataGrid.EditorOpenEvent> listener)
listener - the listener to register@Deprecated void removeEditorOpenListener(java.util.function.Consumer<DataGrid.EditorOpenEvent> listener)
Subscription insteadlistener - the listener to removevoid repaint()
void scrollTo(E item)
DataGrid.ScrollDestination.ANY.item - item to scroll toscrollTo(Entity, ScrollDestination),
scrollToStart(),
scrollToEnd()void scrollTo(E item, DataGrid.ScrollDestination destination)
item - item to scroll todestination - value specifying desired position of scrolled-to rowscrollTo(Entity),
scrollToStart(),
scrollToEnd()void scrollToStart()
void scrollToEnd()
DataGrid.ColumnResizeMode getColumnResizeMode()
DataGrid.ColumnResizeMode.ANIMATED.void setColumnResizeMode(DataGrid.ColumnResizeMode mode)
DataGrid.ColumnResizeMode.ANIMATED.mode - a ColumnResizeMode valueDataGrid.SelectionMode getSelectionMode()
DataGrid.SelectionModevoid setSelectionMode(DataGrid.SelectionMode selectionMode)
selectionMode - the selection mode to usevoid addRowStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
DataGrid can use several providers to obtain many style names for rows.
styleProvider - a style provider to add, not nullvoid removeRowStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
styleProvider - a style provider to remove, not null@Deprecated void addCellStyleProvider(DataGrid.CellStyleProvider<? super E> styleProvider)
DataGrid.Column.setStyleProvider(Function) insteadDataGrid can use several providers to obtain many style names for cells.
@Deprecated void removeCellStyleProvider(DataGrid.CellStyleProvider<? super E> styleProvider)
DataGrid.Column.setStyleProvider(Function) instead@Deprecated DataGrid.CellDescriptionProvider<E> getCellDescriptionProvider()
DataGrid.Column.getDescriptionProvider() insteadCellDescriptionProvider instance used to generate
descriptions (tooltips) for DataGrid cells.null if no provider is set@Deprecated void setCellDescriptionProvider(DataGrid.CellDescriptionProvider<? super E> provider)
DataGrid.Column.setDescriptionProvider(Function) insteadCellDescriptionProvider instance for generating
optional descriptions (tooltips) for individual DataGrid cells. If a
DataGrid.RowDescriptionProvider is also set, the row description it
generates is displayed for cells for which provider returns null.provider - the description provider to use or null to remove a
previously set provider if anyjava.util.function.Function<E,java.lang.String> getRowDescriptionProvider()
RowDescriptionProvider instance used to generate
descriptions (tooltips) for DataGrid rowsvoid setRowDescriptionProvider(java.util.function.Function<? super E,java.lang.String> provider)
RowDescriptionProvider instance for generating
optional descriptions (tooltips) for DataGrid rows. If a
DataGrid.Column.setDescriptionProvider(Function) is also set,
the row description generated by provider is used for cells
for which the cell description provider returns null.
This method uses the ContentMode.PREFORMATTED content mode.
provider - the description provider to use or null to remove a
previously set provider if anyvoid setRowDescriptionProvider(java.util.function.Function<? super E,java.lang.String> provider, ContentMode contentMode)
RowDescriptionProvider instance for generating
optional descriptions (tooltips) for DataGrid rows. If a
DataGrid.Column.setDescriptionProvider(Function) is also set,
the row description generated by provider is used for cells
for which the cell description provider returns null.provider - the description provider to use or null to remove a
previously set provider if anycontentMode - the content mode for row tooltipsDataGrid.Column<E> addGeneratedColumn(java.lang.String columnId, DataGrid.ColumnGenerator<E,?> generator)
columnId - column identifier as defined in XML descriptorgenerator - column generator instanceaddGeneratedColumn(String, ColumnGenerator, int)DataGrid.Column<E> addGeneratedColumn(java.lang.String columnId, DataGrid.ColumnGenerator<E,?> generator, int index)
columnId - column identifier as defined in XML descriptorgenerator - column generator instanceindex - index of a new generated columnaddGeneratedColumn(String, ColumnGenerator)DataGrid.Column<E> addGeneratedColumn(java.lang.String columnId, DataGrid.GenericColumnGenerator<E,?> generator)
Adds a generated column to the DataGrid.
columnId - column identifier as defined in XML descriptorgenerator - column generator instanceDataGrid.ColumnGenerator<E,?> getColumnGenerator(java.lang.String columnId)
columnId - the column id for which to return column generator@Nullable DataGrid.DetailsGenerator<E> getDetailsGenerator()
null if not setvoid setDetailsGenerator(DataGrid.DetailsGenerator<E> detailsGenerator)
The currently opened row details will be re-rendered.
detailsGenerator - the details generator to setboolean isDetailsVisible(E entity)
entity - the item for which to check details visibilitytrue if the details are visiblevoid setDetailsVisible(E entity, boolean visible)
entity - the item for which to set details visibilityvisible - true to show the details, or false to hide them<T extends DataGrid.Renderer> T createRenderer(java.lang.Class<T> type)
type - renderer typeSubscription addColumnCollapsingChangeListener(java.util.function.Consumer<DataGrid.ColumnCollapsingChangeEvent> listener)
listener - the listener to register@Deprecated void removeColumnCollapsingChangeListener(java.util.function.Consumer<DataGrid.ColumnCollapsingChangeEvent> listener)
Subscription insteadlistener - the listener to removeSubscription addColumnReorderListener(java.util.function.Consumer<DataGrid.ColumnReorderEvent> listener)
listener - the listener to register@Deprecated void removeColumnReorderListener(java.util.function.Consumer<DataGrid.ColumnReorderEvent> listener)
Subscription insteadlistener - the listener to removeSubscription addColumnResizeListener(java.util.function.Consumer<DataGrid.ColumnResizeEvent> listener)
listener - the listener to register@Deprecated void removeColumnResizeListener(java.util.function.Consumer<DataGrid.ColumnResizeEvent> listener)
Subscription insteadlistener - the listener to removeSubscription addSelectionListener(java.util.function.Consumer<DataGrid.SelectionEvent<E>> listener)
listener - the listener to register@Deprecated void removeSelectionListener(java.util.function.Consumer<DataGrid.SelectionEvent<E>> listener)
Subscription insteadlistener - the listener to removeSubscription addSortListener(java.util.function.Consumer<DataGrid.SortEvent> listener)
listener - the listener to register@Deprecated void removeSortListener(java.util.function.Consumer<DataGrid.SortEvent> listener)
Subscription insteadlistener - the listener to removeSubscription addContextClickListener(java.util.function.Consumer<DataGrid.ContextClickEvent> listener)
listener - the listener to registervoid removeContextClickListener(java.util.function.Consumer<DataGrid.ContextClickEvent> listener)
listener - the listener to removeSubscription addItemClickListener(java.util.function.Consumer<DataGrid.ItemClickEvent<E>> listener)
listener - the listener to registervoid removeItemClickListener(java.util.function.Consumer<DataGrid.ItemClickEvent<E>> listener)
listener - the listener to removeDataGrid.HeaderRow getHeaderRow(int index)
index - 0 based index for row. Counted from top to bottomDataGrid.HeaderRow appendHeaderRow()
prependHeaderRow(),
addHeaderRowAt(int),
removeHeaderRow(HeaderRow),
removeHeaderRow(int)DataGrid.HeaderRow prependHeaderRow()
appendHeaderRow(),
addHeaderRowAt(int),
removeHeaderRow(HeaderRow),
removeHeaderRow(int)DataGrid.HeaderRow addHeaderRowAt(int index)
index - the position at which to insert the rowappendHeaderRow(),
prependHeaderRow(),
removeHeaderRow(HeaderRow),
removeHeaderRow(int)void removeHeaderRow(DataGrid.HeaderRow headerRow)
headerRow - the row to be removedremoveHeaderRow(int),
addHeaderRowAt(int),
appendHeaderRow(),
prependHeaderRow()void removeHeaderRow(int index)
index - the position of the rowremoveHeaderRow(HeaderRow),
addHeaderRowAt(int),
appendHeaderRow(),
prependHeaderRow()DataGrid.HeaderRow getDefaultHeaderRow()
void setDefaultHeaderRow(DataGrid.HeaderRow headerRow)
headerRow - the new default row, or null for no default rowint getHeaderRowCount()
DataGrid.FooterRow getFooterRow(int index)
index - 0 based index for row. Counted from top to bottomDataGrid.FooterRow appendFooterRow()
prependFooterRow(),
addFooterRowAt(int),
removeFooterRow(FooterRow),
removeFooterRow(int)DataGrid.FooterRow prependFooterRow()
appendFooterRow(),
addFooterRowAt(int),
removeFooterRow(FooterRow),
removeFooterRow(int)DataGrid.FooterRow addFooterRowAt(int index)
index - the position at which to insert the rowappendFooterRow(),
prependFooterRow(),
removeFooterRow(FooterRow),
removeFooterRow(int)void removeFooterRow(DataGrid.FooterRow footerRow)
footerRow - the row to be removedremoveFooterRow(int),
addFooterRowAt(int),
appendFooterRow(),
prependFooterRow()void removeFooterRow(int index)
index - the position of the rowremoveFooterRow(FooterRow),
addFooterRowAt(int),
appendFooterRow(),
prependFooterRow()int getFooterRowCount()
@Nullable default java.lang.Object getSubPart(java.lang.String name)
getSubPart in interface ActionsHoldergetSubPart in interface HasSubPartsboolean isAggregatable()
void setAggregatable(boolean aggregatable)
aggregatable - aggregatable optionDataGrid.AggregationPosition getAggregationPosition()
void setAggregationPosition(DataGrid.AggregationPosition position)
DataGrid.AggregationPosition.TOP.position - position: DataGrid.AggregationPosition.TOP or DataGrid.AggregationPosition.BOTTOMjava.util.Map<java.lang.String,java.lang.Object> getAggregationResults()
void setEmptyStateMessage(java.lang.String message)
message - message that appears when DataGrid is emptyjava.lang.String getEmptyStateMessage()
void setEmptyStateLinkMessage(java.lang.String linkMessage)
linkMessage - message that appears when DataGrid is emptysetEmptyStateLinkClickHandler(Consumer)java.lang.String getEmptyStateLinkMessage()
void setEmptyStateLinkClickHandler(java.util.function.Consumer<DataGrid.EmptyStateClickEvent<E>> handler)
handler - handler to setsetEmptyStateLinkMessage(String)java.util.function.Consumer<DataGrid.EmptyStateClickEvent<E>> getEmptyStateLinkClickHandler()
@Nullable java.lang.Float getMinHeight()
getMinHeight in interface HasMinSizemin-height CSS property value of the Grid (not a composition) or null if not set@Nullable SizeUnit getMinHeightSizeUnit()
getMinHeightSizeUnit in interface HasMinSizemin-height CSS property value of the Grid (not a composition)void setMinHeight(@Nullable
java.lang.String minHeight)
minHeight CSS property value to the Grid (not a composition). To set CSS properties to the
composition use css attribute in the XML descriptor or
HtmlAttributes.applyCss(Component, String).setMinHeight in interface HasMinSizeminHeight - property value@Nullable java.lang.Float getMinWidth()
getMinWidth in interface HasMinSizemin-width CSS property value of the Grid (not a composition) or null if not set@Nullable SizeUnit getMinWidthSizeUnit()
getMinWidthSizeUnit in interface HasMinSizemin-width CSS property value of the Grid (not a composition)void setMinWidth(@Nullable
java.lang.String minWidth)
minWidth CSS property value to the Grid (not a composition). To set CSS properties to the
composition use css attribute in the XML descriptor or
HtmlAttributes.applyCss(Component, String).setMinWidth in interface HasMinSizeminWidth - property value