要管理我的swt / jface应用程序的首选项,我使用org.eclipse.jface.preference
我在首选项窗口中有3个节点:
//Creation of the nodes
PreferenceNode one = new PreferenceNode("one", new PreferencePage1());
PreferenceNode two = new PreferenceNode("two", new PreferencePage2());
PreferenceNode three = new PreferenceNode("three", new PreferencePage3());
//Creation of the manager
PreferenceManager mgr = new PreferenceManager();
mgr.addToRoot(one);
mgr.addToRoot(two);
two.add(three);
//Show the preference dialog
PreferenceDialog myPreferenceDialog = new PreferenceDialog(null, mgr);
节点three
是节点two
的子节点。
如何在two
?
PreferenceNode
答案 0 :(得分:0)
如果您创建PreferenceDialog
的子类,则可以覆盖createTreeViewer
方法并设置自动扩展级别:
@Override
protected TreeViewer createTreeViewer(final Composite parent)
{
TreeViewer viewer = super.createTreeViewer(parent);
viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
return viewer;
}