Skip to main content



      Home
Home » Newcomers » Newcomers » Trying to create preference page with field editors, getDefault always return null
Trying to create preference page with field editors, getDefault always return null [message #172864] Thu, 28 September 2006 08:03 Go to next message
Eclipse UserFriend
Originally posted by: Goran.Oberg.ludd.ltu.se

Hi all,

I feel this will look like a newbie error to many of you and therefore
decided to post it here in newcomers. (:

I'm putting together a preference page for a plugin I'm writing with
field editors.

The problem I have is that when the preference framework in Eclipse
invokes createFieldEditors() (in my class extending
FieldEditorPreferencePage and implementing IWorkbenchPreferencePage), I
can't get hold of a IPreferenceStore because there's always a null from
the call to <mypluginclass>.getDefault(). In other words, the plugin
object has not been created yet.

I've looked at the source of other plugins that's doing pretty much the
same thing that I try to do, but I can't find what initializations are
done there that I've missed.

Any suggestions? I guess it's just a really trivial mistake or oversight. (:


Thanks in advance

/G
Re: Trying to create preference page with field editors, getDefault always return null [message #172895 is a reply to message #172864] Thu, 28 September 2006 15:02 Go to previous message
Eclipse UserFriend
Originally posted by: olivier.frouin.club-internet.fr

Göran Öberg a écrit :
> Hi all,
>
> I feel this will look like a newbie error to many of you and therefore
> decided to post it here in newcomers. (:
>
> I'm putting together a preference page for a plugin I'm writing with
> field editors.
>
> The problem I have is that when the preference framework in Eclipse
> invokes createFieldEditors() (in my class extending
> FieldEditorPreferencePage and implementing IWorkbenchPreferencePage), I
> can't get hold of a IPreferenceStore because there's always a null from
> the call to <mypluginclass>.getDefault(). In other words, the plugin
> object has not been created yet.
>
> I've looked at the source of other plugins that's doing pretty much the
> same thing that I try to do, but I can't find what initializations are
> done there that I've missed.
>
> Any suggestions? I guess it's just a really trivial mistake or
> oversight. (:
>
>
> Thanks in advance
>
> /G
You should extend AbstractPreferenceInitializer and set it as an
Initializer for (extending org.eclipse.core.runtime.preferences)

(Dis you try to create a new projet with 'plugin with preference' wizard?)
Previous Topic:How to make "*.jelly" be treated exactly like an XML file?
Next Topic:References and Declarations search internal error
Goto Forum:
  


Current Time: Sun Jul 27 08:20:37 EDT 2025

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

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

Back to the top