Examples of doCommand()


Examples of org.eclipse.nebula.widgets.nattable.layer.ILayer.doCommand()

    protected void setNewMinLength(ILayerCell cell, int contentHeight) {
        int cellLength = cell.getBounds().height;
        if (cellLength < contentHeight) {

            ILayer layer = cell.getLayer();
            layer.doCommand(new RowResizeCommand(layer, cell.getRowPosition(),
                    contentHeight));
        }
    }

    @Override
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayer.doCommand()

            int contentHeight = imageBounds.height;
            if (this.calculateByHeight && (contentHeight > bounds.height)) {
                int contentToCellDiff = (cell.getBounds().height - bounds.height);
                ILayer layer = cell.getLayer();
                layer.doCommand(new RowResizeCommand(
                        layer,
                        cell.getRowPosition(),
                        contentHeight + contentToCellDiff));
            }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayer.doCommand()

            int contentWidth = imageBounds.width;
            if (this.calculateByWidth && (contentWidth > bounds.width)) {
                int contentToCellDiff = (cell.getBounds().width - bounds.width);
                ILayer layer = cell.getLayer();
                layer.doCommand(new ColumnResizeCommand(
                        layer,
                        cell.getColumnPosition(),
                        contentWidth + contentToCellDiff));
            }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack.doCommand()

    public void autoResizeOneColumn() throws Exception {
        GridLayer gridLayer = new DummyGridLayerStack();
        setClientAreaProvider(gridLayer);

        // Resize column
        gridLayer.doCommand(new ColumnResizeCommand(gridLayer, 2, 10));
        assertEquals(10, gridLayer.getColumnWidthByPosition(2));

        // Auto resize the one column
        InitializeAutoResizeColumnsCommand command = new InitializeAutoResizeColumnsCommand(
                gridLayer, 2, configRegistry, gcFactory);
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer.doCommand()

    @Test
    public void commandPassedOnToParentIfCannotBeHandled() throws Exception {
        ColumnReorderLayer reorderLayer = new ColumnReorderLayer(
                new DataLayerFixture());
        assertFalse(reorderLayer.doCommand(new LayerCommandFixture()));
    }

    @Test
    public void canHandleColumnReorderCommand() throws Exception {
        ColumnReorderLayer reorderLayer = new ColumnReorderLayer(
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer.doCommand()

    public void canHandleColumnReorderCommand() throws Exception {
        ColumnReorderLayer reorderLayer = new ColumnReorderLayer(
                new DataLayerFixture());
        ColumnReorderCommand reorderCommand = new ColumnReorderCommand(
                reorderLayer, 0, 2);
        assertTrue(reorderLayer.doCommand(reorderCommand));
    }

    @Test
    public void getWidthForReorderedColumns() throws Exception {
        underlyingLayer = new DataLayerFixture();
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer.doCommand()

        ColumnReorderLayer reorderLayerFixture = new ColumnReorderLayerFixture(
                dataLayer);

        MultiColumnResizeCommand resizeCommand = new MultiColumnResizeCommand(
                reorderLayerFixture, new int[] { 1, 2 }, new int[] { 100, 150 });
        reorderLayerFixture.doCommand(resizeCommand);

        // As the Commands goes down the stack - positions might get converted
        // to entirely different values.
        Assert.assertEquals(-1, resizeCommand.getCommonColumnWidth());
        Assert.assertEquals(-1, resizeCommand.getColumnWidth(5));
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.doCommand()

        assertEquals(10, gridLayer.getColumnWidthByPosition(2));

        // Fully select columns 1, 2
        SelectionLayer selectionLayer = ((DefaultBodyLayerStack) gridLayer
                .getBodyLayer()).getSelectionLayer();
        selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 0, 0,
                false, false));
        selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 1, 0,
                true, false));
        assertEquals(2, selectionLayer.getFullySelectedColumnPositions().length);
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture.doCommand()

        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

Examples of org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture.doCommand()

        natTableFixture.addLayerListener(listenerFixture);

        assertEquals(10, natTableFixture.getColumnCount());

        // hide some columns
        natTableFixture.doCommand(new MultiColumnHideCommand(natTableFixture,
                new int[] { 2, 5, 8 }));

        assertEquals(7, natTableFixture.getColumnCount());

        List<Integer> columnToMove = Arrays.asList(3, 4, 6, 7);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.