Search in sources :

Example 11 with RowResizeCommand

use of org.eclipse.nebula.widgets.nattable.resize.command.RowResizeCommand in project nebula.widgets.nattable by eclipse.

the class RowResizeDragMode method updateRowHeight.

private void updateRowHeight(ILayer natLayer, MouseEvent e) {
    int dragHeight = e.y - this.startY;
    int newRowHeight = this.originalRowHeight + dragHeight;
    if (newRowHeight < getRowHeightMinimum()) {
        newRowHeight = getRowHeightMinimum();
    }
    // trigger the RowResizeCommand with downScaling enabled
    // as the user performed a drag operation the newRowHeight is the value
    // on the screen, which needs to be down scaled in the DataLayer
    natLayer.doCommand(new RowResizeCommand(natLayer, this.gridRowPositionToResize, newRowHeight, true));
}
Also used : RowResizeCommand(org.eclipse.nebula.widgets.nattable.resize.command.RowResizeCommand) Point(org.eclipse.swt.graphics.Point)

Aggregations

RowResizeCommand (org.eclipse.nebula.widgets.nattable.resize.command.RowResizeCommand)11 Rectangle (org.eclipse.swt.graphics.Rectangle)6 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)5 ColumnResizeCommand (org.eclipse.nebula.widgets.nattable.resize.command.ColumnResizeCommand)3 IStyle (org.eclipse.nebula.widgets.nattable.style.IStyle)3 Test (org.junit.Test)3 ClientAreaResizeCommand (org.eclipse.nebula.widgets.nattable.grid.command.ClientAreaResizeCommand)2 IClientAreaProvider (org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider)2 Shell (org.eclipse.swt.widgets.Shell)2 ColumnHideCommand (org.eclipse.nebula.widgets.nattable.hideshow.command.ColumnHideCommand)1 ILayerCell (org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell)1 ColumnReorderCommand (org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand)1 RowReorderCommand (org.eclipse.nebula.widgets.nattable.reorder.command.RowReorderCommand)1 Color (org.eclipse.swt.graphics.Color)1 Image (org.eclipse.swt.graphics.Image)1 Point (org.eclipse.swt.graphics.Point)1