Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » initializeDefaultPreferences not being called
initializeDefaultPreferences not being called [message #293871] Mon, 31 October 2005 18:31 Go to next message
Eclipse UserFriend
Hello,

I'm running Version: 3.1.1 Build id: M20050929-0840 on Mac OS X 10.4.2
with java 1.4.2_09. I have two plugins that include preferences, P1 and
P2. P1 includes several classes extending FieldEditorPreferencePage
extensions and a class extending AbstractPreferenceInitializer which set
various defaults. The plugin.xml for P1 includes:

<extension
point="org.eclipse.ui.preferencePages">
<page
name="P1 Preferences Page1"
class="org.abc.def.preferences.Page1"
id="org.abc.def.preferences.PreferenceRoot">
</page>
....
</extension>

and

<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="org.abc.def.preferences.PreferenceInitializer">
</initializer>
</extension>

The application properly shows the various P1 preference pages filled in
with the defaults per the PreferenceInitializer.

So now I have added plugin P2 which has it's own preferences. I have
defined a FieldEditorPreferencePage extension and an extension of
AbstractPreferenceInitializer as with P2. In the plugin.xml for P2 is:

<extension
point="org.eclipse.ui.preferencePages">
<page
name="P2 Preferences Page"
class="org.abc.xyz.preferences.Page"
category="org.abc.def.preferences.PreferenceRoot"
id="org.abc.xyz.preferences.Preference">
</page>
</extension>

and

<extension
point="org.eclipse.core.runtime.preferences">
<initializer class="org.abc.xyz.preferences.PreferenceInitializer"/>
</extension>

The application shows the P2 preference page under the root for the P1
preference pages as expected; however, the P2 PreferenceInitializer is
never called??

I've verified that the class names are all correct in the Plugin
Manifest Editor. I've tried adding the P2 Preference Page as a page by
itself. None of the configurations that I've tried lead to the
PreferenceInitializer for P2 being called.

This seems like an absurdly simple mistake but I can't see it.

I appreciate any help.

Thanks,
Chris
Re: initializeDefaultPreferences not being called [message #293879 is a reply to message #293871] Tue, 01 November 2005 07:30 Go to previous messageGo to next message
Eclipse UserFriend
Are both initializers in the same plugin? If they are, what happens if
you put both initializers in the same extension instead of 2 separate
extensions?

Later,
PW
Re: initializeDefaultPreferences not being called [message #293882 is a reply to message #293879] Tue, 01 November 2005 09:46 Go to previous message
Eclipse UserFriend
No the initializers are in two separate plugins which I called P1 and P2
for the purposes of the report.

What I'm building is an application that has several plugins and for
which I am trying to manage the preferences for plugin P1 separately
from plugin P2 as is done with many other plugins.

The only wrinkle that I can see is that I wanted to have all the
preferences for plugin P1 and plugin P2 appear under a common root in
the preferences display and that I accomplished.

In all respects both plugin P1 and plugin P2 are loaded and perform as
expected and the individual preference contributions by P1 and P2 appear
correctly.

The only flaw is that only the initializer for P1 is called. The
initializer for P2 is never called. I verified this by the simple but
effective expedient of System.err.println and looking at the console
while running the application from the eclipse workbench. I also used
eclipse logging.

Thanks,
Chris


Paul Webster wrote:
> Are both initializers in the same plugin? If they are, what happens if
> you put both initializers in the same extension instead of 2 separate
> extensions?
>
> Later,
> PW
Previous Topic:How can I redirect runtime tracing information to a file?
Next Topic:Control characters in Console view
Goto Forum:
  


Current Time: Fri May 09 22:01:46 EDT 2025

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

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

Back to the top