From bf20eb7c3698f89b248996ea77b40eaf962dc4d1 Mon Sep 17 00:00:00 2001 From: Michael Leuschel <leuschel@cs.uni-duesseldorf.de> Date: Wed, 2 Oct 2019 15:58:46 +0200 Subject: [PATCH] add workspace path to .bum or .buc path --- de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java b/de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java index 6d893bd5..986212ee 100644 --- a/de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java +++ b/de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java @@ -9,6 +9,8 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.IHandler; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.jface.viewers.ISelection; @@ -40,7 +42,9 @@ public class OpenClassicHandler extends AbstractHandler implements IHandler { if(prob_location.endsWith(".jar")) { // we can open directly the .bum or .buc files with ProB2; we need to get it from root // we could also get a platform URI: URI fileURI = URI.createPlatformResourceURI(root.getResource().getFullPath().toString(), true); - runProB2(prob_location, root.getResource().getFullPath().toString()); + String bum_buc_path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString() + + root.getResource().getFullPath().toString(); + runProB2(prob_location, bum_buc_path); } else { final File temp = createTempFile(); final String tmp = temp.getAbsolutePath(); -- GitLab