Package com.vaadin.flow.component.grid
Class GridSelectionColumn
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.GridSelectionColumn
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,HasStyle,Serializable
@Tag("vaadin-grid-flow-selection-column")
@JsModule("./vaadin-grid/vaadin-grid-flow-selection-column.ts")
public class GridSelectionColumn
extends Component
Server side implementation for the flow specific grid selection column.
- Since:
- 1.0
- Author:
- Vaadin Ltd.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGridSelectionColumn(SerializableRunnable selectAllCallback, SerializableRunnable deselectAllCallback) Constructs a new grid selection column configured to use the given callbacks whenever the select all checkbox is toggled on the client side. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets whether grid drag select is enabled or not.booleanisFrozen()Gets the this column's frozen state.booleanGets whether a click on a row toggles the selection of the row's item.voidsetDragSelect(boolean dragSelect) Iftrue, grid rows can be selected or deselected by dragging the mouse cursor over grid's selection column.voidsetFrozen(boolean frozen) Sets this column's frozen state.voidsetSelectAllCheckboxIndeterminateState(boolean indeterminate) Sets the indeterminate state of the select all checkbox on the client.voidsetSelectAllCheckboxState(boolean selectAll) Sets the checked state of the select all checkbox on the client.voidsetSelectAllCheckBoxVisibility(boolean visible) Sets the visibility of the select all checkbox on the client.voidsetSelectOnItemClick(boolean selectOnItemClick) Sets whether a click on a row toggles the selection of the row's item.Methods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, getUIOrThrow, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods 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, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
GridSelectionColumn
public GridSelectionColumn(SerializableRunnable selectAllCallback, SerializableRunnable deselectAllCallback) Constructs a new grid selection column configured to use the given callbacks whenever the select all checkbox is toggled on the client side.- Parameters:
selectAllCallback- the runnable to run when the select all checkbox has been checkeddeselectAllCallback- the runnable to run when the select all checkbox has been unchecked
-
-
Method Details
-
setSelectAllCheckboxState
public void setSelectAllCheckboxState(boolean selectAll) Sets the checked state of the select all checkbox on the client.- Parameters:
selectAll- the new state of the select all checkbox
-
setSelectAllCheckboxIndeterminateState
public void setSelectAllCheckboxIndeterminateState(boolean indeterminate) Sets the indeterminate state of the select all checkbox on the client.- Parameters:
indeterminate- the new indeterminate state of the select all checkbox- Since:
- 23.0.4
-
setSelectAllCheckBoxVisibility
public void setSelectAllCheckBoxVisibility(boolean visible) Sets the visibility of the select all checkbox on the client.- Parameters:
visible- whether to display the select all checkbox or hide it
-
setFrozen
public void setFrozen(boolean frozen) Sets this column's frozen state.- Parameters:
frozen- whether to freeze or unfreeze this column
-
isFrozen
Gets the this column's frozen state.- Returns:
- whether this column is frozen
-
setDragSelect
public void setDragSelect(boolean dragSelect) Iftrue, grid rows can be selected or deselected by dragging the mouse cursor over grid's selection column.- Parameters:
dragSelect-trueto enable drag select feature,falsefor disabling it- Since:
- 24.2
-
isDragSelect
Gets whether grid drag select is enabled or not.- Returns:
trueif drag select feature is enabled,falseotherwise- Since:
- 24.2
-
isSelectOnItemClick
public boolean isSelectOnItemClick()Gets whether a click on a row toggles the selection of the row's item.- Returns:
trueif a click on a row toggles the selection,falseotherwise- Since:
- 25.4
- See Also:
-
setSelectOnItemClick
public void setSelectOnItemClick(boolean selectOnItemClick) Sets whether a click on a row toggles the selection of the row's item. The default value isfalse.- Parameters:
selectOnItemClick-trueto toggle the selection on a click on a row,falseto not change the selection on a click on a row- Since:
- 25.4
- See Also:
-