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
public static final String PREF_DLG_TITLE_IMG = "preference_dialog_title_image"; 
	/**
	 * Return code used when dialog failed
	 */
	protected static final int FAILED = 2;
	
	static {
		ImageRegistry reg = JFaceResources.getImageRegistry();
		reg.put(PREF_DLG_TITLE_IMG, ImageDescriptor.createFromFile(PreferenceDialog.class,
				"images/pref_dialog_title.gif")); 
	}
	/**
	 * The current preference page, or <code>null</code> if there is none.
	 */
	private IPreferencePage currentPage;
	private DialogMessageArea messageArea;
	private Point lastShellSize;
	private IPreferenceNode lastSuccessfulNode;
	/**
	 * The minimum page size; 400 by 400 by default.
	 * 
	 * @see #setMinimumPageSize(Point)
	 */
	private Point minimumPageSize = new Point(400, 400);
	/**
	 * The OK button.
	 */
	private Button okButton;
	/**
	 * The Composite in which a page is shown.