Example usage for com.google.gwt.view.client CellPreviewEvent isSelectionHandled

List of usage examples for com.google.gwt.view.client CellPreviewEvent isSelectionHandled

Introduction

In this page you can find the example usage for com.google.gwt.view.client CellPreviewEvent isSelectionHandled.

Prototype

boolean isSelectionHandled

To view the source code for com.google.gwt.view.client CellPreviewEvent isSelectionHandled.

Click Source Link

Usage

From source file:org.gss_project.gss.web.client.GSSSelectionEventManager.java

License:Open Source License

public void onCellPreview(CellPreviewEvent<T> event) {
    // Early exit if selection is already handled or we are editing.
    if (event.isCellEditing() || event.isSelectionHandled()) {
        return;/*  www .j  a v  a  2  s  . c o  m*/
    }

    // 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);
    }
}