diff options
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application.ui')
3 files changed, 14 insertions, 4 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application.ui/META-INF/MANIFEST.MF b/Application/hu.bme.mit.inf.dslreasoner.application.ui/META-INF/MANIFEST.MF index 38bb7dbd..2f2c83ef 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application.ui/META-INF/MANIFEST.MF +++ b/Application/hu.bme.mit.inf.dslreasoner.application.ui/META-INF/MANIFEST.MF | |||
@@ -22,7 +22,8 @@ Require-Bundle: hu.bme.mit.inf.dslreasoner.application, | |||
22 | org.eclipse.xtext.builder, | 22 | org.eclipse.xtext.builder, |
23 | org.eclipse.xtend.lib;bundle-version="2.14.0";resolution:=optional, | 23 | org.eclipse.xtend.lib;bundle-version="2.14.0";resolution:=optional, |
24 | org.eclipse.xtext.xbase.lib;bundle-version="2.14.0", | 24 | org.eclipse.xtext.xbase.lib;bundle-version="2.14.0", |
25 | org.eclipse.viatra.addon.validation.runtime.ui;bundle-version="1.7.0" | 25 | org.eclipse.viatra.addon.validation.runtime.ui;bundle-version="1.7.0", |
26 | org.eclipse.viatra.query.patternlanguage.emf.ui;bundle-version="2.4.1" | ||
26 | Import-Package: org.apache.log4j | 27 | Import-Package: org.apache.log4j |
27 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | 28 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 |
28 | Export-Package: hu.bme.mit.inf.dslreasoner.application.ui.quickfix, | 29 | Export-Package: hu.bme.mit.inf.dslreasoner.application.ui.quickfix, |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application.ui/plugin.xml b/Application/hu.bme.mit.inf.dslreasoner.application.ui/plugin.xml index 304df098..2895983e 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application.ui/plugin.xml +++ b/Application/hu.bme.mit.inf.dslreasoner.application.ui/plugin.xml | |||
@@ -410,7 +410,7 @@ | |||
410 | <extension | 410 | <extension |
411 | point="org.eclipse.ui.commands"> | 411 | point="org.eclipse.ui.commands"> |
412 | <command | 412 | <command |
413 | defaultHandler="hu.bme.mit.inf.dslreasoner.application.ui.execute.ExecuteScriptHandler" | 413 | defaultHandler="org.eclipse.viatra.query.patternlanguage.emf.ui.ReusablePatternLanguageExecutableExtensionFactory:hu.bme.mit.inf.dslreasoner.application.ui.execute.ExecuteScriptHandler" |
414 | id="hu.bme.mit.inf.dslreasoner.application.ui.executescript" | 414 | id="hu.bme.mit.inf.dslreasoner.application.ui.executescript" |
415 | name="ExecuteScript"> | 415 | name="ExecuteScript"> |
416 | </command> | 416 | </command> |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/execute/ExecuteScriptHandler.java b/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/execute/ExecuteScriptHandler.java index 380410d0..8d9d07a6 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/execute/ExecuteScriptHandler.java +++ b/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/execute/ExecuteScriptHandler.java | |||
@@ -12,14 +12,23 @@ import org.eclipse.jface.viewers.ISelection; | |||
12 | import org.eclipse.jface.viewers.StructuredSelection; | 12 | import org.eclipse.jface.viewers.StructuredSelection; |
13 | import org.eclipse.ui.handlers.HandlerUtil; | 13 | import org.eclipse.ui.handlers.HandlerUtil; |
14 | 14 | ||
15 | import com.google.inject.Inject; | ||
16 | import com.google.inject.Injector; | ||
17 | |||
15 | import hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor; | 18 | import hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor; |
16 | 19 | ||
17 | public class ExecuteScriptHandler extends AbstractHandler implements IHandler { | 20 | public class ExecuteScriptHandler extends AbstractHandler implements IHandler { |
18 | 21 | ||
19 | ScriptExecutor scriptExecutor = new ScriptExecutor(RuntimeConsoleBasedScriptConsole.FACTORY); | 22 | ScriptExecutor scriptExecutor; |
23 | |||
24 | @Inject | ||
25 | public void setInjector(Injector injector) { | ||
26 | scriptExecutor = new ScriptExecutor(RuntimeConsoleBasedScriptConsole.FACTORY, injector); | ||
27 | } | ||
20 | 28 | ||
21 | @Override | 29 | @Override |
22 | public Object execute(ExecutionEvent event) throws ExecutionException { | 30 | public Object execute(ExecutionEvent event) throws ExecutionException { |
31 | assert scriptExecutor != null : "Injector must be set"; | ||
23 | ISelection selection = HandlerUtil.getCurrentSelection(event); | 32 | ISelection selection = HandlerUtil.getCurrentSelection(event); |
24 | if(selection instanceof StructuredSelection) { | 33 | if(selection instanceof StructuredSelection) { |
25 | StructuredSelection structuredSelection = (StructuredSelection) selection; | 34 | StructuredSelection structuredSelection = (StructuredSelection) selection; |