public final class Grid.SelectionColumn extends Grid.Column<Boolean,T> implements GridEnabledHandler, GridSelectionAllowedHandler
| Modifier and Type | Method and Description |
|---|---|
protected void |
doSetSelectAllCheckBoxVisible()
Sets the select all checkbox visible or hidden.
|
int |
getExpandRatio()
Gets the expand ratio for this column.
|
double |
getMaximumWidth()
Gets the maximum width for this column.
|
double |
getMinimumWidth()
Gets the minimum width for this column.
|
Optional<com.google.gwt.user.client.ui.CheckBox> |
getSelectAllCheckBox()
Returns the select all checkbox, which is present in the default
header if the used selection model is of type
SelectionModelWithSelectionColumn. |
Boolean |
getValue(T row)
Returns the data that should be rendered into the cell.
|
boolean |
isSelectAllCheckBoxVisible()
Returns whether the select all checkbox is visible or not.
|
void |
onEnabled(boolean enabled)
Called when Grid is enabled or disabled.
|
void |
onSelectionAllowed(GridSelectionAllowedEvent event)
Called when Grid selection is allowed value changes.
|
protected void |
setDefaultHeaderContent(Grid.HeaderCell selectionCell)
Resets the default header cell contents to column header captions.
|
Grid.Column<Boolean,T> |
setEditable(boolean editable)
Sets whether the values in this column should be editable by the user
when the row editor is active.
|
Grid.Column<Boolean,T> |
setExpandRatio(int ratio)
Sets the ratio with which the column expands.
|
Grid.Column<Boolean,T> |
setMaximumWidth(double pixels)
Sets the maximum width for this column.
|
Grid.Column<Boolean,T> |
setMinimumWidth(double pixels)
Sets the minimum width for this column.
|
void |
setSelectAllCheckBoxVisible(boolean selectAllCheckBoxVisible)
Sets the select all checkbox visible in the default header row for
selection column.
|
Grid.Column<Boolean,T> |
setWidth(double pixels)
Sets the pixel width of the column.
|
clearExpandRatio, getAssistiveCaption, getHeaderCaption, getHidingToggleCaption, getRenderer, getWidth, getWidthActual, isEditable, isHandleWidgetEvents, isHidable, isHidden, isMinimumWidthFromContent, isResizable, isSortable, setAssistiveCaption, setHandleWidgetEvents, setHeaderCaption, setHidable, setHidden, setHidingToggleCaption, setMinimumWidthFromContent, setRenderer, setResizable, setSortable, toStringprotected void setDefaultHeaderContent(Grid.HeaderCell selectionCell)
Grid.ColumnsetDefaultHeaderContent in class Grid.Column<Boolean,T>selectionCell - default header cell for this columnpublic Grid.Column<Boolean,T> setWidth(double pixels)
Grid.ColumnThis action is done "finally", once the current execution loop returns. This is done to reduce overhead of unintentionally always recalculate all columns, when modifying several columns at once.
If the column is currently hidden, then this set
width has effect only once the column has been made visible again.
setWidth in class Grid.Column<Boolean,T>pixels - the width in pixels or negative for auto sizingpublic Boolean getValue(T row)
Grid.ColumnTo support other types you will need to pass a custom renderer to the column via the column constructor.
getValue in class Grid.Column<Boolean,T>row - The row object that provides the cell content.public Grid.Column<Boolean,T> setExpandRatio(int ratio)
Grid.ColumnBy default, all columns expand equally (treated as if all of them had an expand ratio of 1). Once at least one column gets a defined expand ratio, the implicit expand ratio is removed, and only the defined expand ratios are taken into account.
If a column has a defined width (Grid.Column.setWidth(double)), it
overrides this method's effects.
Example: A grid with three columns, with expand ratios 0, 1 and 2, respectively. The column with a ratio of 0 is exactly as wide as its contents requires. The column with a ratio of 1 is as wide as it needs, plus a third of any excess space, bceause we have 3 parts total, and this column reservs only one of those. The column with a ratio of 2, is as wide as it needs to be, plus two thirds of the excess width.
This action is done "finally", once the current execution loop returns. This is done to reduce overhead of unintentionally always recalculate all columns, when modifying several columns at once.
setExpandRatio in class Grid.Column<Boolean,T>ratio - the expand ratio of this column. 0 to not have it
expand at all. A negative number to clear the expand
value.public int getExpandRatio()
Grid.ColumngetExpandRatio in class Grid.Column<Boolean,T>Grid.Column.setExpandRatio(int)public Grid.Column<Boolean,T> setMaximumWidth(double pixels)
Grid.ColumnThis defines the maximum allowed pixel width of the column when it is set to expand.
This action is done "finally", once the current execution loop returns. This is done to reduce overhead of unintentionally always recalculate all columns, when modifying several columns at once.
setMaximumWidth in class Grid.Column<Boolean,T>pixels - the maximum widthpublic double getMaximumWidth()
Grid.ColumngetMaximumWidth in class Grid.Column<Boolean,T>Grid.Column.setMaximumWidth(double)public Grid.Column<Boolean,T> setMinimumWidth(double pixels)
Grid.ColumnThis defines the minimum guaranteed pixel width of the column when it is set to expand.
This action is done "finally", once the current execution loop returns. This is done to reduce overhead of unintentionally always recalculate all columns, when modifying several columns at once.
setMinimumWidth in class Grid.Column<Boolean,T>pixels - the minimum widthpublic double getMinimumWidth()
Grid.ColumngetMinimumWidth in class Grid.Column<Boolean,T>Grid.Column.setMinimumWidth(double)public Grid.Column<Boolean,T> setEditable(boolean editable)
Grid.ColumnsetEditable in class Grid.Column<Boolean,T>editable - true to set this column editable, false
otherwiseGrid.editRow(int),
Grid.isEditorActive()public void onEnabled(boolean enabled)
GridEnabledHandleronEnabled in interface GridEnabledHandlerenabled - true if status changes from disabled to enabled, otherwise
false.public void setSelectAllCheckBoxVisible(boolean selectAllCheckBoxVisible)
selectAllCheckBoxVisible - true for visible, false for notpublic boolean isSelectAllCheckBoxVisible()
true for visible, false for notpublic Optional<com.google.gwt.user.client.ui.CheckBox> getSelectAllCheckBox()
SelectionModelWithSelectionColumn.
To handle select all, add SelectAllHandler the grid with
Grid.addSelectAllHandler(SelectAllHandler).protected void doSetSelectAllCheckBoxVisible()
public void onSelectionAllowed(GridSelectionAllowedEvent event)
GridSelectionAllowedHandleronSelectionAllowed in interface GridSelectionAllowedHandlerevent - the GridSelectionAllowedEvent that was firedCopyright © 2021 Vaadin Ltd. All rights reserved.