this.resizeWidget = resizeWidget;
this.resizeEl = resizeWidget.el();
listener = new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent e) {
EventType type = e.getType();
if (type == Events.Attach) {
if (!disabled) {
resizeEl.getParent().insertLast(getElement());
ComponentHelper.doAttach(SplitBar.this);
sync();
attachedBars.add(SplitBar.this);
}
} else if (type == Events.Detach) {
if (!disabled) {
removeSplitBar();
}
} else if (type == Events.Resize || type == Events.Move) {
delay.delay(400);
}
}
};
if (style == LayoutRegion.SOUTH || style == LayoutRegion.NORTH) {
setStyleName("x-hsplitbar");
} else {
setStyleName("x-vsplitbar");
}
resizeWidget.addListener(Events.Attach, listener);
resizeWidget.addListener(Events.Detach, listener);
resizeWidget.addListener(Events.Resize, listener);
resizeWidget.addListener(Events.Move, listener);
draggable = new Draggable(this);
draggable.setUpdateZIndex(false);
draggable.setStartDragDistance(0);
draggable.setProxyStyle("x-splitbar-proxy");
Listener<DragEvent> dragListener = new Listener<DragEvent>() {
public void handleEvent(DragEvent e) {
EventType type = e.getType();
if (type == Events.DragStart) {
onStartDrag(e);
} else if (type == Events.DragEnd) {
onEndDrag(e);
} else if (type == Events.DragCancel) {