com.github.fluorumlabs.disconnect.vaadin.GridSelectionColumn Maven / Gradle / Ivy
Show all versions of disconnect-vaadin Show documentation
package com.github.fluorumlabs.disconnect.vaadin;
import com.github.fluorumlabs.disconnect.core.annotations.WebComponent;
import com.github.fluorumlabs.disconnect.polymer.types.BooleanPropertyChangeEvent;
import com.github.fluorumlabs.disconnect.vaadin.elements.GridSelectionColumnElement;
import com.github.fluorumlabs.disconnect.zero.component.AbstractComponent;
import com.github.fluorumlabs.disconnect.zero.component.Component;
import com.github.fluorumlabs.disconnect.zero.component.HasComponents;
import com.github.fluorumlabs.disconnect.zero.component.HasStyle;
import com.github.fluorumlabs.disconnect.zero.observable.ObservableEvent;
import js.lang.Any;
import javax.annotation.Nullable;
/**
* <vaadin-grid-selection-column>
is a helper element for the <vaadin-grid>
* that provides default templates and functionality for item selection.
*
* Example:
* <vaadin-grid items="[[items]]">
* <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>
*
* <vaadin-grid-column>
* ...
*
* By default the selection column displays <vaadin-checkbox>
elements in the
* column cells. The checkboxes in the body rows toggle selection of the corresponding row items.
*
* When the grid data is provided as an array of items
,
* the column header gets an additional checkbox that can be used for toggling
* selection for all the items at once.
*
* The default content can also be overridden
*/
@WebComponent
public class GridSelectionColumn- extends AbstractComponent
>
implements HasStyle, GridSelectionColumn- >, HasComponents
, GridSelectionColumn- , Component>> {
public GridSelectionColumn() {
super(GridSelectionColumnElement.TAGNAME());
}
/**
* Width of the cells for this column.
*/
@Nullable
public String width() {
return getNode().getWidth();
}
/**
* Width of the cells for this column.
*/
public GridSelectionColumn
- width(String width) {
getNode().setWidth(width);
return this;
}
/**
* Flex grow ratio for the cell widths. When set to 0, cell width is fixed.
*/
public double flexGrow() {
return getNode().getFlexGrow();
}
/**
* Flex grow ratio for the cell widths. When set to 0, cell width is fixed.
*/
public GridSelectionColumn
- flexGrow(double flexGrow) {
getNode().setFlexGrow(flexGrow);
return this;
}
/**
* When true, all the items are selected.
*/
public boolean selectAll() {
return getNode().isSelectAll();
}
/**
* When true, all the items are selected.
*/
public GridSelectionColumn
- selectAll(boolean selectAll) {
getNode().setSelectAll(selectAll);
return this;
}
/**
* When true, the active gets automatically selected.
*/
public boolean autoSelect() {
return getNode().isAutoSelect();
}
/**
* When true, the active gets automatically selected.
*/
public GridSelectionColumn
- autoSelect(boolean autoSelect) {
getNode().setAutoSelect(autoSelect);
return this;
}
/**
* Fired when the
selectAll
property changes.
*/
public ObservableEvent selectAllChangedEvent() {
return createEvent("select-all-changed");
}
}