Eclipse书籍部分翻译(英译中)

来源:百度知道 编辑:UC知道 时间:2024/06/22 10:16:50
Plug-ins as JARs
Before diving into the different bundling techniques, it's worth looking at how plug-ins are typically structured. Traditional plug-ins are stored as a directory structure, as shown on the left of Figure 20-1. The directory contains the code JARs, metadata such as a plugin.xml and MANIFEST.MF, and other non-code resources.
As of Eclipse 3.1, plug-ins as JARs is more the rule. The bottom right of Figure 20-1 shows this new structure. Note that it is more than a simple JAR'ing of the plug-in directory. The non-code contents of the original plug-in, that is, the metadata and files around the plug-in's code JAR, are injected into the root of the code JAR itself. This flips things around a bit and looks at plug-ins as code JARs with some supporting metadata and extra files inside. This view is subtle, but quite powerful.
For example, the basic structure of a standard, non-Eclipse code library and a JAR'd plug-in are the samethey are both just

插件的罐子
在跳水到不同的捆绑技术,值得在研究如何插件通常是结构。传统的插件存储作为目录结构,显示在左边的图20-1 。该目录包含的代码罐,元数据,如plugin.xml和MANIFEST.MF ,以及其他非代码资源。
由于对Eclipse 3.1 ,插件的罐子更规则。右下角的图20-1表明这种新结构。请注意,它更不是简单JAR'ing的插件目录中。非代码的内容原来的插件,这就是元数据和文件的插件的代码JAR文件,是注入的根源代码JAR文件本身。这翻转的事情围绕着位,并期待在插件代码罐子一些支持元数据和额外的文件内。这种观点是微妙,但相当强大。
例如,基本结构,一个标准,非Eclipse的代码库和一个JAR'd插件是samethey都只是罐子。然后,更轻松,更自然的图书馆生产者仅仅包括额外的元数据捆绑在其MANIFEST.MF和船舶的图书馆作为一个独立的JAR和捆绑准备融入月食。如果所有的图书馆被运这种方式,你可以跳过其余的这一章!这一天可能会来,但在此同时,这种心态应该帮助你的过程中,捆绑图书馆要在Eclipse中使用。
右上角的图20-1显示了简单的JAR'ing传统的插件目录中。请注意,此结果在一个插件JAR文件包含嵌套代码罐子。第26章“的OSGi要点”和20.3节, “捆绑的包装纸, ”纲要的若干问题与这种结构。在这里,就足以说,插件这种形式可以使用,但它们都没有效率的速度和空间。
捆绑注射
正如你看到在上一节中, JAR文件可以作为插件,只要它们包含的数据所需要的Eclipse 。在这里,我们看看如何捆绑现有的代码库罐子注射他们这个Eclipse的数据。这种方法保留了所有的好处JAR'd插件和提高的机会图书馆作者将包括直接注入元在原来的releasesit直接说明了简单的必要的改革