有没有办法用Python创建Eclipse插件? [英] Is there a way to create Eclipse plugins with Python?

查看:191
本文介绍了有没有办法用Python创建Eclipse插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,默认情况下,Eclipse不会为用户提供python绑定。也没有任何这样的项目可以用谷歌找到。

As far as I understand Eclipse doesn't provide user with python bindings by default. Nor any projects of such kind was I able to find with google.

有没有任何第三方插件?任何教程?可能与Jython?..

Are there any third-party plugins for that? Any tutorial? May be with Jython?..

推荐答案

据我所知,您需要使用Java。 Eclipse是用Java编写的,甚至香草应用程序都是由核心插件加载器粘合在一起的几个Java组件组成的。如果有以下情况,Jython可能会工作:

As far as I know, you need to use Java. Eclipse is written in Java, and even the vanilla application is made up of several Java components glued together by the core plugin loader. Jython might work if:


  • 您可以将Python交叉编译为Java字节码(确实你可以,感谢你的指出),和

  • 你可以访问Eclipse API里面Jython。

  • you can cross-compile Python to Java bytecode (indeed you can, thanks to sayth for pointing that out), and
  • you can access the Eclipse APIs inside Jython.

所以,这里或多或少是插件的架构可能是什么样的。如果您可以获得Eclipse API,那么您可以在Jython中编写大部分内容,然后使用嵌入Jython 指令。

So, here's more or less what your plugin's architecture might look like. If you can get at the Eclipse APIs, then you can write most of it in Jython, and then make a Java wrapper for it with the Embedding Jython instructions.

如果您不能将Eclipse功能纳入Jython,那么您仍然可以编写一些python中的代码,然后在Java层上发生Eclipse API访问。这将使您的代码在python和Java之间的均匀分割成比例。我已经在一个项目上工作,在那里我们将python嵌入到C ++中(或者它可能是另一种方式...),如果你没有计划出来,这很重要。

If you can't get the Eclipse functionality into your Jython, then you can still write some of your code in python, and then have the Eclipse API access happening on your Java layer. This will be annoying in proportion to how evenly split your code is between python and Java. I've worked on a project before where we embedded python into C++ (or it might have been the other way around...), and it's a major headache if you don't plan it out right.

这篇关于有没有办法用Python创建Eclipse插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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