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

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

Introduction

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

Prototype

void deselectAll();

Source Link

Document

Deselects all currently selected items.

Usage

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

License:Apache License

protected void handleCtrlClick(SelectionModel.Multi<JsonObject> model, CellReference<JsonObject> cell,
        GridClickEvent event) {//from www  .ja  v  a2 s.  c  o  m
    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);
    }
}