use of net.sourceforge.nattable.resize.command.MultiColumnResizeCommand in project translationstudio8 by heartsome.
the class AutoResizeColumnCommandHandler method doCommand.
public boolean doCommand(ILayer targetLayer, AutoResizeColumnsCommand command) {
// Need to resize selected columns even if they are outside the viewport
targetLayer.doCommand(new TurnViewportOffCommand());
int[] columnPositions = ObjectUtils.asIntArray(command.getColumnPositions());
int[] gridColumnPositions = convertFromSelectionToGrid(columnPositions);
int[] gridColumnWidths = MaxCellBoundsHelper.getPreferedColumnWidths(command.getConfigRegistry(), command.getGC(), gridLayer, gridColumnPositions);
gridLayer.doCommand(new MultiColumnResizeCommand(gridLayer, gridColumnPositions, gridColumnWidths));
targetLayer.doCommand(new TurnViewportOnCommand());
return true;
}
Aggregations