WBP 7.0 Designer questions

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

WBP 7.0 Designer questions

Postby Kelly » Tue Jun 09, 2009 6:35 am

I have been using WindowBuild Pro 6.9 for some time now but I upgraded to 7.0 and have some questions on the diffences between the two.

I mainly create SWT apps so my questions apple to that.

When Designer creates a Shell widget below.

Code: Select all
public class ShelTst extends Shell {

   /**
    * Launch the application.
    * @param args
    */
   public static void main(String args[]) {
      try {
         Display display = Display.getDefault();
         ShelTst shell = new ShelTst(display);
         shell.open();
         shell.layout();
         while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) {
               display.sleep();
            }
         }
      } catch (Exception e) {
         e.printStackTrace();
      }
   }

   /**
    * Create the shell.
    * @param display
    * @param style
    */
   public ShelTst(Display display) {
      super(display, SWT.SHELL_TRIM);
      createContents();
   }

   /**
    * Create contents of the window.
    */
   protected void createContents() {
      setText("SWT Application");
      setSize(450, 300);

   }

   @Override
   protected void checkSubclass() {
      // Disable the check that prevents subclassing of SWT components
   }

}


The SWT.SHELL_TRIM style was moved to the super call in ShellTst constructor.
Whats the advantage to this?
Note: Comment was created wrong for ShellTst constructor.
The reason I ask is that my old programs that were created with 6.9 pass the style into the ShellTst constructor which causes a problem I am having.
When I switch to designer mode with a Shell widget class that was created with 6.9 I get no Shell Trim and if I click on the "Quickly test/preview' button I can not close the preview window because their is no shell trim. see 6.9 code below.

Code: Select all
public class TTable extends Shell {

   /**
    * Launch the application
    * @param args
    */
   public static void main(String args[]) {
      try {
         Display display = Display.getDefault();
         TTable shell = new TTable(display, SWT.SHELL_TRIM);
         shell.open();
         shell.layout();
         while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
               display.sleep();
         }
      } catch (Exception e) {
         e.printStackTrace();
      }
   }

   /**
    * Create the shell
    * @param display
    * @param style
    */
   public TTable(Display display, int style) {
      super(display, style);
      createContents();
   }

   /**
    * Create contents of the window
    */
   protected void createContents() {
      setText("Shell 6.9 Example");
      setSize(500, 375);
      setLayout(new FormLayout());
      //
   }

   @Override
   protected void checkSubclass() {
      // Disable the check that prevents subclassing of SWT components
   }

}


Also I have played with the keys settings trying to get back the ability to switch from source to designer and back with the F12 key like I use to be able to do in 6.9.
Can you tell me how to get F12 back?

Thanks
Kelly
Kelly
 
Posts: 38
Joined: Wed Feb 02, 2005 8:22 am

Re: WBP 7.0 Designer questions

Postby Eric Clayberg » Wed Jun 10, 2009 12:39 pm

In the latest SWT Designer build, the comment on that template has been fixed. The ESC key will also now close the Test/Preview window regardless of the shell trim.

As to the F12 key, check your Eclipse General > Keys preferences and make sure that there is only one key binding for F12 - "Switch between Source/Designer"
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot] and 2 guests