在Eclipse中,可以为Eclipse以外的eclipse编写插件吗? [英] Is it possible to write plugin for eclipse other than Java, in Eclipse?

查看:152
本文介绍了在Eclipse中,可以为Eclipse以外的eclipse编写插件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮我在c ++中编写一个eclipse插件吗?

Can anyone help me to write a plugin for eclipse in c++?

@weekens和@celavek感谢信息。我正在通过JNI并尝试实现它。

@weekens and @celavek thanks for the information. I am going through JNI and will try to implement it.

@celavek:我们要做什么样的主控制?在C ++和java接口中处理风险较高。

@celavek: what kind of master/control we have to do? is it riskier to handle in C++ and java interface.

我的要求是在Java的首选项页面中添加我自己的属性,他们正在使用Propertypages包来执行此操作。但是在C ++中怎么做?

My requirement is to add my own property in Preference pages in Java they are using Propertypages package to do that. But how to do it in C++?

推荐答案

Eclipse框架是用Java编写的,整个插件基础架构是围绕着这个,这基本上意味着大多数时候,你必须用Java编写你的插件(还有其他的语言可能性与JVM一起使用,请参阅评论和关于Jython的注释)。然而,有可能使用C ++(或其他语言)编写一些插件功能,然后将C ++界面桥接到Java,这将使您的插件可用。为此,您可以尝试使用 JNI MS COM Mozilla XPCOM CORBA (您可以尝试 omniORB )或 Swig 。我已经与XPCOM和Swig合作过以前的工作,使这种接口成为可能 - 我们有一个用C ++编写的调试器引擎,我们通过XPCOM将接口/功能暴露给Eclipse Java插件。我相信有其他的选择,例如 Jython - 我一直在使用这一个在Python中编写一些小脚本,然后直接在Eclipse中公开。

The Eclipse framework is written in Java and the whole plugin infrastructure is built around that, which basically means that most of the times you would have to write your plugin in Java(there are other language possibilities to work with the JVM, see comments and the note about Jython below). However there are possibilities to have some of your plugin functionality written in C++(or other languages) and then bridge the C++ interface to Java which will make it available in your plugin. For that you could try using JNI, MS COM, Mozilla XPCOM, CORBA(you could try omniORB) or Swig. I have worked with XPCOM and Swig for a previous job to make this kind of interfacing possible - we had a debugger engine written in C++ and we were exposing the interface/functionality to Eclipse Java plugins via XPCOM. I'm sure there are others alternatives out there e.g. Jython - I've been using this one to write some small scripts in Python and then expose that directly in Eclipse.

请注意,这种接口有时可能会涉及到很多问题 - 您必须熟悉不同的技术和几种语言,并维护接口/代码在这两个世界 - 有时是一个痛苦,但很多次你可以取得非常好的结果。玩得开心。

Be aware that this kind of interfacing can get very involved sometimes - you would have to have a good knowledge of different technologies and a couple of languages and maintain the interfaces/code in both worlds - at times is a pain but many times you can achieve very nice results. Have fun.

这篇关于在Eclipse中,可以为Eclipse以外的eclipse编写插件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆