int count = container.getItemCount();
// some columns can be percentages while others are fixed
// so we need to make 2 passes
for (int i = 0; i < count; i++) {
Component c = container.getItem(i);
ColumnData layoutData = null;
LayoutData d = getLayoutData(c);
if (d != null && d instanceof ColumnData) {
layoutData = (ColumnData) d;
} else {
layoutData = new ColumnData();
}
if (layoutData.getWidth() > 1) {
pw -= layoutData.getWidth();
}
pw -= getSideMargins(c);
}
pw = pw < 0 ? 0 : pw;
for (int i = 0; i < count; i++) {
Component c = container.getItem(i);
ColumnData layoutData = null;
LayoutData d = getLayoutData(c);
if (d != null && d instanceof ColumnData) {
layoutData = (ColumnData) d;