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

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


    public void run(NatTable natTable, MouseEvent event) {
        Point clickPoint = new Point(event.x, event.y);
        int column = CellEdgeDetectUtil.getColumnPositionToResize(natTable,
                clickPoint);

        InitializeAutoResizeColumnsCommand command = new InitializeAutoResizeColumnsCommand(
                natTable, column, natTable.getConfigRegistry(), new GCFactory(
                        natTable));
        natTable.doCommand(command);
    }
View Full Code Here


                autoResizeColumns.addSelectionListener(new SelectionAdapter() {
                    @Override
                    public void widgetSelected(SelectionEvent event) {
                        int columnPosition = getNatEventData(event)
                                .getColumnPosition();
                        natTable.doCommand(new InitializeAutoResizeColumnsCommand(
                                natTable, columnPosition, natTable
                                        .getConfigRegistry(), new GCFactory(
                                        natTable)));
                    }
                });
View Full Code Here

                autoResizeColumns.addSelectionListener(new SelectionAdapter() {
                    @Override
                    public void widgetSelected(SelectionEvent event) {
                        int columnPosition = getNatEventData(event)
                                .getColumnPosition();
                        natTable.doCommand(new InitializeAutoResizeColumnsCommand(
                                natTable, columnPosition, natTable
                                        .getConfigRegistry(), new GCFactory(
                                        natTable)));
                    }
                });
View Full Code Here

        // 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);
        gridLayer.doCommand(command);
        // Note: the actual resized width is platform specific (font
        // dependency),
        // 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());

        // Resize all selected columns
        command = new InitializeAutoResizeColumnsCommand(gridLayer, 1,
                configRegistry, gcFactory);
        gridLayer.doCommand(command);

        for (int columnPosition = 1; columnPosition <= 20; columnPosition++) {
            assertTrue(
View Full Code Here

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

        // Auto resize column 5
        InitializeAutoResizeColumnsCommand command = new InitializeAutoResizeColumnsCommand(
                gridLayer, 5, configRegistry, gcFactory);
        gridLayer.doCommand(command);

        // Columns 1 and 2 should not be resized
        assertEquals(10, gridLayer.getColumnWidthByPosition(1));
View Full Code Here

TOP

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

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.