use of org.rstudio.core.client.widget.model.ProvidesBusy in project rstudio by rstudio.
the class WorkbenchTabPanel method add.
private void add(final WorkbenchTab tab) {
if (tab.isSuppressed())
return;
tabs_.add(tab);
final Widget widget = tab.asWidget();
tabPanel_.add(widget, tab.getTitle(), false, !tab.closeable() ? null : new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
tab.confirmClose(new Command() {
@Override
public void execute() {
tab.ensureHidden();
}
});
}
}, tab instanceof ProvidesBusy ? (ProvidesBusy) tab : null);
tab.addEnsureVisibleHandler(new EnsureVisibleHandler() {
public void onEnsureVisible(EnsureVisibleEvent event) {
// First ensure that we ourselves are visible
fireEvent(new EnsureVisibleEvent(event.getActivate()));
if (event.getActivate())
tabPanel_.selectTab(widget);
}
});
tab.addEnsureHeightHandler(new EnsureHeightHandler() {
@Override
public void onEnsureHeight(EnsureHeightEvent event) {
fireEvent(event);
}
});
}
Aggregations