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

Examples of org.eclipse.nebula.widgets.nattable.resize.command.RowResizeCommand


    private void updateRowHeight(ILayer natLayer, MouseEvent e) {
        int dragHeight = e.y - this.startY;
        int newRowHeight = this.originalRowHeight + dragHeight;
        if (newRowHeight < getRowHeightMinimum())
            newRowHeight = getRowHeightMinimum();
        natLayer.doCommand(new RowResizeCommand(natLayer,
                this.gridRowPositionToResize, newRowHeight));
    }
View Full Code Here


    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));
        }
    }
View Full Code Here

            int contentHeight = (fontHeight * numberOfNewLines) + (spacing * 2);
            int contentToCellDiff = (cell.getBounds().height - rectangle.height);

            if (performRowResize(contentHeight, rectangle)) {
                ILayer layer = cell.getLayer();
                layer.doCommand(new RowResizeCommand(layer, cell
                        .getRowPosition(), contentHeight + contentToCellDiff));
            }

            if (numberOfNewLines == 1) {
                int contentWidth = Math.min(getLengthFromCache(gc, text),
View Full Code Here

                // perform resize if necessary
                int neededHeight = subGridY - bounds.y;
                if (isCalculateParentCellHeight()
                        && (neededHeight > bounds.height)) {
                    ILayer layer = cell.getLayer();
                    layer.doCommand(new RowResizeCommand(layer, cell
                            .getRowPosition(), neededHeight));
                }
            }
        } else {
            this.getInternalPainter().paintCell(cell, gc, bounds,
View Full Code Here

    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));
        }
    }
View Full Code Here

            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

    public void testHandleRowResizeCommand() {
        Assert.assertEquals(20, dataLayer.getRowHeightByPosition(3));

        int rowPosition = 3;
        int newHeight = 50;
        RowResizeCommand rowResizeCommand = new RowResizeCommand(dataLayer,
                rowPosition, newHeight);

        dataLayer.doCommand(rowResizeCommand);

        Assert.assertEquals(50, dataLayer.getRowHeightByPosition(3));
View Full Code Here

    }

    @Override
    public boolean doCommand(ILayerCommand command) {
        if (command instanceof RowResizeCommand) {
            RowResizeCommand rowResizeCommand = (RowResizeCommand) command;
            if (isSummaryRowPosition(rowResizeCommand.getRowPosition())) {
                this.summaryRowHeight = rowResizeCommand.getNewHeight();
                return true;
            }
        } else if (command instanceof CalculateSummaryRowValuesCommand) {
            for (int i = 0; i < getColumnCount(); i++) {
                calculateNewSummaryValue(i, false);
View Full Code Here

        assertEquals(4, natTable.getRowIndexByPosition(4));
    }

    @Test
    public void getRowHeightByPositionForSummaryRow() throws Exception {
        natTable.doCommand(new RowResizeCommand(natTable, 4, 100));
        assertEquals(100, natTable.getRowHeightByPosition(4));
    }
View Full Code Here

        assertEquals(200, natTableFixture.getColumnWidthByPosition(2));

        // Resize row 2 to 100px
        assertEquals(20, natTableFixture.getRowHeightByPosition(2));
        natTableFixture
                .doCommand(new RowResizeCommand(natTableFixture, 2, 100));
        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));
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.resize.command.RowResizeCommand

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.