use of org.rstudio.studio.client.projects.model.NewProjectInput 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();
}
});
}
});
}
use of org.rstudio.studio.client.projects.model.NewProjectInput in project rstudio by rstudio.
the class NewDirectoryNavigationPage method createPages.
private static ArrayList<WizardPage<NewProjectInput, NewProjectResult>> createPages(SessionInfo sessionInfo) {
ArrayList<WizardPage<NewProjectInput, NewProjectResult>> pages = new ArrayList<WizardPage<NewProjectInput, NewProjectResult>>();
// add default RStudio dialogs
pages.add(new NewDirectoryPage());
pages.add(new NewPackagePage());
pages.add(new NewShinyAppPage());
// add user-defined project template dialogs
ProjectTemplateRegistryProvider registryProvider = RStudioGinjector.INSTANCE.getProjectTemplateRegistryProvider();
ProjectTemplateRegistry registry = registryProvider.getProjectTemplateRegistry();
for (String key : JsUtil.asIterable(registry.keys())) {
JsArray<ProjectTemplateDescription> descriptions = registry.get(key);
for (ProjectTemplateDescription description : JsUtil.asIterable(descriptions)) pages.add(new WizardProjectTemplatePage(description));
}
return pages;
}
Aggregations