Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-03-14 15:27:58 +0000
committerCamille Letavernier2014-03-14 15:27:58 +0000
commit627e7a3fee091a66340d531ceab689144a86e263 (patch)
tree97549a59f4dbdc0e382e74c44985afed75acd86f /sandbox
parent6f70c04962bc001ae9a61ccf39665168ba3626cf (diff)
downloadorg.eclipse.papyrus-627e7a3fee091a66340d531ceab689144a86e263.tar.gz
org.eclipse.papyrus-627e7a3fee091a66340d531ceab689144a86e263.tar.xz
org.eclipse.papyrus-627e7a3fee091a66340d531ceab689144a86e263.zip
[Releng] Fix dependency versions
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/org.eclipse.papyrus.dev.project.management/META-INF/MANIFEST.MF12
-rw-r--r--sandbox/org.eclipse.papyrus.dev.project.management/src/org/eclipse/papyrus/dev/project/management/handlers/plugins/ChangeDependencyVersionNumberHandler.java49
2 files changed, 47 insertions, 14 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 479323c594d..9fa4ac18ba5 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,8 +1,12 @@
Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,org.eclipse.core.runtime,org.eclipse.co
- re.commands,org.eclipse.core.resources;bundle-version="3.8.0",org.ecl
- ipse.papyrus.eclipse.project.editors;bundle-version="1.0.0",org.eclip
- se.papyrus.infra.core.log;bundle-version="1.0.0",org.eclipse.pde.ui
+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="1.0.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.pde.ui,
+ org.eclipse.ui.ide;bundle-version="3.10.0"
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
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 49086df806f..118269c028e 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
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.dev.project.management.handlers.plugins;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
@@ -22,6 +24,7 @@ import org.eclipse.papyrus.dev.project.management.utils.Utils;
import org.eclipse.papyrus.eclipse.project.editors.file.ManifestEditor;
import org.eclipse.papyrus.eclipse.project.editors.interfaces.IManifestEditor;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
//TODO should be covered with JUnit test
public class ChangeDependencyVersionNumberHandler extends AbstractHandler {
@@ -61,7 +64,27 @@ public class ChangeDependencyVersionNumberHandler extends AbstractHandler {
@Override
protected IStatus run(IProgressMonitor monitor) {
- return runAsJob(newVersion, pattern, monitor);
+
+ final AtomicReference<IStatus> result = new AtomicReference<IStatus>();
+
+ WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
+
+ @Override
+ protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
+ result.set(runAsJob(newVersion, pattern, monitor));
+ }
+
+ };
+
+ try {
+ operation.run(monitor);
+ } catch (InvocationTargetException e) {
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage());
+ } catch (InterruptedException e) {
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage());
+ }
+
+ return result.get();
}
};
@@ -90,20 +113,26 @@ public class ChangeDependencyVersionNumberHandler extends AbstractHandler {
monitor.worked(1);
}
- //FIXME: We're not in the UI Thread anymore. We can't open a dialog here.
- 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();
- }
+
+ final String textResult = notManagedProjectNames;
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ if(textResult.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" + textResult, MessageDialog.INFORMATION, new String[]{ "OK" }, 0);
+ informationDialog.open();
+ }
+ }
+ });
return Status.OK_STATUS;
}
/**
- *
+ *
* @param project
* the project to manage
* @param dependencyPattern

Back to the top