Search in sources :

Example 1 with ProjectTemplateRegistryProvider

use of org.rstudio.studio.client.projects.model.ProjectTemplateRegistryProvider 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;
}
Also used : NewProjectResult(org.rstudio.studio.client.projects.model.NewProjectResult) ProjectTemplateDescription(org.rstudio.studio.client.projects.model.ProjectTemplateDescription) NewProjectInput(org.rstudio.studio.client.projects.model.NewProjectInput) ArrayList(java.util.ArrayList) WizardProjectTemplatePage(org.rstudio.core.client.widget.WizardProjectTemplatePage) ProjectTemplateRegistry(org.rstudio.studio.client.projects.model.ProjectTemplateRegistry) WizardPage(org.rstudio.core.client.widget.WizardPage) ProjectTemplateRegistryProvider(org.rstudio.studio.client.projects.model.ProjectTemplateRegistryProvider)

Aggregations

ArrayList (java.util.ArrayList)1 WizardPage (org.rstudio.core.client.widget.WizardPage)1 WizardProjectTemplatePage (org.rstudio.core.client.widget.WizardProjectTemplatePage)1 NewProjectInput (org.rstudio.studio.client.projects.model.NewProjectInput)1 NewProjectResult (org.rstudio.studio.client.projects.model.NewProjectResult)1 ProjectTemplateDescription (org.rstudio.studio.client.projects.model.ProjectTemplateDescription)1 ProjectTemplateRegistry (org.rstudio.studio.client.projects.model.ProjectTemplateRegistry)1 ProjectTemplateRegistryProvider (org.rstudio.studio.client.projects.model.ProjectTemplateRegistryProvider)1