public void onCellPreview(CellPreviewEvent<T> event) { // Early exit if selection is already handled or we are editing. if (event.isCellEditing() || event.isSelectionHandled()) { return; } // Early exit if we do not have a SelectionModel. HasData<T> display = event.getDisplay(); SelectionModel<? super T> selectionModel = display.getSelectionModel(); if (selectionModel == null) { return; } // Check for user defined actions. SelectAction action = (translator == null) ? SelectAction.DEFAULT : translator.translateSelectionEvent(event); // Handle the event based on the SelectionModel type. if (selectionModel instanceof MultiSelectionModel<?>) { // Add shift key support for MultiSelectionModel. handleMultiSelectionEvent(event, action, (MultiSelectionModel<? super T>) selectionModel); } else { // Use the standard handler. handleSelectionEvent(event, action, selectionModel); } }
public void onCellPreview(CellPreviewEvent<T> event) { // Early exit if selection is already handled or we are editing. if (event.isCellEditing() || event.isSelectionHandled()) { return; } // Early exit if we do not have a SelectionModel. HasData<T> display = event.getDisplay(); SelectionModel<? super T> selectionModel = display.getSelectionModel(); if (selectionModel == null) { return; } // Check for user defined actions. SelectAction action = (translator == null) ? SelectAction.DEFAULT : translator.translateSelectionEvent(event); // Handle the event based on the SelectionModel type. if (selectionModel instanceof MultiSelectionModel<?>) { // Add shift key support for MultiSelectionModel. handleMultiSelectionEvent(event, action, (MultiSelectionModel<? super T>) selectionModel); } else { // Use the standard handler. handleSelectionEvent(event, action, selectionModel); } }
public void onCellPreview(CellPreviewEvent<T> event) { // Early exit if selection is already handled or we are editing. if (event.isCellEditing() || event.isSelectionHandled()) { return; } // Early exit if we do not have a SelectionModel. HasData<T> display = event.getDisplay(); SelectionModel<? super T> selectionModel = display.getSelectionModel(); if (selectionModel == null) { return; } // Check for user defined actions. SelectAction action = (translator == null) ? SelectAction.DEFAULT : translator.translateSelectionEvent(event); // Handle the event based on the SelectionModel type. if (selectionModel instanceof MultiSelectionModel<?>) { // Add shift key support for MultiSelectionModel. handleMultiSelectionEvent(event, action, (MultiSelectionModel<? super T>) selectionModel); } else { // Use the standard handler. handleSelectionEvent(event, action, selectionModel); } }