1

我们当前的 C++ 项目是使用普通文本编辑器开发的(未使用 IDE)。它最近与 CDT 一起被放到了 eclipse 上。现在,需要为我们的项目(一个 C++ 项目)开发新的插件。需要知道为eclipse(CDT)开发插件的最佳方法是什么

我听说可能的方法是 Jave PDE-->JNI-->C++。谁能帮我用 C++ 编写一个 Eclipse 插件。

4

1 回答 1

0

In general, the best approach for developing plugins is to use a JVM language that can extend Java classes, implement Java interfaces, and instantiate and invoke methods in Java objects—notably Java.

Once you have that, you could delegate parts of the implementation using whatever technology you wish, such as JNI, JNA, RMI, LuaJ, Jace etc. It would be no different for an Eclipse plugin than any other program. The problem being the degree to which the delegated code has to callback into the JVM to do it's job.

In the trivial and near trivial cases, a plugin doesn't need any code but, obviously, it's contribution would be quite limited. One example is providing documentation. It all depends on what extension points it uses require.


But, if all you want is a project Builder that doesn't need to integrate much with CDT, you might not need your own plugin to do it. Eclipse provides an Ant builder and an External Program builder. See this article. With either of them, you could do things like code generation, inspections, or packaging.

于 2013-07-07T15:25:03.087 回答