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

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


    @Test
    public void shouldNotMoveColumnBetweenGroupsIfEitherGroupIsUnbreakable() {
        setGroupUnBreakable(3);

        ColumnReorderCommand command = new ColumnReorderCommand(layer, 3, 1);
        layer.doCommand(command);

        modelFixture.assertUnchanged();
    }
View Full Code Here


    @Test
    public void shouldLeaveModelUnchangedOnDragLeftWithinSameGroup() {
        modelFixture.assertTestGroup3IsUnchanged();

        // Drag right and swap positions in group
        ColumnReorderCommand command = new ColumnReorderCommand(layer, 11, 10);
        layer.doCommand(command);

        // The group remains unchanged - order not tracked
        modelFixture.assertTestGroup3IsUnchanged();
    }
View Full Code Here

    @Test
    public void shouldLeaveModelUnchangedOnDragRightWithinSameGroup() {
        modelFixture.assertTestGroup3IsUnchanged();

        // Drag right and swap positions in group
        ColumnReorderCommand command = new ColumnReorderCommand(layer, 10, 11);
        layer.doCommand(command);

        modelFixture.assertTestGroup3IsUnchanged();
    }
View Full Code Here

        layer.reorderColumnGroup(3, 13);

        assertEquals(3, reorderLayer.getColumnIndexByPosition(11));
        assertEquals(4, reorderLayer.getColumnIndexByPosition(12));

        layer.doCommand(new ColumnReorderCommand(layer, 16, 12));
        assertEquals(3, getColumnIndexesInGroup(3).size());
    }
View Full Code Here

    @Test
    public void adjacentColumnGroups() throws Exception {
        modelFixture.addColumnsIndexesToGroup("G4", 5, 6);

        // Drag between the two groups
        ColumnReorderCommand command = new ColumnReorderCommand(layer, 2, 4);
        layer.doCommand(command);

        assertEquals(3, getColumnIndexesInGroup(3).size());
        assertTrue(getColumnIndexesInGroup(3).contains(Integer.valueOf(2)));
        assertTrue(getColumnIndexesInGroup(3).contains(Integer.valueOf(4)));
View Full Code Here

    @Test
    public void shouldCreateColumnGroupAfterReordering() {
        // Reorder column to first position
        selectionLayer
                .doCommand(new ColumnReorderCommand(selectionLayer, 9, 0));
        // Select first column position
        selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 0, 0,
                false, false));

        final String columnGroupName = "Test Group";
View Full Code Here

        assertEquals(100, natTableFixture.getRowHeightByPosition(2));

        // Reorder column 1 --> 5 (grid coordinates)
        // 0, 1, 2, 3, 4, 5,.. --> 1, 2, 3, 0, 4, 5,..
        assertEquals(0, natTableFixture.getColumnIndexByPosition(1));
        natTableFixture.doCommand(new ColumnReorderCommand(natTableFixture, 1,
                5));
        assertEquals(1, natTableFixture.getColumnIndexByPosition(1));

        // Reorder row 1 --> 5 (grid coordinates)
        // 0, 1, 2, 3, 4, 5,.. --> 1, 2, 3, 0, 4, 5,..
View Full Code Here

        // hence we can't compare against a fixed value.
        int columnWidth = gridLayer.getColumnWidthByPosition(2);
        assertTrue(columnWidth > 10);

        // Reorder columns
        gridLayer.doCommand(new ColumnReorderCommand(gridLayer, 2, 1));
        assertEquals(columnWidth, gridLayer.getColumnWidthByPosition(1));

        // Select all columns
        gridLayer.doCommand(new SelectAllCommand());
View Full Code Here

TOP

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

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.