Bug 133378 [FilteredTree] provide API to control expansion-state of FilteredTree on PreferencePage
In my RCP app I have created a small set of prefs-pages, which are neatly displayed in the little "FilteredTree" to the left. But a user-request is to have that tree expanded by default on opening the Prefs-page; this is reasonable, as there are notvery many elements in the tree. As far as I can tell from the extension-point, the interface of FieldEditorPreferencePage, and the interface of IPreferencePageContainer, there is no way to do this. For example, the API to FilteredTree could have methods like the following, with some forwarding methods from PreferencePage to the implementation of IPreferencePageContainer, or the connection could be made in other ways: public void expandAll() { treeViewer.expandAll(); final ISelection sel = treeViewer.getSelection(); if (!sel.isEmpty()) { final IStructuredSelection iss = (IStructuredSelection) sel; treeViewer.reveal(iss.getFirstElement()); } } public void setExpandedElements(Object[] elements) { treeViewer.setExpandedElements(elements); }
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
* Create the page control for the supplied page.
	 * 
	 * @param page - the preference page to be shown
	 * @param parent - the composite to parent the page
	 * 
	 * @since 3.1
	 */
	protected void createPageControl(IPreferencePage page, Composite parent) {
		page.createControl(parent);
	}
	
	/**
	 * @see org.eclipse.jface.dialogs.IPageChangeProvider#getSelectedPage()
	 * 
	 * @since 3.1
	 */
	public Object getSelectedPage() {
			return getCurrentPage();
		}
	
	/**
	 * @see org.eclipse.jface.dialogs.IPageChangeProvider#addPageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener)
	 * @since 3.1
	 */
	public void addPageChangedListener(IPageChangedListener listener) {
		pageChangedListeners.add(listener);
	}
	
	/**
	 * @see org.eclipse.jface.dialogs.IPageChangeProvider#removePageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener)