Bug 174223 - [Preferences] PreferencesUtil.createPreferenceDialogOn should allow to display tree of nodes
Summary: [Preferences] PreferencesUtil.createPreferenceDialogOn should allow to displa...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2007-02-14 15:09 EST by Koen van Dijken CLA
Modified: 2019-09-06 15:32 EDT (History)
0 users

See Also:


Attachments
screenshot of pref.dialog (deleted)
2007-02-14 16:18 EST, Koen van Dijken CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Koen van Dijken CLA 2007-02-14 15:09:13 EST
Build ID: I20061102-1715

Steps To Reproduce:
PreferencesUtil.createPreferenceDialogOn should allow to display a page with id preferencePageId together with all its children (in a tree format, as usual)

I tried to determine to id's of subnodes of a certain page using IPreferenceNode.getSubNodes() but that does not work until these pages have been loaded once. Also, the PreferenceManager and PreferencePageRegistryReader do not have methods in them to build this tree of nodes ourselves.

Use case: in a RCP application which includes some (eclipse) plugins which contribute pages we do not want to show.



More information:
Comment 1 Koen van Dijken CLA 2007-02-14 15:47:26 EST
This code does it a bit, but still shows the top-level page which is used as the root container for all pages in this RCP. The toplevel page "myRCPPreferencePageId" is used as the single container for this RCP in which other plugins can store their pages. We only want to show the pages in this container, not the container itself.

IWorkbench workbench = workbenchWindow.getWorkbench();
PreferenceManager preferenceManager = workbench.getPreferenceManager();
IPreferenceNode targetNode = preferenceManager.find(
		"myRCPPreferencePageId");
Collection<String> subnodeIds = new ArrayList<String>();
collectSubNodeIds(targetNode, subnodeIds);
PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
		null, null, subnodeIds.toArray(new String[subnodeIds.size()]), null);
dialog.open();


and


private void collectSubNodeIds(IPreferenceNode node, Collection<String> subnodeIds) {
  IPreferenceNode[] subNodes = node.getSubNodes();
  for(IPreferenceNode subNode : subNodes) {
      subnodeIds.add(subNode.getId());
    collectSubNodeIds(subNode, subnodeIds);
  }
}
Comment 2 Susan McCourt CLA 2009-07-09 19:28:43 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 3 Eclipse Webmaster CLA 2019-09-06 15:32:17 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.