Community
Participate
Working Groups
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:
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); } }
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
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.