}
}
private void initSplitBar(final LayoutRegion region, final BoxComponent component, final BorderLayoutData data) {
SplitBar bar = (SplitBar) component.getData("splitBar");
if (bar == null || bar.getResizeWidget() != component) {
bar = createSplitBar(region, component);
final SplitBar fBar = bar;
Listener<ComponentEvent> splitBarListener = new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
boolean side = region == LayoutRegion.WEST || region == LayoutRegion.EAST;
int size = side ? component.getOffsetWidth() : component.getOffsetHeight();
int centerSize = side ? lastCenter.width : lastCenter.height;
fBar.setMinSize(data.getMinSize());
fBar.setMaxSize(Math.min(size + centerSize, data.getMaxSize()));
}
};
component.setData("splitBar", bar);
bar.addListener(Events.DragStart, splitBarListener);