Eclipse 插件 - 节点和连接 +代码生成
我想创建一个 Eclipse 扩展来建模决策树/图。实际建模将使用图形界面(节点、连接等)来完成。我希望这个插件能够根据节点及其互连生成代码。我已经准备好了基础模型类;但是,我的图表非常大,仅通过代码很难管理所有连接。我想我会使用 GUI 构建整个图表。当我双击连接时,我希望能够重写它的一些方法,从而创建一个匿名子类。
我发现 GEF 用于类似的插件。我的目标插件在 GEF 中“可行”吗?你有什么建议吗?
I'd like to create an Eclipse extension modelling a decision tree/diagram. The actual modelling would be done using a graphical interface (nodes, connections etc). I'd like this plugin to generate code based on nodes and their interconnections. I have basic model classes ready; however, my diagrams are very large and it's difficult to manage all the connections only through code. I imagine I would build the whole diagram using GUI. When I double-click on a connection, I'd like to be able to override some of its methods, thus creating an anonymous subclass.
I found GEF used in similar plugins. Is my goal plugin "doable" in GEF? Do you have any advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的。 GEF 是在 Eclipse 中构建任何图形编辑器的基础。它对移动节点、放置连接、调色板等提供基本支持。其他框架位于 GEF 之上,如果您的需求符合其支持的场景,则可以使创建图形编辑器的任务变得更加容易。看一下 Eclipse Graphiti 项目。
Yes. GEF is the foundation for building any graphical editor in Eclipse. It has basic support for moving nodes, placing connection, palette, etc. Other frameworks sit on top of GEF to make the task of creating a graphical editor even easier if your requirements fit with their supported scenarios. Take a look at Eclipse Graphiti project.
我想说转基因食品对你的生活有帮助。 GMF 免费生成相当大的零件,并且还包括 EMF。
此外,GMF 具有高度可扩展性,因此如果您不喜欢它生成的某些内容,您可以覆盖这些部分。
这里有很好的 GMF 教程:http://wiki.eclipse.org/Graphical_Modeling_Framework/Tutorial
I would say that GMF is something that would help your life. GMF generates quite big parts for free, and also includes EMF.
Also GMF is highly extendeable, so if you don't like something it has generated, you can just override those parts.
There are good GMF tutorial here: http://wiki.eclipse.org/Graphical_Modeling_Framework/Tutorial