Planned changes to the plug-in registry API and implementation

Last update: April 23, 2003

Summary of planned changes:

Provide API for fragments in the platform registry

Related bugs:

The platform registry API, whose starting point is the Platform.getPluginRegistry(), provides access to descriptors for the plug-ins in the registry but not for the fragments. Fragments provide objects (pre-requisites, libraries, extensions, extension points) that are combined with those in the plug-in they associate to during the registry resolution process.

Requisites:

Proposed solution:

Notes:

Currently, clients rely on the fact that the implementations for plug-in registry interfaces in org.eclipse.core.runtime extend the corresponding model classes in org.eclipse.core.runtime.model. This is not specified - we should document if this is expected or disallowed (and we would be able to change the implementation hierarchy for those classes).

Provide modular way to externalize strings in fragment.xml

Related bugs:

From Jeem's comments in bug 18617:

"Externalized strings for all plug-in fragments must be placed in the their plug-in's "plugin.properties" resource bundle. In other words, a fragment's strings must be merged into the main plug-in's file. Although this is not very modular, it does at least allow strings to be externalized and translated."

Requisites:

Proposed solution:

From Jeem's comments in bug 18617:

"In order to dovetail with existing mechanisms, each fragment must have its own *.properties files. It would be a non-started if these *.properties files all had the same name (e.g., "fragment.properties"), since all OS-specific fragments would collide on this name making it impossible to spuuly translations for any of they. It is therefore essential that each fragment get a distinctively named *.properties file. The simplest way to arrange this is to add a new attribute to the <fragment> element to specific the name of the properties file; e.g., resource-bundle="win32fragment" would mean that the file named "win32fragment.properties" would contain the translated strings ("win32fragment" is the base name of the property resource bundle, in Java parlance).

The attribute would also be meaningful on a <plugin> element. If the attribute is omitted, the default resource bundle base name is "plugin". This makes the new story upwards compatible with the current story where all "%vars" in the plugin.xml and in all the fragment.xmls get resolved in the plug-in's property resource bundle "plugin.properties"."

Methods in the model objects return strings as they appear in the manifest file. Clients that want those strings properly translated should (as suggested in bug 18339) call IPluginDescriptor#getResolvedString(String) and the new proposed method IFragmentDescriptor#getResolvedString(String).

Also, since the ".properties" file may be anywhere in th plug-in's classpath, the fragment descriptor implementation should ask its plug-in descriptor for the path where to look for it (what requires a fix for bug 35992).

Provide API for checking if a given plug-in descriptor element has been contributed by a fragment

Related bugs:

Fragments provide objects (pre-requisites, libraries, extensions, extension points) that are combined with those in the plug-in they associate to during the registry resolution process.

Requisites:

Proposed solution: