Trying to create preference page with field editors, getDefault always return null [message #172864] |
Thu, 28 September 2006 08:03  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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?)
|
|
|
Powered by
FUDForum. Page generated in 0.13073 seconds