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

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


            } else {
                fromColumnPositionsWithGroupColumns.add(fromColumnPosition);
            }
        }

        return underlyingLayer.doCommand(new MultiColumnReorderCommand(
                columnGroupReorderLayer, fromColumnPositionsWithGroupColumns,
                command.getToColumnPosition(), command.isReorderToLeftEdge()));
    }
View Full Code Here


                selectedPositions.add(columnIndexesToPositionsMap
                        .get(columnIndex));
            }
            model.addColumnsIndexesToGroup(columnGroupName,
                    fullySelectedColumns);
            selectionLayer.doCommand(new MultiColumnReorderCommand(
                    selectionLayer, selectedPositions, selectedPositions.get(0)
                            .intValue()));
            selectionLayer.clear();
        } catch (Throwable t) {}
        contextLayer.fireLayerEvent(new GroupColumnsEvent(contextLayer));
View Full Code Here

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

        // Move to outside the visible range
        List<Integer> columnToMove = Arrays.asList(1, 2, 3);
        int destinationPosition = 10;
        natTableFixture.doCommand(new MultiColumnReorderCommand(
                natTableFixture, columnToMove, destinationPosition));

        // Ensure that the event propagates to the top
        assertEquals(1, listenerFixture.getEventsCount());
        assertNotNull(listenerFixture
View Full Code Here

        assertEquals(7, natTableFixture.getColumnCount());

        List<Integer> columnToMove = Arrays.asList(3, 4, 6, 7);
        int destinationPosition = 0;
        natTableFixture.doCommand(new MultiColumnReorderCommand(underlyingLayer
                .getColumnReorderLayer(), columnToMove, destinationPosition));

        // verify the event
        ColumnReorderEvent event = (ColumnReorderEvent) listenerFixture
                .getReceivedEvent(ColumnReorderEvent.class);
View Full Code Here

                    } else if (columnGroupMoved && multipleColumnsMoved) {
                        command = new ReorderColumnsAndGroupsCommand(
                                columnHideShowLayer, fromPositions.get(i),
                                adjustToPosition(direction, toPositions.get(i)));
                    } else if (!columnGroupMoved && multipleColumnsMoved) {
                        command = new MultiColumnReorderCommand(
                                columnHideShowLayer, fromPositions.get(i),
                                adjustToPosition(direction, toPositions.get(i)));
                    } else if (columnGroupMoved && !multipleColumnsMoved) {
                        command = new ReorderColumnGroupCommand(
                                columnHideShowLayer, fromPositions.get(i)
View Full Code Here

                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));
            }
            columnHideShowLayer.doCommand(command);
        }
View Full Code Here

            int toColumnPosition) {
        int fromColumnIndex = underlyingLayer
                .getColumnIndexByPosition(fromColumnPosition);

        List<Integer> fromColumnPositions = getColumnGroupPositions(fromColumnIndex);
        return underlyingLayer.doCommand(new MultiColumnReorderCommand(this,
                fromColumnPositions, toColumnPosition));
    }
View Full Code Here

    }

    @Test
    public void shouldAddToAGroupWhileReorderingMultipleColumns()
            throws Exception {
        MultiColumnReorderCommand reorderCommand = new MultiColumnReorderCommand(
                layer, Arrays.asList(5, 6), 11);
        layer.doCommand(reorderCommand);

        assertEquals(5, getColumnIndexesInGroup(11).size());
        assertTrue(getColumnIndexesInGroup(11).contains(Integer.valueOf(10)));
View Full Code Here

    }

    @Test
    public void shouldRemoveFromAGroupWhileReorderingMultipleColumns()
            throws Exception {
        MultiColumnReorderCommand reorderCommand = new MultiColumnReorderCommand(
                layer, Arrays.asList(10, 11), 5);
        layer.doCommand(reorderCommand);

        assertEquals(1, getColumnIndexesInGroup(12).size());
        assertTrue(getColumnIndexesInGroup(12).contains(Integer.valueOf(12)));
View Full Code Here

    }

    @Test
    public void reorderMultipleColums() throws Exception {
        // One of the 'from' column is already in the destination group
        MultiColumnReorderCommand reorderCommand = new MultiColumnReorderCommand(
                layer, Arrays.asList(9, 10), 11);
        layer.doCommand(reorderCommand);

        assertEquals(4, getColumnIndexesInGroup(12).size());
    }
View Full Code Here

TOP

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

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.