How do I make preferences dialog to open up on a particular page? Doing this opens pref. dialog on the first page by default :
OpenPreferencesAction action = new OpenPreferencesAction();
action.run();
How can I tell it to display some other page from preferences tree?
You need to create your own action extending OpenPreferencesAction and overriding the run() method, passing the id of the page to be opened. If you look at OpenPreferencesAction you'll see the run method is like this:
public void run() {
if (workbenchWindow == null) {
// action has been dispose
return;
}
PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, null, null, null);
dialog.open();
}
The second and third parameters determine the id of the page to display and the filtering criteria.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With