Package org.eclipse.nebula.widgets.nattable.reorder.command

Examples of org.eclipse.nebula.widgets.nattable.reorder.command.RowReorderCommand


    @Test
    public void canHandleRowReorderCommand() throws Exception {
        RowReorderLayer reorderLayer = new RowReorderLayer(
                new DataLayerFixture());
        RowReorderCommand reorderCommand = new RowReorderCommand(reorderLayer,
                0, 2);
        assertTrue(reorderLayer.doCommand(reorderCommand));
    }
View Full Code Here


        assertEquals(1, natTableFixture.getColumnIndexByPosition(1));

        // Reorder row 1 --> 5 (grid coordinates)
        // 0, 1, 2, 3, 4, 5,.. --> 1, 2, 3, 0, 4, 5,..
        assertEquals(0, natTableFixture.getRowIndexByPosition(1));
        natTableFixture.doCommand(new RowReorderCommand(natTableFixture, 1, 5));
        assertEquals(1, natTableFixture.getRowIndexByPosition(1));

        // Hide column with index 3 (grid coordinates)
        assertEquals(3, natTableFixture.getColumnIndexByPosition(3));
        natTableFixture.doCommand(new ColumnHideCommand(natTableFixture, 3));
View Full Code Here

    @Test
    public void testReorder() {
        testInit();

        // reorder to inverse order: 4 3 2 1 0
        natTable.doCommand(new RowReorderCommand(viewportLayer, 4, 0));
        natTable.doCommand(new RowReorderCommand(viewportLayer, 4, 1));
        natTable.doCommand(new RowReorderCommand(viewportLayer, 4, 2));
        natTable.doCommand(new RowReorderCommand(viewportLayer, 4, 3));

        assertEquals(4, viewportLayer.getRowIndexByPosition(0));
        assertEquals(3, viewportLayer.getRowIndexByPosition(1));
        assertEquals(2, viewportLayer.getRowIndexByPosition(2));
        assertEquals(1, viewportLayer.getRowIndexByPosition(3));
View Full Code Here

    @Test
    public void testReorderHide() {
        testInit();

        // reorder to inverse order: 4 3 2 1 0
        natTable.doCommand(new RowReorderCommand(viewportLayer, 4, 0));
        natTable.doCommand(new RowReorderCommand(viewportLayer, 4, 1));
        natTable.doCommand(new RowReorderCommand(viewportLayer, 4, 2));
        natTable.doCommand(new RowReorderCommand(viewportLayer, 4, 3));

        // hide row at position 2: 0 1 3 4
        natTable.doCommand(new RowHideCommand(viewportLayer, 2));

        assertEquals(4, viewportLayer.getRowCount());
View Full Code Here

        // hide row at position 2: 0 1 3 4
        natTable.doCommand(new RowHideCommand(viewportLayer, 2));

        // reorder to inverse order: 4 3 1 0
        natTable.doCommand(new RowReorderCommand(viewportLayer, 3, 0));
        natTable.doCommand(new RowReorderCommand(viewportLayer, 3, 1));
        natTable.doCommand(new RowReorderCommand(viewportLayer, 3, 2));

        assertEquals(4, viewportLayer.getRowCount());

        assertEquals(4, viewportLayer.getRowIndexByPosition(0));
        assertEquals(3, viewportLayer.getRowIndexByPosition(1));
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.reorder.command.RowReorderCommand

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.