From dcfd63744510cb223396618df9f85c19f6a9e312 Mon Sep 17 00:00:00 2001
From: Michael Leuschel <leuschel@cs.uni-duesseldorf.de>
Date: Wed, 2 Oct 2019 15:33:46 +0200
Subject: [PATCH] open .bum or .buc files with ProB2-UI jar

instead of exporting to .eventb temporary file
---
 de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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 be20c4d0..6d893bd5 100644
--- a/de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java
+++ b/de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java
@@ -38,11 +38,9 @@ public class OpenClassicHandler extends AbstractHandler implements IHandler {
 			final IEventBRoot root = getSelection();
 			if (root != null) {
 				if(prob_location.endsWith(".jar")) {
-					// TO DO: we can open directly the .bum or .buc files with ProB2; we need to get it from root
-					final File temp = createTempFile();
-					final String tmp = temp.getAbsolutePath();
-					ExportNewCoreHandler.exportToClassic(tmp, root);
-					runProB2(prob_location, tmp);
+					//  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());
 				} else {	
 					final File temp = createTempFile();
 					final String tmp = temp.getAbsolutePath();
-- 
GitLab