Search in sources :

Example 6 with InitializeAutoResizeColumnsCommand

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

the class AutoResizeColumnAction method run.

@Override
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);
}
Also used : GCFactory(org.eclipse.nebula.widgets.nattable.util.GCFactory) InitializeAutoResizeColumnsCommand(org.eclipse.nebula.widgets.nattable.resize.command.InitializeAutoResizeColumnsCommand) Point(org.eclipse.swt.graphics.Point) Point(org.eclipse.swt.graphics.Point)

Aggregations

InitializeAutoResizeColumnsCommand (org.eclipse.nebula.widgets.nattable.resize.command.InitializeAutoResizeColumnsCommand)6 GCFactory (org.eclipse.nebula.widgets.nattable.util.GCFactory)3 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)2 DefaultGridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer)2 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)2 ColumnResizeCommand (org.eclipse.nebula.widgets.nattable.resize.command.ColumnResizeCommand)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 Menu (org.eclipse.swt.widgets.Menu)2 MenuItem (org.eclipse.swt.widgets.MenuItem)2 Test (org.junit.Test)2 DefaultBodyLayerStack (org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack)1 DummyGridLayerStack (org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack)1 ColumnReorderCommand (org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand)1 AutoResizeColumnsCommand (org.eclipse.nebula.widgets.nattable.resize.command.AutoResizeColumnsCommand)1 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)1 SelectAllCommand (org.eclipse.nebula.widgets.nattable.selection.command.SelectAllCommand)1 SelectColumnCommand (org.eclipse.nebula.widgets.nattable.selection.command.SelectColumnCommand)1 Point (org.eclipse.swt.graphics.Point)1