Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » What's the new story for Plug-In Preferences?
What's the new story for Plug-In Preferences? [message #249663] Fri, 04 June 2004 13:22 Go to next message
Eclipse UserFriend
Originally posted by: glongman.intelligentworks.nospam.com

Been following the javadoc around in RC1 and we're supposed to use the new
extension point "org.eclipse.core.runtime.preferences" now? but I don't
understand the scope element of that point.

Are there some docs on this? Searching the porting guide turned up nothing.

--
Geoff

Intelligent Works Inc.
Re: What's the new story for Plug-In Preferences? [message #249667 is a reply to message #249663] Fri, 04 June 2004 14:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dj_houghton.nospam.ca.ibm.com

The preferences extension point in 3.0 represents the story going
forward, and the plug-in preference code that you may have had before
will still work.

Initial docs are available from the Platform/Core team web site.

Short desc of "scope": In Eclipse 2.1 when you saved user settings, they
were saved with the workspace; each workspace had different settings.
For 3.0 and beyond we have created new "scopes" such as "configuration",
"instance" (equal to per-workspace), and "project". In general people
will not have to worry about the "scope" element unless they wish to
define a completely new type of prefs.

G Longman wrote:
> Been following the javadoc around in RC1 and we're supposed to use the new
> extension point "org.eclipse.core.runtime.preferences" now? but I don't
> understand the scope element of that point.
>
> Are there some docs on this? Searching the porting guide turned up nothing.
>
> --
> Geoff
>
> Intelligent Works Inc.
>
>
Re: What's the new story for Plug-In Preferences? [message #249690 is a reply to message #249667] Fri, 04 June 2004 14:33 Go to previous messageGo to next message
Eclipse UserFriend
DJ Houghton wrote:

> The preferences extension point in 3.0 represents the story going
> forward, and the plug-in preference code that you may have had before
> will still work.
>
> Initial docs are available from the Platform/Core team web site.

I am also keenly interested in this; one document I have found which
addresses this is the "Eclipse 3.0 Runtime Adoption Guide". If there
is another more appropriate document, I would appreciate a URL pointer.

The version of the "Runtime Adoption Guide" that I have retrieved from
CVS is dated February 24, 2004, and the sections on preferences contain
text which state "<xxx the preference mechanism is still in play>".

The JavaDoc for org.eclipse.core.runtime.Plugin gives some hints on
how to replace some of the legacy code, but what would help is a good
example of a new Plugin's lifecycle which included calls to the
appropriate preference-related methods.

The 3.0RC1 example plugin wizard still emits code which uses the
legacy form of preference management.

I'm pretty sure I can figure out how to use the new extension point
mechanics, and I'm sure they're better, but I'm not sure that what I
will come up with is the recommended way to use the API.

Thanks for all of the great work, though!

Tom Johnson
Re: What's the new story for Plug-In Preferences? [message #249703 is a reply to message #249667] Fri, 04 June 2004 14:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: glongman.intelligentworks.nospam.com

Thanks!

Geoff


"DJ Houghton" <dj_houghton@nospam.ca.ibm.com> wrote in message
news:c9qd59$211$1@eclipse.org...
> The preferences extension point in 3.0 represents the story going
> forward, and the plug-in preference code that you may have had before
> will still work.
>
> Initial docs are available from the Platform/Core team web site.
>
> Short desc of "scope": In Eclipse 2.1 when you saved user settings, they
> were saved with the workspace; each workspace had different settings.
> For 3.0 and beyond we have created new "scopes" such as "configuration",
> "instance" (equal to per-workspace), and "project". In general people
> will not have to worry about the "scope" element unless they wish to
> define a completely new type of prefs.
>
> G Longman wrote:
> > Been following the javadoc around in RC1 and we're supposed to use the
new
> > extension point "org.eclipse.core.runtime.preferences" now? but I don't
> > understand the scope element of that point.
> >
> > Are there some docs on this? Searching the porting guide turned up
nothing.
> >
> > --
> > Geoff
> >
> > Intelligent Works Inc.
> >
> >
Re: What's the new story for Plug-In Preferences? [message #249724 is a reply to message #249690] Fri, 04 June 2004 15:07 Go to previous messageGo to next message
Eclipse UserFriend
Tom Johnson schrieb:

> I'm pretty sure I can figure out how to use the new extension point
> mechanics, and I'm sure they're better, but I'm not sure that what I
> will come up with is the recommended way to use the API.

Remove all preference initialization methods from your plugin class
(they are also marked as deprecated from M9, if you use .runtime instead
of runtime.compatibility) and instead move that init code into a new
class that implements the new extension point (and look for
AbstractPreferenceInitializer or the like).

Ciao, Michael.
Re: What's the new story for Plug-In Preferences? [message #249742 is a reply to message #249690] Fri, 04 June 2004 16:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dj_houghton.nospam.ca.ibm.com

There is some documentation on the new prefs found on the Core team web
site here:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-core-home/documents/user_settings/index.html

The Runtime Adoption guide that you refer to is a little out of date
(obviously). It was the first attempt at describing what you need to do
to get your plug-in off the compatibility layer. The good news is
although the doc is out of date, the javadoc for the compatibility layer
methods contains the migration information.

I would recommend checking the javadoc of the methods that you are
interested in.

To answer your specific questions, #getPluginPreferences and
#savePluginPreferences are NOT deprecated (it was initially thought that
they might be so that's why they were referenced in that doc).

If you are initializing your default plug-in pref values via the old
method, it will still work. If you don't register an extension to the
new preferences extension point (see javadoc below and in the code),
then we will load your plug-in and call the old method on your plug-in
class.

Here is the javadoc for Plugin#initializeDefaultPluginPreferences():

This method has been refactored in the new preference mechanism to
handle the case where the runtime compatibility layer does not exist.
The contents of this method should be moved to the method named
#initializeDefaultPreferences() in a separate subclass of
org.eclipse.core.runtime.preferences.AbstractPreferenceIniti alizer. This
class should be contributed via the org.eclipse.core.runtime.preferences
extension point.

<extension point="org.eclipse.core.runtime.preferences">
<initializer class="com.example.MyPreferenceInitializer"/>
</extension>
....
package com.example;
public class MyPreferenceInitializer extends AbstractPreferenceInitializer {
public MyPreferenceInitializer() {
super();
}
public void initializeDefaultPreferences() {
MyPlugin.getPlugin().getPluginPreferences().setDefault(key, value);
}
}


Tom Johnson wrote:
> DJ Houghton wrote:
>
>> The preferences extension point in 3.0 represents the story going
>> forward, and the plug-in preference code that you may have had before
>> will still work.
>>
>> Initial docs are available from the Platform/Core team web site.
>
>
> I am also keenly interested in this; one document I have found which
> addresses this is the "Eclipse 3.0 Runtime Adoption Guide". If there
> is another more appropriate document, I would appreciate a URL pointer.
>
> The version of the "Runtime Adoption Guide" that I have retrieved from
> CVS is dated February 24, 2004, and the sections on preferences contain
> text which state "<xxx the preference mechanism is still in play>".
>
> The JavaDoc for org.eclipse.core.runtime.Plugin gives some hints on
> how to replace some of the legacy code, but what would help is a good
> example of a new Plugin's lifecycle which included calls to the
> appropriate preference-related methods.
>
> The 3.0RC1 example plugin wizard still emits code which uses the
> legacy form of preference management.
>
> I'm pretty sure I can figure out how to use the new extension point
> mechanics, and I'm sure they're better, but I'm not sure that what I
> will come up with is the recommended way to use the API.
>
> Thanks for all of the great work, though!
>
> Tom Johnson
>
>
Re: What's the new story for Plug-In Preferences? [message #249814 is a reply to message #249742] Fri, 04 June 2004 19:49 Go to previous message
Eclipse UserFriend
DJ Houghton wrote:

> There is some documentation on the new prefs found on the Core team web
> site here:
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-core-home/documents/user_settings/index.html

Thanks!

> The Runtime Adoption guide that you refer to is a little out of date
> (obviously). It was the first attempt at describing what you need to do
> to get your plug-in off the compatibility layer. The good news is
> although the doc is out of date, the javadoc for the compatibility layer
> methods contains the migration information.
>
> I would recommend checking the javadoc of the methods that you are
> interested in.

Thanks, see below.

>
> To answer your specific questions, #getPluginPreferences and
> #savePluginPreferences are NOT deprecated (it was initially thought that
> they might be so that's why they were referenced in that doc).

Even if the methods aren't deprecated, I'd rather get away from them
now.

> If you are initializing your default plug-in pref values via the old
> method, it will still work. If you don't register an extension to the
> new preferences extension point (see javadoc below and in the code),
> then we will load your plug-in and call the old method on your plug-in
> class.
>
> Here is the javadoc for Plugin#initializeDefaultPluginPreferences():

Thanks, that's what I meant when I said I thought I could figure it out;
I had already found the JavaDoc and the other hints.

Tom Johnson
Previous Topic:TableViewer disable cell
Next Topic:What's up with the Newsgroup server?
Goto Forum:
  


Current Time: Wed May 14 15:24:41 EDT 2025

Powered by FUDForum. Page generated in 0.04427 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top