Example usage for com.vaadin.v7.client.widget.grid.selection SelectionModel.Multi isSelected

List of usage examples for com.vaadin.v7.client.widget.grid.selection SelectionModel.Multi isSelected

Introduction

In this page you can find the example usage for com.vaadin.v7.client.widget.grid.selection SelectionModel.Multi isSelected.

Prototype

public boolean isSelected(T row);

Source Link

Document

Return true if the provided row is considered selected under the implementing selection model.

Usage

From source file:com.haulmont.cuba.web.widgets.client.grid.selection.MultiSelectionBodyClickHandler.java

License:Apache License

protected void handleCtrlClick(SelectionModel.Multi<JsonObject> model, CellReference<JsonObject> cell,
        GridClickEvent event) {//from   w  ww  .j  a v a 2s  .  c om
    NativeEvent e = event.getNativeEvent();
    JsonObject row = cell.getRow();
    if (!e.getCtrlKey() && !e.getMetaKey()) {
        model.deselectAll();
    }

    if (model.isSelected(row)) {
        model.deselect(row);
    } else {
        model.select(row);
    }
}