use of org.eclipse.nebula.widgets.nattable.resize.command.MultiColumnResizeCommand in project nebula.widgets.nattable by eclipse.
the class AutoResizeColumnCommandHandler method doCommand.
@Override
public boolean doCommand(ILayer targetLayer, AutoResizeColumnsCommand command) {
// Need to resize selected columns even if they are outside the viewport
// As this command is triggered by the InitialAutoResizeCommand we know
// that the targetLayer is the
// NatTable itself
targetLayer.doCommand(new TurnViewportOffCommand());
int[] columnPositions = ObjectUtils.asIntArray(command.getColumnPositions());
int[] gridColumnPositions = command.doPositionTransformation() ? convertFromPositionToCommandLayer(columnPositions) : columnPositions;
int[] gridColumnWidths = MaxCellBoundsHelper.getPreferredColumnWidths(command.getConfigRegistry(), command.getGCFactory(), this.commandLayer, gridColumnPositions);
this.commandLayer.doCommand(new MultiColumnResizeCommand(this.commandLayer, gridColumnPositions, gridColumnWidths, true));
targetLayer.doCommand(new TurnViewportOnCommand());
return true;
}
Aggregations