final Widget widget = widgets.next();
final SplitterItem item = items.next();
// set the widget position...
final Element widgetElement = widget.getElement();
final InlineStyle widgetInlineStyle = InlineStyle.getInlineStyle(widgetElement);
widgetInlineStyle.setString(Css.POSITION, "absolute");
widgetInlineStyle.setInteger(Css.LEFT, left, CssUnit.PX);
widgetInlineStyle.setInteger(Css.TOP, 0, CssUnit.PX);
widgetInlineStyle.setString(Css.OVERFLOW, "hidden");
// set the size(width/height)...
widget.setHeight("100%");
// is the last widget ???
if (false == widgets.hasNext()) {
widget.setWidth((availableWidth - left) + "px");
break;
}
// calculate the new width...
final int weight = item.getSizeShare();
final int width = (int) (ratio * weight);
widget.setWidth(width + "px");
left = left + width;
final Widget splitter = (Widget) widgets.next();
// set the splitter position...
final InlineStyle splitterInlineStyle = InlineStyle.getInlineStyle( splitter.getElement() );
splitterInlineStyle.setString(Css.POSITION, "absolute");
splitterInlineStyle.setInteger(Css.LEFT, left, CssUnit.PX);
splitterInlineStyle.setInteger(Css.TOP, 0, CssUnit.PX);
splitterInlineStyle.setString(Css.OVERFLOW, "hidden");
// set the splitters size...
splitter.setWidth(splitterWidth + "px");
splitter.setHeight("100%");