List<BaseColumn> columns = table.getRenderedColumns();
if (columns.size() != widthsArray.length())
throw new IllegalStateException("columns.size() != widthsArray.length(): " + columns.size() + " != " + widthsArray.length());
ColumnResizing columnResizing = (ColumnResizing) component;
ColumnResizingState resizingState = columnResizing.getResizingState();
if (resizingState == null)
resizingState = new ColumnResizingState();
resizingState.setTableWidth(tableWidth);
for (int i = 0, count = columns.size(); i < count; i++) {
BaseColumn column = columns.get(i);
String newWidth;
try {
newWidth = widthsArray.getString(i);
} catch (JSONException e) {
throw new RuntimeException(e);
}
resizingState.setColumnWidth(column.getId(), newWidth);
}
if (submittedColumnsOrder != null) {
if (table.getColumnsOrder() != null && ValueBindings.set(table, "columnsOrder", table.getColumnsOrder())) {
table.setColumnsOrder(null);