List of usage examples for com.vaadin.client.widget.grid CellReference getRowIndex
public int getRowIndex()
From source file:com.haulmont.cuba.web.toolkit.ui.client.grid.selection.MultiSelectionBodyClickHandler.java
License:Apache License
@Override public void onClick(GridClickEvent event) { SelectionModel<JsonObject> selectionModel = grid.getSelectionModel(); if (!(selectionModel instanceof SelectionModel.Multi)) { return;// ww w . j ava2s .co m } SelectionModel.Multi<JsonObject> model = (SelectionModel.Multi<JsonObject>) selectionModel; CellReference<JsonObject> cell = grid.getEventCell(); if (!event.isShiftKeyDown() || previous < 0) { handleCtrlClick(model, cell, event); previous = cell.getRowIndex(); return; } // This works on the premise that grid fires the data available event to // any newly added handlers. boolean ctrlOrMeta = event.isControlKeyDown() || event.isMetaKeyDown(); handler = grid.addDataAvailableHandler(new ShiftSelector(cell, model, ctrlOrMeta)); }