Execute main class in a package from a button - Eclipse RCP [message #1698562] |
Tue, 16 June 2015 08:27  |
Eclipse User |
|
|
|
Hello All,
I posted this question on the XText forum, but was redirected here, as the experts thought this is the best place for my query.
I am trying to develop an XText DSL editor for our end-users. I have packaged this DSL editor into an Eclipse RCP project. When I launch the Eclipse product and save the DSL script, XTend automatically generates code in the class in the folder src-gen, for the corresponding dsl file. So finally, the structure of the project looks like the following.
Project A
------Package org.tlf
-----------src
--------------Main.dsl
-----------src-gen
--------------Main.java
What I am trying without success, is when I click the 'save' button on the "Main.dsl" active page, the Main.java class needs to run. For this to work, first the src-gen folder needs to be programmatically added to the class path and the Main.java needs to be run, upon click on "Save".
To get the name of the dsl file (that corresponds to the Java class), the following works:
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
name[0] = activePage.getActiveEditor().getEditorInput().getName();
System.out.println(name[0]);
Is there a way to get the active project name and then the path to the Main.java class, so I could run it when I click on 'Save'.?
Many thanks for your time,
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05180 seconds