My Preference Dialog
in my eclipse RCp I have a peference dialog, which contains actually two pages. normally I opens the dialog, with a item in the menubar. But now I have a button. And I click on this button, should also opens the preference dialog, but in this case the page two should have the focus.
How can I realize this?
Let us analyse what you need
You have two pages, inside a dialog When it is viewed from menu page1 should have the focus when viewed from button page2 should have the focus,
So I think You need to have two constructer for the dialog one with focus of page1 and other with focus on page2, Call them correspondingly
yes but the class PreferenceDialog from the package JFace has not setFocus method. Can you give me some code. How i can realize this. I have try it with Methode showPage() but this was not the solve for the problem. Have you an other idea. Or how can I set which page has the Focus in the constructor
here is my actually code but I don't know how I can change the page, which has the focus
Can anybody helps me?
public class MyPreferenceDialog extends PreferenceDialog
public MyPreferenceDialog(int flag)
private static PreferenceManager getManager()
PreferenceManager mgr = new PreferenceManager();
// Create the nodes
PreferenceNode one = new PreferenceNode("Druckmanager",
PreferenceNode two = new PreferenceNode("Postage",
// Add the nodes