[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: Getting a preference page

jamsden@xxxxxxxxxxxxxxxxxxxxxx wrote:

>I'm trying to get a reference to my preference page in my editor's 
>createPartControl() method. The following:
>
>    preferencesPage = 
>(FormPreferencesPage)WorkbenchPlugin.getDefault().getPreferenceManager().find("co>m.ibm.eclipse.examples.formeditor.formPreferencesPage");
>
>always returns null. Is this because I don't have the path correct? The 
>preference class isn't loaded yet? I listed the preference nodes in the 
>preference manager just before this query, and the node id was there, but 

>I can't seem to get the page.

The preference manager was not being initialized correctly. 
A temp fix for this is to change the second line of 
com.ibm.eclipse.internal.ui.WorkbenchPlugin.getPreferenceManager()
to  
preferenceManager = new PeferenceManager('/');

The argument to the find method must be the node's full path. Thus if you 
have included a category in the preference page's extension definition, 
the category must preceed the page's id (separated by a '/').