PreferenceNode is null when opening the PreferencesDialog [message #897355] |
Mon, 23 July 2012 17:28 |
Sandra Mendes Messages: 1 Registered: July 2012 |
Junior Member |
|
|
Hi,
I have a preference category Sample Preferences defined in my plugin.xml, and programmatically I add a preference node to it.
IPreferencePage page = new NewPreferencePage(test);
page.setTitle("First Title");
PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager();
PreferenceNode node = new PreferenceNode("newNode", page);
pm.addTo(
"SamplePreferencesID",
node);
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
PreferenceDialog pd = new PreferenceDialog(shell, pm);
pd.setPreferenceStore(Activator.getDefault().getPreferenceStore());
pd.create();
pd.open();
Running this code, it works fine. However, I want that the added nodes are saved in the preferences manager. This way, every time the preferences dialog is opened from the standard menu, the pages are presented. But at this moment, when I open the standard preference dialog, the Sample Preferences category is there (since it is statically defined) but the sub-node is a blank line, that if selected triggers a null pointer. It seems that the PreferenceNode is null.
Any help would be appreciated since I have no more ideas how this can be done.
Thanks,
Sandra
|
|
|
Powered by
FUDForum. Page generated in 0.03870 seconds