panel.getElement().<FxElement> cast().slideIn(d, fx);
} else {
expanded = true;
}
BaseEventPreview preview = new BaseEventPreview() {
@Override
protected boolean onPreview(NativePreviewEvent pe) {
switch (pe.getTypeInt()) {
case Event.ONCLICK:
case Event.ONMOUSEDOWN:
XElement target = pe.getNativeEvent().getEventTarget().cast();
if (!panel.getElement().isOrHasChild(target) && !(getElement().isOrHasChild(target))) {
collapse();
remove();
}
break;
}
return false;
}
};
CompositeElement comp = new CompositeElement();
comp.add(panel.getElement());
preview.setIgnoreList(comp);
preview.add();
}
}