Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Posts
    4
    Rep Power
    0

    Question My Preference Dialog

    Hello,

    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?

  2. #2
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Posts
    134
    Rep Power
    0

    Default

    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

  3. #3
    Join Date
    Aug 2007
    Posts
    4
    Rep Power
    0

    Default

    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
    Last edited by schuetzejanett; 08-09-2007 at 10:59 PM.

  4. #4
    Join Date
    Aug 2007
    Posts
    4
    Rep Power
    0

    Default

    here is my actually code but I don't know how I can change the page, which has the focus

    Java Code:
    public class MyPreferenceDialog extends PreferenceDialog
    {
    	public MyPreferenceDialog(int flag)
    	{
    		super(null, getManager());
    	}
    
    	private static PreferenceManager getManager()
    	{
    		PreferenceManager mgr = new PreferenceManager();
    		// Create the nodes
    		PreferenceNode one = new PreferenceNode("Druckmanager",
    				new PreferencePageData());
    		PreferenceNode two = new PreferenceNode("Postage",
    				new PreferencePagePostage());
    
    		// Add the nodes
    		mgr.addToRoot(one);
    		mgr.addToRoot(two);
    		return mgr;
    	}
    }
    Can anybody helps me?

Similar Threads

  1. Run As dialog and Plugin Help
    By menelaosbgr in forum Eclipse
    Replies: 0
    Last Post: 03-25-2008, 04:21 AM
  2. Example - File Dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-01-2008, 11:11 PM
  3. Example of SWT Dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-09-2008, 01:01 PM
  4. Dialog Box
    By uncopywritable in forum New To Java
    Replies: 2
    Last Post: 07-30-2007, 01:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •