Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to load default preferences ?
How to load default preferences ? [message #308875] Fri, 06 October 2006 09:51 Go to next message
Eclipse UserFriend
Originally posted by: priya_kothari.persistent.co.in

Hi,

I want my plugin to load the default preferences given in the Preference
page. I have overridden initializeDefaultPluginPreferences() method in my
plugin class and have set the default values in the preference store. But
this API is not getting called and so my default values are not getting
loaded. If I call this API explicity, I can see the default values.

Am I missing something that calls the API mentioned which I might not have
overridden?
Here my default values are used to decorate the text in Package explorer.

~Priya
Re: How to load default preferences ? [message #308878 is a reply to message #308875] Fri, 06 October 2006 12:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.ddress.now

In article <eg5n3d$fth$1@utils.eclipse.org>,
priya_kothari@persistent.co.in says...
> Hi,
>
> I want my plugin to load the default preferences given in the Preference
> page.

One way is to use the extension point
"org.eclipse.core.runtime.preferences" to specify an initializer class
that extends AbstractPreferenceInitializer.
Re: How to load default preferences ? [message #308885 is a reply to message #308878] Fri, 06 October 2006 17:00 Go to previous messageGo to next message
Eclipse UserFriend
But that only runs when the user opens the "Prefs" dialog (Window -> Prefs -> MyPage), right?

What if one wants to ensure that the default values are set when the app starts so that client code
can use the preferences before the user goes and checks the values?

thanks,
Paul
Re: How to load default preferences ? [message #308886 is a reply to message #308885] Fri, 06 October 2006 19:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.ddress.here

In article <eg6g5c$jhl$1@utils.eclipse.org>, rolarenfan@earthlink.net
says...
> But that only runs when the user opens the "Prefs" dialog (Window -> Prefs -> MyPage), right?

Believe that it runs when the Plugin loads -- it is a core runtime
extension.

> What if one wants to ensure that the default values are set when the app
> starts so that client code
> can use the preferences before the user goes and checks the values?

If use of the extension point is not desired for some reason, the
AbstractUIPlugin#start() method (overridden from the plugin activator
class) is available.
Re: How to load default preferences ? [message #308909 is a reply to message #308885] Mon, 09 October 2006 19:42 Go to previous messageGo to next message
Eclipse UserFriend
Paul Keyser wrote:
> But that only runs when the user opens the "Prefs" dialog (Window ->
> Prefs -> MyPage), right?
>
> What if one wants to ensure that the default values are set when the app
> starts so that client code can use the preferences before the user goes
> and checks the values?
>

There's also a way to specify an initializer when you create your
preference. It's only loaded if something needs to read your preference.

Later,
PW
Re: How to load default preferences ? [message #308922 is a reply to message #308909] Tue, 10 October 2006 02:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: priya_kothari.persistent.co.in

Could you tell that way of specifying the initializer?
My problem got resolved when I used the extension
"org.eclipse.core.runtime.preferences"


"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:egempj$31q$1@utils.eclipse.org...
> Paul Keyser wrote:
>> But that only runs when the user opens the "Prefs" dialog (Window ->
>> Prefs -> MyPage), right?
>>
>> What if one wants to ensure that the default values are set when the app
>> starts so that client code can use the preferences before the user goes
>> and checks the values?
>>
>
> There's also a way to specify an initializer when you create your
> preference. It's only loaded if something needs to read your preference.
>
> Later,
> PW
Re: How to load default preferences ? [message #308939 is a reply to message #308922] Tue, 10 October 2006 20:34 Go to previous messageGo to next message
Eclipse UserFriend
Priya wrote:
> Could you tell that way of specifying the initializer?
> My problem got resolved when I used the extension
> "org.eclipse.core.runtime.preferences"
>
>

It's part of org.eclipse.core.runtime.preferences :-)

In the PDE editor, which you are adding the extension select it and
"Open extension point description" That will take you to the page that
explains how to specify an initializer class and what you must subclass.

Later,
PW
Re: How to load default preferences ? [message #309001 is a reply to message #308885] Fri, 13 October 2006 03:33 Go to previous message
Eclipse UserFriend
Rest assured - the preferences get initialized as soon as they are
accessed for the first time, so any time you might want to access them,
they are there...

Paul Keyser kirjutas mulle midagi seesugust:
> But that only runs when the user opens the "Prefs" dialog (Window ->
> Prefs -> MyPage), right?
>
> What if one wants to ensure that the default values are set when the app
> starts so that client code can use the preferences before the user goes
> and checks the values?
>
> thanks,
> Paul

--
Roland Tepp
Previous Topic:Turn Swing app into plugin?
Next Topic:Eclipse Editors
Goto Forum:
  


Current Time: Sat May 03 15:20:23 EDT 2025

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

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

Back to the top