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

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


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

        SelectionHeader header = table.new SelectionHeader(table, selectionModel);
        assertTrue(header.getCell() instanceof CheckboxCell);
        assertSame(table, header.table);
        assertSame(selectionModel, header.selectionModel);
        assertEquals(SelectionType.MULTI, header.selectionModel.getSelectionType());
        assertFalse(header.getValue());
        assertTrue(((CheckboxCell) header.getCell()).isEnabled());

        header.setSelectionType(SelectionType.SINGLE);
        assertEquals(SelectionType.SINGLE, header.selectionModel.getSelectionType());
        assertFalse(((CheckboxCell) header.getCell()).isEnabled());

        header.setSelectionType(SelectionType.MULTI);
        assertEquals(SelectionType.MULTI, header.selectionModel.getSelectionType());
        assertTrue(((CheckboxCell) header.getCell()).isEnabled());
    }
View Full Code Here

TOP

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

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.