Package com.cedarsolutions.client.gwt.widget.table.DataTable

Examples of com.cedarsolutions.client.gwt.widget.table.DataTable.SelectionColumn


        DataTable<Whatever> table = new DataTable<Whatever>(100, "200px");
        KeyProvider keyProvider = new KeyProvider();
        SwitchableSelectionModel<Whatever> selectionModel = new SwitchableSelectionModel<Whatever>(keyProvider, SelectionType.MULTI);
        Whatever value = new Whatever();

        SelectionColumn column = table.new SelectionColumn(selectionModel);
        assertTrue(column.getCell() instanceof CheckboxCell);
        assertFalse(column.isSortable());
        assertSame(selectionModel, column.selectionModel);
        assertEquals(SelectionType.MULTI, column.selectionModel.getSelectionType());
        assertTrue(((CheckboxCell) column.getCell()).isEnabled());

        column.setSelectionType(SelectionType.SINGLE);
        assertEquals(SelectionType.SINGLE, column.selectionModel.getSelectionType());
        assertTrue(((CheckboxCell) column.getCell()).isEnabled());

        column.setSelectionType(SelectionType.MULTI);
        assertEquals(SelectionType.MULTI, column.selectionModel.getSelectionType());
        assertTrue(((CheckboxCell) column.getCell()).isEnabled());

        column.selectionModel.setSelected(value, true);
        assertTrue(column.getValue(value));

        column.selectionModel.setSelected(value, false);
        assertFalse(column.getValue(value));
    }
View Full Code Here

TOP

Related Classes of com.cedarsolutions.client.gwt.widget.table.DataTable.SelectionColumn

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.