schema.preferences.exsd Maven / Gradle / Ivy
The newest version!
The preferences extension point allows plug-ins to add new preference scopes to the Eclipse preference mechanism as well as specify the class to run to initialize default preference values at runtime.
Element describing a client's definiton of a new preference scope.
The name of the scope.
The name of the class.
The class which implements the preference storage.
Element which defines the class to use for runtime preference initialization.
The name of the class.
Element which defines the class to use for preference modification listening.
The name of the class.
3.0
Following is an example of a preference scope declaration. This example declares that this plug-in will provide a preference implementation for the scope "foo". It also declares that when the default values are loaded for this plug-in, the class "MyPreferenceInitializer" contains code to be run to initialize preference default values at runtime.
<p>
<pre>
<extension point="org.eclipse.core.runtime.preferences">
<scope name="foo" class="com.example.FooPrefs"/>
<initializer class="com.example.MyPreferenceInitializer"/>
<modifier class="com.example.MyModifyListener"/>
</extension>
</pre>
</p>
If the client chooses to let the Eclipse Platform handle the preference nodes but wishes to define a custom location/mechanism for persisting the data, then they are able to set the "storage" attribute on the "scope" element. Note that only one of the "class" and "storage" attributes can be defined at the same time. The class referenced in the "storage" attribute must extend the AbstractPreferenceStorage class. In the following example the "FooStorage" class handles the loading/saving for the "foo" preferences.
<p>
<pre>
<extension point="org.eclipse.core.runtime.preferences">
<scope name="foo" storage="com.example.FooStorage"/>
<initializer class="com.example.MyPreferenceInitializer"/>
<modifier class="com.example.MyModifyListener"/>
</extension>
</pre>
</p>
Supplied preference initializers must subclass <code>org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer</code>. Preference modify listeners must subclass <code>org.eclipse.core.runtime.preferences.PreferenceModifyListener</code>. The preference service (obtained by calling <code>org.eclipse.core.runtime.Platform.getPreferencesService()</code>) is the hook into the Eclipse preference mechanism.
The org.eclipse.core.runtime plug-in provides preference implementations for the "configuration", "instance", and "default" scopes. The org.eclipse.core.resources plug-in provides an implementation for "project" preferences.
Copyright (c) 2004, 2014 IBM Corporation and others.<br>
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0 which
accompanies
this distribution, and is available at
<a
href="https://www.eclipse.org/legal/epl-2.0">https://www.eclipse.org/legal/epl-v20.html</a>/
SPDX-License-Identifier: EPL-2.0