如何在特定页面上打开首选项对话框?这样做会打开pref.默认情况下,第一页上的对话框:
OpenPreferencesAction action = new OpenPreferencesAction();
action.run();
Run Code Online (Sandbox Code Playgroud)
如何告诉它显示首选项树中的其他页面?
您需要创建自己的操作,扩展OpenPreferencesAction并覆盖run()方法,传递要打开的页面的id.如果你看一下OpenPreferencesAction,你会发现run方法是这样的:
public void run() {
if (workbenchWindow == null) {
// action has been dispose
return;
}
PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, null, null, null);
dialog.open();
}
Run Code Online (Sandbox Code Playgroud)
第二个和第三个参数确定要显示的页面的ID和过滤条件.
| 归档时间: |
|
| 查看次数: |
1898 次 |
| 最近记录: |