Documentation:Tips and Tricks
From AcceleoWiki
General
Custom Actions
How to make a new custom action with Acceleo.
First of all, you have to create a new plug-in project in Eclipse. It must not be rich client application nor have template.
In “plugin.xml”, you have to add dependencies you need plus plug-ins “fr.obeo.acceleo.chain” and “fr.obeo.acceleo.gen”. You have to define the extension of “fr.obeo.acceleo.chain.custom” (Eclipse should have done it automatically).
Now, create the class implementing “IchainCustomAction” and overriding method run (signature in annexe)
You next should give a customId and define the actionClass for your extension element (named “action1” by default). The actionClass is the class implementing run. There is only one actionClass by CustomAction but many CustomAction as you want.
Time to code your CustomAction and build.
Export your project as “Deployable plug-ins and fragments”. (include source code if you want to). Then copy your brand new jar in <inst-dir>/eclipse/plugin and reboot Eclipse.
You now should be able to select your custom action in your chain.
Annexe
public void run(Data[] resources, CChain arg1, IGenFilter arg2, IProgressMonitor arg3, LaunchManager arg4) throws CoreException
Cheers.
PS : Désolé, je ne savais pas où le poster et je n'ai pas le temps de chercher l'endroit idéal.
Performance
- It is more efficient to use eAllContents("Class") than eAllContents.filter("Class")
