|
Re: EOL Show user messages / modeler [message #899915 is a reply to message #899908] |
Thu, 02 August 2012 20:11 |
|
Hi Eva,
If I understand correctly you will need two things:
1. A menu entry to invoke your eol program
2. The epsilon standalone version, or call the epsilon task from java (run an Ant file)
1. I would start off by creating a new Plugin project. In the wizard choose the plugin template that "adds components to the UI", so that the correct dependencies are loaded. You should read about creating menus and commands, but in short you need to add "extension points" to your plugin. I like to edit the plugin.xml file my self, but you can also do it from the extensions tab of the plugin manifest view. At the end you should have something in the lines of:
<plugin>
<extension point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup?after=myPlugin.myMenu">
<command
commandId="myPlugin.myCommand"
style="push" >
</command>
</menuContribution>
</extension>
<extension point="org.eclipse.ui.commands">
<command
description="MyCommand"
id="myPlugin.myCommand"
name="%command.name">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler
class="myPlugin.myMenuHandler"
commandId="myPlugin.myCommand">
</handler>
</extension>
</plugin>
In the org.eclipse.ui.handlers extension point you define the class that handles the command. For this you should create a Java class that extends AbstractHandler and implements iHandler:
public class myMenuHandler extends AbstractHandler implements IHandler {
/* (non-Javadoc)
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
/* Insert your handling code here */
return this;
}
}
Your handling code should first retrieve the current editor file (your model) and then invocation of the eol file.
2. For the eol invocation choose what works best for you. When it says "register your "ecore metamodel", you should right click over your ecore metamodel and then click on the "Register EPackages" option. Then in your handling code you need to invoke the epsilon standalone class and pass it the path to the model you retrieved previously. If you decide to invoke the Ant (execute the launch file) you should add some code that does that and that passes the model info to the Ant environment.
I know it is a lot of information and that I am letting some details out, but the idea is that you get the general idea. If you have further specific questions keep posting them here.
Regards,
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
|
Powered by
FUDForum. Page generated in 0.03289 seconds