Example usage for com.google.gwt.gen2.table.event.client RowSelectionEvent getDeselectedRows

List of usage examples for com.google.gwt.gen2.table.event.client RowSelectionEvent getDeselectedRows

Introduction

In this page you can find the example usage for com.google.gwt.gen2.table.event.client RowSelectionEvent getDeselectedRows.

Prototype

public Set<Row> getDeselectedRows() 

Source Link

Usage

From source file:org.apache.hupa.widgets.ui.RefetchPagingScrollTable.java

License:Apache License

public RefetchPagingScrollTable(MutableTableModel<RowType> tableModel, FixedWidthGrid dataTable,
        FixedWidthFlexTable headerTable, TableDefinition<RowType> tableDefinition) {
    super(tableModel, dataTable, headerTable, tableDefinition);

    getDataTable().addRowSelectionHandler(new RowSelectionHandler() {

        public void onRowSelection(RowSelectionEvent event) {
            Iterator<Row> rowIndexIt = event.getSelectedRows().iterator();
            while (rowIndexIt.hasNext()) {
                RowType row = getRowValue(rowIndexIt.next().getRowIndex());
                if (selectedRows.contains(row) == false) {
                    selectedRows.add(row);
                }/*from w  w w.  ja  v a 2  s. c om*/
            }

            Iterator<Row> rowDeselectIndexIt = event.getDeselectedRows().iterator();
            while (rowDeselectIndexIt.hasNext()) {
                RowType row = getRowValue(rowDeselectIndexIt.next().getRowIndex());
                selectedRows.remove(row);
            }
        }

    });
}