use of org.rstudio.studio.client.projects.model.NewProjectResult 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.NewProjectResult in project rstudio by rstudio.
the class VersionControlPage method collectInput.
@Override
protected NewProjectResult collectInput() {
if (txtDirName_.getText().trim().length() == 0)
autoFillCheckoutDir();
String url = txtRepoUrl_.getText().trim();
String username = txtUsername_.getText().trim();
String checkoutDir = txtDirName_.getText().trim();
String dir = existingRepoDestDir_.getText().trim();
if (url.length() > 0 && checkoutDir.length() > 0 && dir.length() > 0) {
String projFile = projFileFromDir(FileSystemItem.createDir(dir).completePath(checkoutDir));
VcsCloneOptions options = VcsCloneOptions.create(getVcsId(), url, username, checkoutDir, dir);
return new NewProjectResult(projFile, false, false, dir, options, null, null, null);
} else {
return null;
}
}
use of org.rstudio.studio.client.projects.model.NewProjectResult 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