加速插件
我需要做一个 Eclipse 插件,在其中,我将使用我自己制作的 Acceleo 生成器。 如何在 Eclipse 插件中使用 acceleo 生成器? 有相关的文档吗?
谢谢。
I need to do an Eclipse plug-in and,inside of it, I will use an Acceleo generator made by my self.
How I can use an acceleo generator inside an Eclipse plug-in?
Is there any documentation about it?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是简单地创建一个新的 Acceleo 项目(文件 > 新建 > 其他... > Acceleo 模型到文本 > Acceleo 项目),因为这些项目已经是插件项目。当您在此项目中编写自己的 Acceleo 模块(
mtl
文件)时,您会注意到在它们旁边生成了“java”文件。这些 Java 文件是启动 Acceleo 各代的入口点。然后,您可以选择如何启动生成:从 Java 文件(实例化生成器,然后从 Eclipse 右键单击操作调用其“doGenerate”方法...)。
您可以使用“文件 > 新建 > 其他... > Acceleo 模型到文本 > Acceleo UI 启动器项目”向导来获取启动 Acceleo 模块的右键单击操作的代码示例。
在线文档包含有关这些方面。
The easiest way would be to simply create a new Acceleo project (File > New > Other... > Acceleo Model To Text > Acceleo Project) as these projects are already plug-in projects. As you write your own Acceleo modules (
mtl
files) within this project, you'll notice that "java" files are generated beside them. These Java files are your entry point in order to launch Acceleo generations.It is up to you, then, to choose how to launch the generation : from a Java file (instantiate the generator, then call its "doGenerate" method, from an Eclipse right-click action ...).
You can use the "File > New > Other... > Acceleo Model To Text > Acceleo UI Launcher Project" wizard in order to get a code example for a right-click action launching an Acceleo module.
The online documentation contains some information on these aspects.