Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/org.eclipse.papyrus.dev.project.management/META-INF/MANIFEST.MF34
-rw-r--r--sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractAddFileHandler.java71
-rw-r--r--sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractChangeProjectVersionHandler.java64
-rw-r--r--sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFEPLFileHandler.java54
-rw-r--r--sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFeatureLicenseFileHandler.java55
-rw-r--r--sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/AddProjectAboutFileHandler.java55
-rw-r--r--sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/ChangeDependencyVersionNumberHandler.java55
7 files changed, 252 insertions, 136 deletions
diff --git a/sandbox/org.eclipse.papyrus.dev.project.management/META-INF/MANIFEST.MF b/sandbox/org.eclipse.papyrus.dev.project.management/META-INF/MANIFEST.MF
index b707d2b2496..0b360fa0922 100644
--- a/sandbox/org.eclipse.papyrus.dev.project.management/META-INF/MANIFEST.MF
+++ b/sandbox/org.eclipse.papyrus.dev.project.management/META-INF/MANIFEST.MF
@@ -1,16 +1,18 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.eclipse.papyrus.dev.project.management;singleton:=true
-Bundle-Version: 0.9.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.dev.project.management.Activator
-Bundle-Vendor: %Bundle-Vendor
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.commands,
- org.eclipse.core.resources;bundle-version="3.8.0",
- org.eclipse.papyrus.eclipse.project.editors;bundle-version="0.9.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="0.9.0",
- org.eclipse.pde.ui
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.commands,
+ org.eclipse.core.resources;bundle-version="3.8.0",
+ org.eclipse.papyrus.eclipse.project.editors;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0",
+ org.eclipse.pde.ui
+Bundle-Vendor: %Bundle-Vendor
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 0.10.0.qualifier
+Bundle-Name: %Bundle-Name
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.dev.project.management.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.dev.project.management;single
+ ton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractAddFileHandler.java b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractAddFileHandler.java
index 7e47393818b..89f06f87820 100644
--- a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractAddFileHandler.java
+++ b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractAddFileHandler.java
@@ -1,18 +1,89 @@
package org.eclipse.papyrus.dev.project.management.handlers;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.papyrus.dev.project.management.Activator;
import org.eclipse.papyrus.eclipse.project.editors.interfaces.IProjectEditor;
import org.eclipse.papyrus.eclipse.project.editors.project.ProjectEditor;
+import org.eclipse.swt.widgets.Display;
public abstract class AbstractAddFileHandler extends AbstractHandler {
+
+ public Object execute(final ExecutionEvent event) {
+
+ Job job = new Job(getJobName()) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ return runAsJob(monitor);
+ }
+
+ };
+
+ job.setUser(true);
+ job.schedule();
+
+ return null;
+ }
+
+ protected IStatus runAsJob(IProgressMonitor monitor) {
+ final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+
+ URL sourceURL = getSourceURL();
+ if(sourceURL == null) {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), "Cannot find the source file", "The source file is invalid");
+ }
+ String targetPath = getTargetPath();
+
+ monitor.beginTask(getJobName(), projects.length);
+
+ for(final IProject current : projects) {
+ if(current.isOpen() && isValidProject(current)) {
+ try {
+ if(isValidProject(current)) {
+ addFile(current, sourceURL, targetPath);
+ }
+ } catch (final CoreException e) {
+ Activator.log.error(e);
+ } catch (final MalformedURLException e) {
+ Activator.log.error(e);
+ } catch (final IOException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ monitor.worked(1);
+ }
+
+ MessageDialog.openInformation(Display.getCurrent().getActiveShell(), getJobName(), "Done.");
+ return null;
+ }
+
+ //Subclasses should override this
+ protected String getJobName() {
+ return "Add files";
+ }
+
+ protected abstract boolean isValidProject(IProject current);
+
+ protected abstract URL getSourceURL();
+
+ protected abstract String getTargetPath();
+
/**
*
* @param project
diff --git a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractChangeProjectVersionHandler.java b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractChangeProjectVersionHandler.java
index 656acbee428..75caeced487 100644
--- a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractChangeProjectVersionHandler.java
+++ b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/AbstractChangeProjectVersionHandler.java
@@ -5,6 +5,10 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
@@ -48,30 +52,52 @@ public abstract class AbstractChangeProjectVersionHandler extends AbstractHandle
final InputDialogWithCheckBox dialog = new InputDialogWithCheckBox(Display.getCurrent().getActiveShell(), TITLE, MESSAGE, INITIAL_VALUE, CHECKBOX_MESSAGE, true, validator);
if(dialog.open() == Window.OK) {
- String notManagedProjectNames = "";
- final String newVersion = dialog.getValue();
- final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for(final IProject current : projects) {
- final String name = current.getName();
- if(dialog.isChecked()) {
- if(name.startsWith(PAPYRUS_NAME)) {//we test the project name
- setVersionNumber(current, newVersion, notManagedProjectNames);
- } else {
- notManagedProjectNames += NLS.bind("- {0} \n", current.getName());
- }
- } else {
+ Job job = new Job("Update version numbers") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IStatus result = runAsJob(dialog.getValue(), dialog.isChecked(), monitor);
+ return result;
+ }
+
+ };
+ job.setUser(true);
+
+ job.schedule();
+ }
+ return null;
+ }
+
+ protected IStatus runAsJob(final String newVersion, final boolean papyrusProjectsOnly, IProgressMonitor monitor) {
+ String notManagedProjectNames = "";
+ final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+
+ monitor.beginTask("Update version numbers", projects.length);
+
+ for(final IProject current : projects) {
+ final String name = current.getName();
+ if(papyrusProjectsOnly) {
+ if(name.startsWith(PAPYRUS_NAME)) {//we test the project name
setVersionNumber(current, newVersion, notManagedProjectNames);
+ } else {
+ notManagedProjectNames += NLS.bind("- {0} \n", current.getName());
}
- }
- if(notManagedProjectNames.equals("")) {
- final MessageDialog informationDialog = new MessageDialog(Display.getCurrent().getActiveShell(), WARNING_DIALOG_TITLE, null, WARNING_DIALOG_MESSAGE2, MessageDialog.INFORMATION, new String[]{ "OK" }, 0);
- informationDialog.open();
} else {
- final MessageDialog informationDialog = new MessageDialog(Display.getCurrent().getActiveShell(), WARNING_DIALOG_TITLE, null, WARNING_DIALOG_MESSAGE + "\n" + notManagedProjectNames, MessageDialog.INFORMATION, new String[]{ "OK" }, 0);
- informationDialog.open();
+ setVersionNumber(current, newVersion, notManagedProjectNames);
}
+
+ monitor.worked(1);
}
- return null;
+
+ if(notManagedProjectNames.equals("")) {
+ final MessageDialog informationDialog = new MessageDialog(Display.getCurrent().getActiveShell(), WARNING_DIALOG_TITLE, null, WARNING_DIALOG_MESSAGE2, MessageDialog.INFORMATION, new String[]{ "OK" }, 0);
+ informationDialog.open();
+ } else {
+ final MessageDialog informationDialog = new MessageDialog(Display.getCurrent().getActiveShell(), WARNING_DIALOG_TITLE, null, WARNING_DIALOG_MESSAGE + "\n" + notManagedProjectNames, MessageDialog.INFORMATION, new String[]{ "OK" }, 0);
+ informationDialog.open();
+ }
+
+ return Status.OK_STATUS;
}
/**
diff --git a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFEPLFileHandler.java b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFEPLFileHandler.java
index 1c6bc8a1b5e..40e2ee36717 100644
--- a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFEPLFileHandler.java
+++ b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFEPLFileHandler.java
@@ -1,19 +1,13 @@
package org.eclipse.papyrus.dev.project.management.handlers.features;
-import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.papyrus.dev.project.management.Activator;
import org.eclipse.papyrus.dev.project.management.handlers.AbstractAddFileHandler;
import org.eclipse.papyrus.dev.project.management.utils.Utils;
-import org.eclipse.swt.widgets.Display;
public class AddFEPLFileHandler extends AbstractAddFileHandler {
@@ -22,29 +16,33 @@ public class AddFEPLFileHandler extends AbstractAddFileHandler {
public static final String EPL_HTML_PATH = "epl-v10.html"; //$NON-NLS-1$
- private static URL epl_url;
-
- public Object execute(final ExecutionEvent event) throws ExecutionException {
- final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for(final IProject current : projects) {
- if(current.isOpen()) {
- try {
- if(current.hasNature(Utils.FEATURE_NATURE)) {
- if(epl_url == null) {
- epl_url = new URL("platform:/plugin/" + Activator.PLUGIN_ID + EPL_HTML_SOURCE_PATH); //$NON-NLS-1$
- }
- addFile(current, epl_url, EPL_HTML_PATH);
- }
- } catch (final CoreException e) {
- Activator.log.error(e);
- } catch (final MalformedURLException e) {
- Activator.log.error(e);
- } catch (final IOException e) {
- Activator.log.error(e);
- }
- }
+ @Override
+ protected boolean isValidProject(IProject current) {
+ try {
+ return current.hasNature(Utils.FEATURE_NATURE);
+ } catch (CoreException ex) {
+ Activator.log.error(ex);
+ }
+ return false;
+ }
+
+ @Override
+ protected URL getSourceURL() {
+ try {
+ return new URL("platform:/plugin/" + Activator.PLUGIN_ID + EPL_HTML_SOURCE_PATH); //$NON-NLS-1$
+ } catch (MalformedURLException ex) {
+ Activator.log.error(ex);
}
- new MessageDialog(Display.getCurrent().getActiveShell(), "Add about.html file", null, "Done.", MessageDialog.INFORMATION, new String[]{ "OK" }, 0).open();
return null;
}
+
+ @Override
+ protected String getTargetPath() {
+ return EPL_HTML_PATH;
+ }
+
+ @Override
+ protected String getJobName() {
+ return "Add EPL file";
+ }
}
diff --git a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFeatureLicenseFileHandler.java b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFeatureLicenseFileHandler.java
index 19b9d5e1fa9..3fa6a7b5370 100644
--- a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFeatureLicenseFileHandler.java
+++ b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/features/AddFeatureLicenseFileHandler.java
@@ -1,19 +1,13 @@
package org.eclipse.papyrus.dev.project.management.handlers.features;
-import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.papyrus.dev.project.management.Activator;
import org.eclipse.papyrus.dev.project.management.handlers.AbstractAddFileHandler;
import org.eclipse.papyrus.dev.project.management.utils.Utils;
-import org.eclipse.swt.widgets.Display;
public class AddFeatureLicenseFileHandler extends AbstractAddFileHandler {
@@ -22,30 +16,33 @@ public class AddFeatureLicenseFileHandler extends AbstractAddFileHandler {
public static final String LICENSE_HTML_PATH = "license.html"; //$NON-NLS-1$
- private static URL license_url;
-
- public Object execute(final ExecutionEvent event) throws ExecutionException {
- final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for(final IProject current : projects) {
- if(current.isOpen()) {
- try {
- if(current.hasNature(Utils.FEATURE_NATURE)) {
- if(license_url == null) {
- license_url = new URL("platform:/plugin/" + Activator.PLUGIN_ID + LICENSE_HTML_SOURCE_PATH); //$NON-NLS-1$
- }
- addFile(current, license_url, LICENSE_HTML_PATH);
-
- }
- } catch (final CoreException e) {
- Activator.log.error(e);
- } catch (final MalformedURLException e) {
- Activator.log.error(e);
- } catch (final IOException e) {
- Activator.log.error(e);
- }
- }
+ @Override
+ protected boolean isValidProject(IProject current) {
+ try {
+ return current.hasNature(Utils.FEATURE_NATURE);
+ } catch (CoreException ex) {
+ Activator.log.error(ex);
+ }
+ return false;
+ }
+
+ @Override
+ protected URL getSourceURL() {
+ try {
+ return new URL("platform:/plugin/" + Activator.PLUGIN_ID + LICENSE_HTML_SOURCE_PATH);
+ } catch (MalformedURLException ex) {
+ Activator.log.error(ex);
}
- new MessageDialog(Display.getCurrent().getActiveShell(), "Add about.html file", null, "Done.", MessageDialog.INFORMATION, new String[]{ "OK" }, 0).open();
return null;
}
+
+ @Override
+ protected String getTargetPath() {
+ return LICENSE_HTML_PATH;
+ }
+
+ @Override
+ protected String getJobName() {
+ return "Add about.html file";
+ }
}
diff --git a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/AddProjectAboutFileHandler.java b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/AddProjectAboutFileHandler.java
index 95b4768fc8e..efe516e0786 100644
--- a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/AddProjectAboutFileHandler.java
+++ b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/AddProjectAboutFileHandler.java
@@ -1,19 +1,13 @@
package org.eclipse.papyrus.dev.project.management.handlers.plugins;
-import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.papyrus.dev.project.management.Activator;
import org.eclipse.papyrus.dev.project.management.handlers.AbstractAddFileHandler;
import org.eclipse.papyrus.dev.project.management.utils.Utils;
-import org.eclipse.swt.widgets.Display;
//TODO should be covered with JUnit test
public class AddProjectAboutFileHandler extends AbstractAddFileHandler {
@@ -22,30 +16,33 @@ public class AddProjectAboutFileHandler extends AbstractAddFileHandler {
public static final String ABOUT_HTML_PATH = "about.html"; //$NON-NLS-1$
- private static URL about_url;
-
- public Object execute(final ExecutionEvent event) throws ExecutionException {
- final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for(final IProject current : projects) {
- if(current.isOpen()) {
- try {
- if(current.hasNature(Utils.PLUGIN_NATURE)) {
- if(about_url == null) {
- about_url = new URL("platform:/plugin/" + Activator.PLUGIN_ID + ABOUT_HTML_SOURCE_PATH); //$NON-NLS-1$
- }
- addFile(current, about_url, ABOUT_HTML_PATH);
-
- }
- } catch (final CoreException e) {
- Activator.log.error(e);
- } catch (final MalformedURLException e) {
- Activator.log.error(e);
- } catch (final IOException e) {
- Activator.log.error(e);
- }
- }
+ @Override
+ protected boolean isValidProject(IProject current) {
+ try {
+ return current.hasNature(Utils.PLUGIN_NATURE);
+ } catch (CoreException ex) {
+ Activator.log.error(ex);
+ }
+ return false;
+ }
+
+ @Override
+ protected URL getSourceURL() {
+ try {
+ return new URL("platform:/plugin/" + Activator.PLUGIN_ID + ABOUT_HTML_SOURCE_PATH);
+ } catch (MalformedURLException ex) {
+ Activator.log.error(ex);
}
- new MessageDialog(Display.getCurrent().getActiveShell(), "Add about.html file", null, "Done.", MessageDialog.INFORMATION, new String[]{ "OK" }, 0).open();
return null;
}
+
+ @Override
+ protected String getTargetPath() {
+ return ABOUT_HTML_PATH;
+ }
+
+ @Override
+ protected String getJobName() {
+ return "Add about.html file";
+ }
}
diff --git a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/ChangeDependencyVersionNumberHandler.java b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/ChangeDependencyVersionNumberHandler.java
index 7994604449b..c43a3d9be78 100644
--- a/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/ChangeDependencyVersionNumberHandler.java
+++ b/sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/ChangeDependencyVersionNumberHandler.java
@@ -8,6 +8,10 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
@@ -50,29 +54,50 @@ public class ChangeDependencyVersionNumberHandler extends AbstractHandler {
final TwoInputDialog dialog = new TwoInputDialog(Display.getCurrent().getActiveShell(), TITLE, "Enter the new version for the Papyrus dependencies", "pattern plugin name", INITIAL_VALUE, PAPYRUS_NAME, validator);
if(dialog.open() == Window.OK) {
- String notManagedProjectNames = "";
final String newVersion = dialog.getValue();
final String pattern = dialog.getValue_2();
- final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for(final IProject current : projects) {
- final String name = current.getName();
+ Job job = new Job("Update dependency versions") {
- if(name.startsWith(PAPYRUS_NAME)) {//TODO : add the possibility to manage other plugins
- setVersionNumber(current, pattern, newVersion, notManagedProjectNames);
- } else {
- notManagedProjectNames += NLS.bind("- {0} \n", current.getName());
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ return runAsJob(newVersion, pattern, monitor);
}
- }
- if(notManagedProjectNames.equals("")) {
- final MessageDialog informationDialog = new MessageDialog(Display.getCurrent().getActiveShell(), WARNING_DIALOG_TITLE, null, WARNING_DIALOG_MESSAGE2, MessageDialog.INFORMATION, new String[]{ "OK" }, 0);
- informationDialog.open();
+
+ };
+ job.setUser(true);
+ job.schedule();
+ }
+ return null;
+ }
+
+ protected IStatus runAsJob(final String newVersion, final String pattern, IProgressMonitor monitor) {
+ String notManagedProjectNames = "";
+
+ final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+
+ monitor.beginTask("Update dependency versions", projects.length);
+
+ for(final IProject current : projects) {
+ final String name = current.getName();
+
+ if(name.startsWith(PAPYRUS_NAME)) {//TODO : add the possibility to manage other plugins
+ setVersionNumber(current, pattern, newVersion, notManagedProjectNames);
} else {
- final MessageDialog informationDialog = new MessageDialog(Display.getCurrent().getActiveShell(), WARNING_DIALOG_TITLE, null, WARNING_DIALOG_MESSAGE + "\n" + notManagedProjectNames, MessageDialog.INFORMATION, new String[]{ "OK" }, 0);
- informationDialog.open();
+ notManagedProjectNames += NLS.bind("- {0} \n", current.getName());