FAQ Can I add icons declared by my plugin.xml in the runtime JAR?

From Eclipsepedia

Revision as of 14:50, 14 March 2006 by Claffra (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

No. Statically declared plug-in icons are not meant to be in the runtime JAR because Eclipse wants to load plug-ins lazily. In other words, during loading of the platform, the platform loader reads only the plugin.xml file and will use the icons that are declared there. Only when the plug-in is really needed is the JAR opened; the class loader starts loading classes, and the plug-in is activated.

The structure of a plug-in roughly looks like this:

     plugin.xml         // used by platform loader
     icons/
         delete.gif     // icons used in the toolbar, and so on.
         create.jpg
     code.jar         // jar (class files + resources)

Plug-in activation is a process that requires considerable memory and central processing unit (CPU) cycles. To speed up load time of the platform, opening the runtime JAR is avoided for as long as possible.


Of course, images included in a runtime JAR can be used by plug-in code using standard Java resource-loading techniques, such as getResource on a given Java class or by using a class loader.



See Also:

FAQ_How_do_I_add_images_and_other_resources_to_a_runtime_JAR_file?


FAQ_When_does_a_plug-in_get_started?