static A bindToComponent(A component, final Runnable onShow, final Runnable onUnShow) {
component.addAncestorListener(new AncestorListener() {
public void ancestorAdded(AncestorEvent event) {
pcallF(onShow);
}
public void ancestorRemoved(AncestorEvent event) {
pcallF(onUnShow);
}
public void ancestorMoved(AncestorEvent event) {
}
});
ret component;
}
static A bindToComponent(A component, Runnable onShow) {
ret bindToComponent(component, onShow, null);
}