Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » why does the AbstractPreferenceInitializer never get called?
why does the AbstractPreferenceInitializer never get called? [message #321714] Wed, 24 October 2007 18:27 Go to next message
Paul E. Keyser is currently offline Paul E. Keyser
Messages: 878
Registered: July 2009
Senior Member
WinXP, R3.3 (I20070621-1340)

Several prior threads insist that the AbstractPreferenceInitializer will
automagically get run when it is needed. See:
"How to load default preferences ?"
"Setting the default values for preferences"

But when I declare an AbstractPreferenceInitializer like this (actually,
I used the template in the extension-point wizard):

<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="com.mun.ist.viewer.preferences.PreferenceInitializer ">
</initializer>
</extension>

and implement the sole method of PreferenceInitializer, setting a
breakpoint on the method shows that it is *NEVER* called, not even when
I open the pref-page, and certainly not when I access the preference-value.

So -- what else needs to be done to wire this up? (The extension-point
description says nothing about extra wiring.)

The workaround -- in case others are having this problem -- is just
this, in the Activator:

public void start(BundleContext context) throws Exception {
super.start(context);
new PreferenceInitializer().initializeDefaultPreferences();
}

thanks,
Paul
Re: why does the AbstractPreferenceInitializer never get called? [message #688264 is a reply to message #321714] Fri, 24 June 2011 09:49 Go to previous message
hobbes_infect is currently offline hobbes_infect
Messages: 1
Registered: June 2011
Junior Member
I experienced the same problems but it worked fine after adding

IPreferenceStore store = Activator.getDefault().getPreferenceStore();
setPreferenceStore(store);


to the preference page constructor.
Previous Topic:Where to call external compiler
Next Topic:confused about Indigo release
Goto Forum:
  


Current Time: Sun Sep 21 00:08:03 GMT 2014

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

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