public final class Grid.SelectionColumn extends Grid.Column<Boolean,T> implements GridEnabledHandler
| Modifier and Type | Method and Description |
|---|---|
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.
|
Boolean |
getValue(T row)
Returns the data that should be rendered into the cell.
|
void |
onEnabled(boolean enabled)
Called when Grid is enabled or disabled.
|
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.
|
void |
setEnabled(boolean enabled)
Sets whether the selection column is enabled.
|
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.
|
Grid.Column<Boolean,T> |
setWidth(double pixels)
Sets the pixel width of the column.
|
clearExpandRatio, getHeaderCaption, getHidingToggleCaption, getRenderer, getWidth, getWidthActual, isEditable, isHidable, isHidden, isResizable, isSortable, setHeaderCaption, setHidable, setHidden, setHidingToggleCaption, 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>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 setEnabled(boolean enabled)
enabled - true to enable the column, false
to disable it.public void onEnabled(boolean enabled)
GridEnabledHandleronEnabled in interface GridEnabledHandlerenabled - true if status changes from disabled to enabled, otherwise
false.Copyright © 2016 Vaadin Ltd. All rights reserved.