Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » PreferenceNode is null when opening the PreferencesDialog(when creating PreferencePage programmatically)
PreferenceNode is null when opening the PreferencesDialog [message #897355] Mon, 23 July 2012 17:28
Sandra Mendes is currently offline Sandra MendesFriend
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
Previous Topic:Unable to load UI Activator
Next Topic:Overriding only few of the Windows ShortKeys and keeping all other Eclipse key as it is in my RCP.
Goto Forum:
  


Current Time: Fri Dec 06 23:28:59 GMT 2024

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

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

Back to the top