FormLayout Beta Available for Pro Users (v1.2.1)

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

FormLayout Beta Available for Pro Users (v1.2.1)

Postby Eric Clayberg » Wed Oct 29, 2003 8:59 pm

Click on the Beta link on the SWT Designer web site to access a beta of the upcoming v1.2.1 release. The primary new major feature is support the FormLayout layout manager. Intelligent snap points are available to create widget, percentage and margin attachments. The beta also includes improved Linux support (it actually works fairly well under Motif now) and lots of bug fixes.

Note that this beta is only available to SWT Designer Professional users.
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

Postby rgallen » Thu Oct 30, 2003 8:20 pm

Only had a quick look (20 minutes) so far, but it looks very cool. I haven't used anything but percentage anchors, which work marvelously, what do the other icons mean (i.e. what is the # ?)
rgallen
 
Posts: 15
Joined: Sun Oct 12, 2003 7:45 pm

Postby Eric Clayberg » Thu Oct 30, 2003 9:28 pm

rgallen wrote:Only had a quick look (20 minutes) so far, but it looks very cool. I haven't used anything but percentage anchors, which work marvelously, what do the other icons mean (i.e. what is the # ?)

"#" is used to indicate a fixed offset (either to the edge of the container, to a widget or to a percentage line). For example...

    Image means a fixed offset from the left side of the window
    Image means a fixed offset from the right side of the window
    Image means a percentage offset
    Image means a fixed offset from a percentage point (e.g., 5 pixels from the window centerline)
    Image means a fixed offset from a widget

Additional info is available on the FormLayout Preview page on the SWT Designer web site.

BTW, watch the beta page as we are updating it frequently. Another update went out this evening. The final 1.2.1 GA release should go out some time next week.
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

Postby rgallen » Sat Nov 01, 2003 8:36 pm

OK,

I have a problem. I am using Eclipse 3.0M3, and 1.2.1 beta. I did the following.

1. New SWT Application.
2. Layout Manager -> FormLayout.
3. Add Sash.
4. Add Tree to Sash.
5. Add Table to Sash.
6. Add a couple of buttons below Sash.

Designer generates the following:

Code: Select all
      SashForm sashForm_1;
      {
         sashForm_1 = new SashForm(shell, SWT.NONE);
         sashForm_1.setWeights(new int[] { 1, 1 });
         {
            new Tree(sashForm_1, SWT.BORDER);
         }
         {
            final Table table = new Table(sashForm_1, SWT.BORDER);
            table.setLinesVisible(true);
            table.setHeaderVisible(true);
         }
         final FormData formData = new FormData();
         formData.bottom = new FormAttachment(100, -38);
         formData.right = new FormAttachment(100, -5);
         formData.top = new FormAttachment(0, 5);
         formData.left = new FormAttachment(0, 5);
         sashForm_1.setLayoutData(formData);
      }


The problem is with the call to sashForm_1.setWeights(new int[] { 1, 1 }). This generates a runtime error:

Code: Select all
java.lang.IllegalArgumentException: Argument not valid
   at org.eclipse.swt.SWT.error(SWT.java:2353)
   at org.eclipse.swt.SWT.error(SWT.java:2297)
   at org.eclipse.swt.custom.SashForm.setWeights(SashForm.java:430)
   at tests.TestFormLayout.main(TestFormLayout.java:37)
Exception in thread "main"


I have tried to find the JavaDoc for .setWeights with no luck, so I have no idea what is illegal about the argument, but in any case, I must comment out this line in order to be able to run the generated code.
rgallen
 
Posts: 15
Joined: Sun Oct 12, 2003 7:45 pm

Postby Eric Clayberg » Sun Nov 02, 2003 7:02 am

rgallen wrote:The problem is with the call to sashForm_1.setWeights(new int[] { 1, 1 }). This generates a runtime error

It is interesting that it causes a runtime error and not a compile time error. Apparently, the call to setWeigts() must take place after the children have been added to the SashForm. I would have thought that the SashForm class could have been made a bit more intelligent. In any case, the easy workaround is to move the call to setWeights() to after the addition of the children. E.g.,

Code: Select all
      SashForm sashForm_1;
      {
         sashForm_1 = new SashForm(shell, SWT.NONE);
         {
            new Tree(sashForm_1, SWT.BORDER);
         }
         {
            final Table table = new Table(sashForm_1, SWT.BORDER);
            table.setLinesVisible(true);
            table.setHeaderVisible(true);
         }
         sashForm_1.setWeights(new int[] { 1, 1 });
         final FormData formData = new FormData();
         formData.bottom = new FormAttachment(100, -38);
         formData.right = new FormAttachment(100, -5);
         formData.top = new FormAttachment(0, 5);
         formData.left = new FormAttachment(0, 5);
         sashForm_1.setLayoutData(formData);
      }

We will look into makiing sure that the Designer generates the code this way as well.
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

Postby Eric Clayberg » Wed Nov 05, 2003 9:37 pm

The 1.2.1 Beta has been significantly updated and stabilized. SashForms are fixed; Undo/Redo/Revert integration has been added; FormLayout support is essentially done; etc. The GA release will occur by the end of this week. Enjoy! :-)

Note that this beta is only available to SWT Designer Professional users.
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 1 guest