if (currentWidthList != null && currentWidthList.size() != renderedColumns.size()) {
currentWidthList = null;
}
if (currentWidthList == null) {
LayoutTokens tokens = data.getColumnLayout();
List<UIColumn> allColumns = data.getAllColumns();
LayoutTokens newTokens = new LayoutTokens();
for (int i = 0; i < allColumns.size(); i++) {
UIColumn column = allColumns.get(i);
if (column.isRendered()) {
if (tokens == null) {
if (column instanceof AbstractUIColumn && ((AbstractUIColumn) column).getWidth() != null) {
newTokens.addToken(LayoutTokens.parseToken(((AbstractUIColumn) column).getWidth()));
} 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);
*/
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();