简体   繁体   English

基于Eclipse RCP功能的项目

[英]Eclipse RCP feature based project

Hello to understand how to work with features I build this plugins, feature and App. 您好,以了解如何使用我构建的插件,功能和应用程序的功能。

myPluginOne - One.class with hello world print method. myPluginOne-具有hello world打印方法的One.class。 myPluginTwo - Two.class with hello Galaxy print method. myPluginTwo-具有Hello Galaxy打印方法的Two.class。 myFeature - Included plugins, myPluginOne and myPluginTwo. myFeature-包含的插件myPluginOne和myPluginTwo。

myApp - Eclipse RCP Application, product configuration is feature based (selected in overview tab). myApp-Eclipse RCP应用程序,产品配置基于功能(在概述选项卡中选择)。 I added in tab "Contents" of the product file the feature "myFeature". 我在产品文件的“目录”选项卡中添加了功能“ myFeature”。

Ok, now I created in "myApp" a new Class with a method to execute this Code. 好的,现在我在“ myApp”中创建了一个新类,该类具有执行此代码的方法。

One o = new One();
o.print();

Now the completely brain destroying begins. 现在,完全的大脑毁灭开始了。 "One can not be resolved to a type". “一个不能解析为一个类型”。 Why not? 为什么不? I added "myFeature" to myApp and myFeature includes "myPluginOne" so why its not working? 我在myApp中添加了“ myFeature”,而myFeature包含了“ myPluginOne”,那么为什么它不起作用?

Export the right packages right? 导出正确的软件包对吗? Ok, now I export the right package in "myPluginOne".Tab Runtime -> Exported Packages -> Add 好的,现在我在“ myPluginOne”中导出正确的包。Tab运行时->导出的包->添加

"One can not be resolved to a type" “一个无法解析为一种类型”

Hmm what to do? 嗯怎么办? Ok let say import package in myApp. 好吧,说在myApp中导入包。 Done, open plugins.xml -> Dependencies Tab - Imported Packages -> Add 完成后,打开plugins.xml->依赖项选项卡-导入的软件包->添加

Now it works! 现在可以了!

But hey wait, let do something special. 但是,嘿,等等,让我们做一些特别的事情。 Now I delete the entire Feature "myFeature" and remove it from "myApp". 现在,我删除整个功能“ myFeature”,并将其从“ myApp”中删除。

Its still works! 它仍然有效! So, like myFeature is completely useless. 因此,就像myFeature完全没有用。 To run in this way I dont need it. 以这种方式运行,我不需要它。 Why I need any Feature Projects, at the end of the day I added plugins... 为什么我需要任何功能项目,在一天结束时我添加了插件...

Pls after I read like entire Internet about features. 请阅读完有关整个功能的互联网后, Pls some one explain me. 请有人向我解释。

How to use Features correctly. 如何正确使用功能。

Features are a way to group plugins together and are most useful when you have a large RCP with lots of plugins. 功能是将插件分组在一起的一种方式,当您拥有一个带有大量插件的大型RCP时,功能最为有用。 They are nothing to do with the export/import package part of the plugin system. 它们与插件系统的导出/导入包部分无关。

Eclipse itself is a good example of using features. Eclipse本身就是使用功能的一个很好的例子。 This is a screen shot of the features in my Eclipse installation: 这是Eclipse安装中的功能的屏幕截图:

功能清单

This feature page of the installed software dialog gives a good overview of what Eclipse features I have. 已安装软件对话框的此功能页面很好地概述了我具有的Eclipse功能。

Additionally when using the product build if you use 'plugin based' you will end up having to list a large number of plugins which can be hard to manage. 另外,在使用产品版本时,如果您使用“基于插件”,则最终将不得不列出大量难以管理的插件。 Using a 'feature based' build you will only have a small number of features. 使用“基于功能”的构建,您将只有少量功能。 For example this is one of my (quite large) e4 RCP content configurations: 例如,这是我的(很大)e4 RCP内容配置之一: 内容配置 The plugin based equivalent would have over a hundred plugins listed. 基于插件的等效项将列出一百多个插件。

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

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