use of org.rstudio.studio.client.projects.ui.newproject.NewProjectWizard in project rstudio by rstudio.
the class Projects method handleNewProject.
private void handleNewProject(boolean forceSaveAll, final boolean allowOpenInNewWindow) {
// first resolve the quit context (potentially saving edited documents
// and determining whether to save the R environment on exit)
applicationQuit_.prepareForQuit("Save Current Workspace", forceSaveAll, new ApplicationQuit.QuitContext() {
@Override
public void onReadyToQuit(final boolean saveChanges) {
projServer_.getNewProjectContext(new SimpleRequestCallback<NewProjectContext>() {
@Override
public void onResponseReceived(NewProjectContext context) {
NewProjectWizard wiz = new NewProjectWizard(session_.getSessionInfo(), pUIPrefs_.get(), pWorkbenchContext_.get(), new NewProjectInput(FileSystemItem.createDir(pUIPrefs_.get().defaultProjectLocation().getValue()), context), allowOpenInNewWindow, new ProgressOperationWithInput<NewProjectResult>() {
@Override
public void execute(NewProjectResult newProject, ProgressIndicator indicator) {
indicator.onCompleted();
createNewProject(newProject, saveChanges);
}
});
wiz.showModal();
}
});
}
});
}
Aggregations