Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to load default preferences ?
How to load default preferences ? [message #308875] Fri, 06 October 2006 13: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 16: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 21:00 Go to previous messageGo to next message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
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 23: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 23:42 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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 06: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] Wed, 11 October 2006 00:34 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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 07:33 Go to previous message
Roland Tepp is currently offline Roland TeppFriend
Messages: 336
Registered: July 2009
Senior Member
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: Thu Jul 18 06:23:24 GMT 2024

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

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

Back to the top