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

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


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


                    if (!columnGroupMoved && !multipleColumnsMoved) {
                        int fromPosition = fromPositions.get(i).get(0)
                                .intValue();
                        int toPosition = adjustToPosition(direction,
                                toPositions.get(i).intValue());
                        command = new ColumnReorderCommand(columnHideShowLayer,
                                fromPosition, toPosition);
                    } else if (columnGroupMoved && multipleColumnsMoved) {
                        command = new ReorderColumnsAndGroupsCommand(
                                columnHideShowLayer, fromPositions.get(i),
                                adjustToPosition(direction, toPositions.get(i)));
View Full Code Here

            ILayerCommand command = null;
            if (!multipleColumnsMoved) {
                int fromPosition = fromPositions.get(i).get(0).intValue();
                int toPosition = toPositions.get(i);
                command = new ColumnReorderCommand(columnHideShowLayer,
                        fromPosition, toPosition);
            } else if (multipleColumnsMoved) {
                command = new MultiColumnReorderCommand(columnHideShowLayer,
                        fromPositions.get(i), toPositions.get(i));
            }
View Full Code Here

    @Test
    public void testReorderColumnCommand() {
        int fromColumnPosition = 4;
        int toColumnPosition = 1;
        ILayerCommand reorderColumnCommand = new ColumnReorderCommand(
                columnReorderLayer, fromColumnPosition, toColumnPosition);

        columnReorderLayer.doCommand(reorderColumnCommand);

        Assert.assertEquals(0, columnReorderLayer.getColumnIndexByPosition(0));
View Full Code Here

                false, false));
        compositeFreezeLayer.doCommand(new FreezeSelectionCommand());

        // Move right edge out of frozen area
        Assert.assertEquals(2, freezeLayer.getColumnCount());
        compositeFreezeLayer.doCommand(new ColumnReorderCommand(
                compositeFreezeLayer, 1, 3));

        Assert.assertEquals(1, freezeLayer.getColumnCount());
    }
View Full Code Here

        String originalColumnHeader = natTableFixture.getDataValueByPosition(2,
                0).toString();
        assertEquals("Column 2", originalColumnHeader);

        natTableFixture.doCommand(new ColumnReorderCommand(natTableFixture, 1,
                5));

        originalColumnHeader = natTableFixture.getDataValueByPosition(2, 0)
                .toString();
        assertEquals("Column 3", originalColumnHeader);
View Full Code Here

        Assert.assertEquals(3, freezeLayer.getRowIndexByPosition(3));
    }

    @Test
    public void testReorderInInteriorColumn() {
        hideShowLayer.doCommand(new ColumnReorderCommand(hideShowLayer, 5, 2));

        Assert.assertEquals(4, freezeLayer.getColumnCount());
        Assert.assertEquals(1, freezeLayer.getColumnIndexByPosition(0));
        Assert.assertEquals(5, freezeLayer.getColumnIndexByPosition(1));
        Assert.assertEquals(2, freezeLayer.getColumnIndexByPosition(2));
View Full Code Here

        Assert.assertEquals(3, freezeLayer.getColumnIndexByPosition(3));
    }

    @Test
    public void testReorderingIntoTopLeftCoordinate() {
        hideShowLayer.doCommand(new ColumnReorderCommand(hideShowLayer, 5, 1));

        Assert.assertEquals(4, freezeLayer.getColumnCount());
        Assert.assertEquals(5, freezeLayer.getColumnIndexByPosition(0));
        Assert.assertEquals(1, freezeLayer.getColumnIndexByPosition(1));
        Assert.assertEquals(2, freezeLayer.getColumnIndexByPosition(2));
View Full Code Here

        Assert.assertEquals(3, freezeLayer.getColumnIndexByPosition(3));
    }

    @Test
    public void testReorderOutInteriorColumn() {
        hideShowLayer.doCommand(new ColumnReorderCommand(hideShowLayer, 2, 5));

        Assert.assertEquals(2, freezeLayer.getColumnCount());
        Assert.assertEquals(1, freezeLayer.getColumnIndexByPosition(0));
        Assert.assertEquals(3, freezeLayer.getColumnIndexByPosition(1));
    }
View Full Code Here

        Assert.assertEquals(3, freezeLayer.getColumnIndexByPosition(1));
    }

    @Test
    public void testReorderingRightBottomCornerOutOfFrozenArea() {
        hideShowLayer.doCommand(new ColumnReorderCommand(hideShowLayer, 3, 5));

        Assert.assertEquals(2, freezeLayer.getColumnCount());
        Assert.assertEquals(2,
                freezeLayer.getBottomRightPosition().columnPosition);
        Assert.assertEquals(1, freezeLayer.getColumnIndexByPosition(0));
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.