Results 1 to 4 of 4
  1. #1
    sarcasteak is offline Member
    Join Date
    Apr 2009
    Posts
    3
    Rep Power
    0

    Default Launching Eclipse Preferences from button

    Is there a way that I can launch the eclipse preferences menu from a button click as a shortcut within a jface/swt application?

  2. #2
    vogella is offline Member
    Join Date
    Aug 2009
    Location
    Heidelberg
    Posts
    47
    Rep Power
    0

    Default

    You can use standard Eclipse commands (as opening the preferences dialog) in your own commands. These commands you can assigned to buttons / menu entries and also shortcuts / keybindings.

  3. #3
    sarcasteak is offline Member
    Join Date
    Apr 2009
    Posts
    3
    Rep Power
    0

    Default

    Thanks for the reply, could you elaborate for me please?

    Say I made a new button

    Java Code:
    Button preferencesButton = new Button(parent,SWT.NULL);
    Button.setText("Preferences Button");
    And I attached a listener

    Java Code:
    perferencesButton.addListener(SWT.MouseDown, listener);
    What would I need to add to the listener to launch this button?

    Java Code:
    Listener listener = new Listener()
    	{
    		public void handleEvent(Event event)
    		{
    }
    }

  4. #4
    vogella is offline Member
    Join Date
    Aug 2009
    Location
    Heidelberg
    Posts
    47
    Rep Power
    0

    Default

    You normally would use declarative commnds. Of cause you could also commands via your button. Both approaches are described here: Eclipse Commands with Eclipse 3.5 (Galileo) - Tutorial

Similar Threads

  1. java.util.Preferences
    By jon80 in forum New To Java
    Replies: 0
    Last Post: 06-07-2009, 12:28 AM
  2. Eclipse launching Visual Basic
    By FireFly in forum Eclipse
    Replies: 1
    Last Post: 10-03-2008, 09:22 PM
  3. scripting preferences import
    By MikeW in forum Eclipse
    Replies: 2
    Last Post: 07-18-2008, 04:18 PM
  4. How to use JFace Preferences and Field Editors
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 05:48 PM
  5. JFace Preferences Demonstration
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 05:48 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
  •