use of org.rstudio.studio.client.workbench.views.connections.ui.NewConnectionWizard in project rstudio by rstudio.
the class ConnectionsPresenter method onNewConnection.
public void onNewConnection() {
// if r session bussy, fail
if (commands_.interruptR().isEnabled()) {
showError("The R session is currently busy. Wait for completion or " + "interrupt the current session and retry.");
return;
}
// get the context
server_.getNewConnectionContext(new DelayedProgressRequestCallback<NewConnectionContext>("New Connection...") {
@Override
protected void onSuccess(final NewConnectionContext context) {
// show dialog
NewConnectionWizard newConnectionWizard = new NewConnectionWizard(context, new ProgressOperationWithInput<ConnectionOptions>() {
@Override
public void execute(ConnectionOptions result, ProgressIndicator indicator) {
indicator.onCompleted();
eventBus_.fireEvent(new PerformConnectionEvent(result.getConnectVia(), result.getConnectCode()));
}
});
newConnectionWizard.showModal();
}
});
}
Aggregations