Plug-in Customization

Plug-in Customization in Eclipse 2.1

The Eclipse Help page describing how to customize your plug-in.

1. Set default preference values calculated at runtime.

Call the Plugin#initializeDefaultPluginPreferences() method which is implemented by subclasses of org.eclipse.core.runtime.Plugin.

2. Load from the plug-in install directory.

Load defaults from the preferences.ini file in the plug-in's installation directory such as: c:/eclipse/plugins/org.eclipse.core.resources_2.0.0/preferences.ini

3. Load from the primary feature's plug-in.

Load defaults from the plugin_customization.ini file in the primary feature's plug-in directory. c:/eclipse/plugins/org.eclipse.platform_2.0.0/plugin_customization.ini

4. Load defaults from the command line.

Users are able to specify the -pluginCustomization <filename> command-line argument which tells the platform to load preference values from the specified file.

 

Plug-in Customization in Eclipse 3.0

1. Set preference values calculated at runtime.

The org.eclipse.core.runtime.preferences extension point allows for an extension which defines a initializer element. This extension defines a class which extends AbstractPreferenceInitializer. The #initializeDefaultPreferences() method is called on the subclass.

If the bundle/plug-in doesn't define an extension then the #initializeDefaultPluginPreferences() method is called on the plug-in class if the runtime compatibility layer is present. Due to visibility restrictions, this is done via the Plugin#internalInitializeDefaultPluginPreferences() method.

2. Load from bundle/plug-in install dir.

Same as with Eclipse 2.1. Load preference default values from the preferences.ini file in the bundle's install directory.

3. Load defaults from customization file as specified by the product.

Defaults are loaded from the URL as specified by the preferenceCustomization property in the product.

For backwards compatibility if a feature does not define a product, then the Update code will automatically fill in this property value to be the plugin_customization.ini file in the primary feature's plug-in install directory.

4. Load defaults from file specified by command-line option.

Same as Eclipse 2.1. Load preference default values from the file specified by the -pluginCustomization command-line argument.