Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/pages/PapyrusProjectCreationPage.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/wizards/NewPapyrusProjectWizard.java19
2 files changed, 21 insertions, 10 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/pages/PapyrusProjectCreationPage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/pages/PapyrusProjectCreationPage.java
index e887b3b9dab..1830eb94bc1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/pages/PapyrusProjectCreationPage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/pages/PapyrusProjectCreationPage.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014, 2017, 2019 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2014, 2017, 2019. 2021 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,7 +11,7 @@
* Contributors:
* Thibault Le Ouay (Sherpa Engineering) t.leouay@sherpa-eng.com - Initial API and implementation
* Christian W. Damus - bug 471453
- * Ansgar Radermacher (CEA LIST) - bug 551952
+ * Ansgar Radermacher (CEA LIST) - support working sets (bug 572328), bug 551952
*
*****************************************************************************/
@@ -76,6 +76,11 @@ public class PapyrusProjectCreationPage extends WizardNewProjectCreationPage imp
fileName.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
fileName.addListener(SWT.Modify, fileNameModifyListener);
setPageComplete(false);
+
+ String[] workingSetIds = new String[] {
+ "org.eclipse.ui.resourceWorkingSetPage", //$NON-NLS-1$
+ "org.eclipse.jdt.ui.JavaWorkingSetPage" }; //$NON-NLS-1$
+ createWorkingSetGroup(composite, null, workingSetIds);
}
/**
@@ -143,7 +148,7 @@ public class PapyrusProjectCreationPage extends WizardNewProjectCreationPage imp
*
* @see org.eclipse.jface.wizard.WizardPage#canFlipToNextPage()
*
- * @return
+ * @return true, if user can flip to next page
*/
@Override
public boolean canFlipToNextPage() {
@@ -183,6 +188,5 @@ public class PapyrusProjectCreationPage extends WizardNewProjectCreationPage imp
@Override
public void performHelp() {
PlatformUI.getWorkbench().getHelpSystem().displayHelp("org.eclipse.papyrus.uml.diagram.wizards.NewProject"); //$NON-NLS-1$
-
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/wizards/NewPapyrusProjectWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/wizards/NewPapyrusProjectWizard.java
index a3ec7d428ed..7260ef64cbe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/wizards/NewPapyrusProjectWizard.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/wizards/NewPapyrusProjectWizard.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2013 CEA LIST.
+ * Copyright (c) 2010, 2013, 2021 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
@@ -12,6 +12,8 @@
* Contributors:
* Tatiana Fesenko (CEA LIST) - Initial API and implementation
* Christian W. Damus (CEA) - Support creating models in repositories (CDO)
+ * Ansgar Radermacher (CEA) - Support working sets ((bug 572328), avoid deprecated SubProgressMonitor
+ *
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.wizards.wizards;
@@ -22,7 +24,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.uml.diagram.wizards.Activator;
@@ -30,6 +32,8 @@ import org.eclipse.papyrus.uml.diagram.wizards.messages.Messages;
import org.eclipse.papyrus.uml.diagram.wizards.pages.PapyrusProjectCreationPage;
import org.eclipse.papyrus.uml.diagram.wizards.pages.SelectArchitectureContextPage;
import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
/**
@@ -130,13 +134,16 @@ public class NewPapyrusProjectWizard extends CreateModelWizard {
if (projectLocationURI != null) {
projectDescription.setLocationURI(projectLocationURI);
}
- project.create(projectDescription, new SubProgressMonitor(progressMonitor, 1));
- project.open(new SubProgressMonitor(progressMonitor, 1));
+ project.create(projectDescription, SubMonitor.convert(progressMonitor, 1));
+ project.open(SubMonitor.convert(progressMonitor, 1));
} else {
// projectDescription = project.getDescription();
- project.open(new SubProgressMonitor(progressMonitor, 1));
+ project.open(SubMonitor.convert(progressMonitor, 1));
+ }
+ IWorkingSet[] workingSets = getMyProjectPage().getSelectedWorkingSets();
+ if (workingSets.length > 0) {
+ PlatformUI.getWorkbench().getWorkingSetManager().addToWorkingSets(project, workingSets);
}
-
return project;
}

Back to the top