简体   繁体   English

如何将Eclipse组件/插件嵌入到我的Java应用程序中?

[英]how can I embed Eclipse components/plugins into my Java app?

Is it possible to embed Eclipse plugins and componenets into my application? 是否可以将Eclipse插件和组件嵌入到我的应用程序中? Sort of like how in Netbeans. 有点像Netbeans。

There is a lot of viewpoints to this question. 这个问题有很多观点。 Generally, including Eclipse plug-ins is possible (it's all Java in the end). 通常,包括Eclipse插件是可能的(最终它都是Java)。 However, as Eclipse is a large framework, plug-ins will make excessive usage of framework specific calls. 但是,由于Eclipse是一个大型框架,插件将过度使用特定于框架的调用。 The whole invocation process is unique in Eclipse. 整个调用过程在Eclipse中是唯一的。 In addition, the GUI will be based on SWT/JFace. 此外,GUI将基于SWT / JFace。 You might investigate which dependencies the plug-in has and include all of these, but this will give you quite a large overhead of includes. 您可以调查插件具有哪些依赖项并包含所有这些依赖项,但这会给您带来相当大的包含开销。

You can of course rip them apart and implement the "business logic", but there's no plug and play ! 你当然可以拆开它们并实现“业务逻辑”,但是没有即插即用

If you used Eclipse RCP as the base for your Java application things are of course a lot easier. 如果您使用Eclipse RCP作为Java应用程序的基础,那么事情当然要容易得多。

As mentioned by Jules, I really think the way to go is putting your application into an Eclipse plug-in and making this new plugin an executable application. 正如Jules所提到的,我真的认为可行的方法是将您的应用程序放入Eclipse插件中,并使这个新插件成为可执行应用程序。

See the following link on how to configure your plugin to do that : http://wiki.eclipse.org/FAQ_How_do_I_create_an_application%3F 请参阅以下链接,了解如何配置插件以执行此操作: http//wiki.eclipse.org/FAQ_How_do_I_create_an_application%3F

But in all cases you have to take a great care on the dependencies that can bring you a lot of overhead... 但是在所有情况下你都必须非常谨慎地依赖可能给你带来很多开销的依赖...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM