Search in sources :

Example 1 with NewProjectWizard

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();
                }
            });
        }
    });
}
Also used : NewProjectResult(org.rstudio.studio.client.projects.model.NewProjectResult) NewProjectContext(org.rstudio.studio.client.projects.model.NewProjectContext) ApplicationQuit(org.rstudio.studio.client.application.ApplicationQuit) ProgressIndicator(org.rstudio.core.client.widget.ProgressIndicator) NewProjectInput(org.rstudio.studio.client.projects.model.NewProjectInput) NewProjectWizard(org.rstudio.studio.client.projects.ui.newproject.NewProjectWizard) SimpleRequestCallback(org.rstudio.studio.client.common.SimpleRequestCallback)

Aggregations

ProgressIndicator (org.rstudio.core.client.widget.ProgressIndicator)1 ApplicationQuit (org.rstudio.studio.client.application.ApplicationQuit)1 SimpleRequestCallback (org.rstudio.studio.client.common.SimpleRequestCallback)1 NewProjectContext (org.rstudio.studio.client.projects.model.NewProjectContext)1 NewProjectInput (org.rstudio.studio.client.projects.model.NewProjectInput)1 NewProjectResult (org.rstudio.studio.client.projects.model.NewProjectResult)1 NewProjectWizard (org.rstudio.studio.client.projects.ui.newproject.NewProjectWizard)1