tags:

views:

131

answers:

1

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?

+1  A: 

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.

Rich Seller
Perfect! Thanks :)
Dima
You are welcome
Rich Seller

related questions