if (currentWidthList != null && currentWidthList.size() != renderedColumns.size() + 1) {
currentWidthList = null;
}
if (currentWidthList == null) {
final LayoutTokens tokens = data.getColumnLayout();
final List<AbstractUIColumn> allColumns = data.getAllColumns();
final LayoutTokens newTokens = new LayoutTokens();
for (int i = 0; i < allColumns.size(); i++) {
final AbstractUIColumn column = allColumns.get(i);
if (column.isRendered()) {
if (tokens == null) {
if (column instanceof AbstractUIColumn && column.getWidth() != null) {
newTokens.addToken(LayoutTokens.parseToken(column.getWidth().serialize()));
} else {
newTokens.addToken(RelativeLayoutToken.DEFAULT_INSTANCE);
}
} else {
if (i < tokens.getSize()) {
newTokens.addToken(tokens.get(i));
} else {
newTokens.addToken(RelativeLayoutToken.DEFAULT_INSTANCE);
}
}
}
}
Measure space = data.getCurrentWidth();
final LayoutComponentRenderer renderer = data.getLayoutComponentRenderer(facesContext);
space = space.subtractNotNegative(renderer.getBorderLeft(facesContext, data));
space = space.subtractNotNegative(renderer.getBorderRight(facesContext, data));
if (needVerticalScrollbar(facesContext, data)) {
space = space.subtractNotNegative(renderer.getVerticalScrollbarWeight(facesContext, data));
}
/*
// todo: not nice: 1 left + 1 right border
space = space.subtract(renderedColumns.size() * 2);
*/
final LayoutInfo layoutInfo =
new LayoutInfo(newTokens.getSize(), space.getPixel(), newTokens, data.getClientId(facesContext), false);
final Measure columnSelectorWidth
= data.getLayoutComponentRenderer(facesContext).getCustomMeasure(facesContext, data, "columnSelectorWidth");
parseFixedWidth(layoutInfo, renderedColumns, columnSelectorWidth);
layoutInfo.parseColumnLayout(space.getPixel());
currentWidthList = layoutInfo.getSpaceList();