Heavy problems with DetailsPage; SWT Designer bug?

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

Heavy problems with DetailsPage; SWT Designer bug?

Postby Mauro » Wed Feb 10, 2010 5:05 pm

Hi, I'm trying (and failing) to use Master/Detail.

I tracked down the problem to WindowBuilder seemingly unable to parse its own code.

I created a DetailPage [new->Other...->Window Builder->SWT Designer->Forms->DetailsPage]
The generated code is as follows:
Code: Select all
package it.condarelli.wbtest.editors;

import org.eclipse.jface.viewers.ISelection;

public class TestDetailPage implements IDetailsPage {

    private IManagedForm managedForm;

    /**
     * Create the details page.
     */
    public TestDetailPage() {
        // Create the details page
    }

    /**
     * Initialize the details page.
     * @param form
     */
    public void initialize(IManagedForm form) {
        managedForm = form;
    }

    /**
     * Create contents of the details page.
     * @param parent
     */
    public void createContents(Composite parent) {
        FormToolkit toolkit = managedForm.getToolkit();
        parent.setLayout(new FillLayout());
        //      
        Section section = toolkit.createSection(parent, ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
        section.setText("Empty Section");
        //
        Composite composite = toolkit.createComposite(section, SWT.NONE);
        toolkit.paintBordersFor(composite);
        section.setClient(composite);
    }

    public void dispose() {
        // Dispose
    }

    public void setFocus() {
        // Set focus
    }

    private void update() {
        // Update
    }

    public boolean setFormInput(Object input) {
        return false;
    }

    public void selectionChanged(IFormPart part, ISelection selection) {
        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        update();
    }

    public void commit(boolean onSave) {
        // Commit
    }

    public boolean isDirty() {
        return false;
    }

    public boolean isStale() {
        return false;
    }

    public void refresh() {
        update();
    }

}
Notice it (correctly!) created a section and a Composite in it.
Unfortunately, when i switch to Design view I see what is in "First Image".
You can see there is absolutely nothing. Section and Composite have vanished.
If I add my own Section the result is shown in "Second Image".
This seems correct, but the generated code is:
Code: Select all
    /**
     * Create contents of the details page.
     * @param parent
     */
    public void createContents(Composite parent) {
        FormToolkit toolkit = managedForm.getToolkit();
        parent.setLayout(new FillLayout());
        //      
        Section section = toolkit.createSection(parent, ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
       
        Section section_1 = toolkit.createSection(parent, Section.TWISTIE | Section.TITLE_BAR);
        toolkit.paintBordersFor(section_1);
        section_1.setText("New Section");
        section.setText("Empty Section");
        //
        Composite composite = toolkit.createComposite(section, SWT.NONE);
        toolkit.paintBordersFor(composite);
        section.setClient(composite);
    }
As You can see the the first Section is completely forgotten (but it is dutifully shown if I run the program!).
Before I realized this misbehavior I was happily adding controls to my frame then, of a sudden I was back to the first image.
I began again a couple of times before I convinced myself I didn't goof somewhere.
One of the more complex (??) things I managed to do before going blank again is as follows:
Code: Select all
    /**
     * Create contents of the details page.
     * @param parent
     */
    public void createContents(Composite parent) {
        FormToolkit toolkit = managedForm.getToolkit();
        //      
        Section section = toolkit.createSection(parent, ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
        parent.setLayout(new GridLayout(1, false));
       
        Section sctnOverview = toolkit.createSection(parent, Section.TWISTIE | Section.TITLE_BAR);
        toolkit.paintBordersFor(sctnOverview);
        sctnOverview.setText("Overview");
       
        Composite composite_1 = toolkit.createComposite(sctnOverview, SWT.NONE);
        toolkit.paintBordersFor(composite_1);
        sctnOverview.setClient(composite_1);
        composite_1.setLayout(new GridLayout(2, false));
       
        Label lblTitle = toolkit.createLabel(composite_1, "Title:", SWT.NONE);
        lblTitle.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
       
        txtTitle = toolkit.createText(composite_1, "New Text", SWT.NONE);
        txtTitle.setText("Title");
        txtTitle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
       
        txtDesc = toolkit.createText(composite_1, "New Text", SWT.NONE);
        txtDesc.setText("Desc");
        txtDesc.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
       
        Label lblWords = toolkit.createLabel(composite_1, "Words:", SWT.NONE);
        lblWords.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
       
        txtWordcount = toolkit.createText(composite_1, "New Text", SWT.NONE);
        txtWordcount.setText("word count");
        txtWordcount.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
        sctnOverview.setExpanded(true);
       
        Section sctnChapters = toolkit.createSection(parent, Section.TWISTIE | Section.TITLE_BAR);
        toolkit.paintBordersFor(sctnChapters);
        sctnChapters.setText("Chapters");
       
        table = toolkit.createTable(sctnChapters, SWT.NONE);
        toolkit.paintBordersFor(table);
        sctnChapters.setClient(table);
        table.setHeaderVisible(true);
        table.setLinesVisible(true);
        sctnChapters.setExpanded(true);
        section.setText("Empty Section");
        //
        Composite composite = toolkit.createComposite(section, SWT.NONE);
        toolkit.paintBordersFor(composite);
        section.setClient(composite);
    }
This was completely coded by SWT Designer, but shows a blank page (Just like "First Image") in my setup.

Evaluation of this product is not really satisfying to date
It seems to have all features I need, but, if they do not work.... :(

Am I doing something seriously wrong?
Please advise.

Best Regards
Mauro
Attachments
after.png
Second Image (fter adding a Section).
after.png (144.3 KiB) Viewed 424 times
before.png
First Image (right after Wizard)
before.png (130.89 KiB) Viewed 424 times
Mauro
 
Posts: 7
Joined: Mon Feb 08, 2010 5:39 pm

Re: Heavy problems with DetailsPage; SWT Designer bug?

Postby Eric Clayberg » Thu Feb 11, 2010 6:05 am

Give this a try using the latest SWT Designer v7.3 build.
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

Re: Heavy problems with DetailsPage; SWT Designer bug?

Postby Mauro » Thu Feb 11, 2010 7:35 am

This is the list of plugins I currently have installed.
Code: Select all
com.instantiations.common.core_5.6.0.r35x201002081657.jar
com.instantiations.common.help_5.6.0.r35x201002081657.jar
com.instantiations.common.ui_5.6.0.r35x201002081657.jar
com.instantiations.designer.core.apiImpl_7.3.0.r35x201002100632.jar
com.instantiations.designer.core.apiImpl_7.3.0.r35x201002110219.jar
com.instantiations.designer.core.api_7.3.0.r35x201002100632.jar
com.instantiations.designer.core.api_7.3.0.r35x201002110219.jar
com.instantiations.designer.core.databinding_7.3.0.r35x201002100632.jar
com.instantiations.designer.core.databinding_7.3.0.r35x201002110219.jar
com.instantiations.designer.core_7.3.0.r35x201002100632.jar
com.instantiations.designer.core_7.3.0.r35x201002110219.jar
com.instantiations.designer.doc.user_7.3.0.r35x201002100632.jar
com.instantiations.designer.doc.user_7.3.0.r35x201002110219.jar
com.instantiations.designer.jdt.fragment_7.3.0.r35x201002100632.jar
com.instantiations.designer.jdt.fragment_7.3.0.r35x201002110219.jar
com.instantiations.designer.layout.group_7.3.0.r35x201002100635.jar
com.instantiations.designer.layout.group_7.3.0.r35x201002110224.jar
com.instantiations.designer.os.win32_7.3.0.r35x201002100632.jar
com.instantiations.designer.os.win32_7.3.0.r35x201002110219.jar
com.instantiations.designer.os_7.3.0.r35x201002100632.jar
com.instantiations.designer.os_7.3.0.r35x201002110219.jar
com.instantiations.designer.rcp.GroupLayout_7.3.0.r35x201002100647.jar
com.instantiations.designer.rcp.GroupLayout_7.3.0.r35x201002110235.jar
com.instantiations.designer.rcp.SWT_AWT_7.3.0.r35x201002100650.jar
com.instantiations.designer.rcp.SWT_AWT_7.3.0.r35x201002110237.jar
com.instantiations.designer.rcp.databinding.emf_7.3.0.r35x201002100647.jar
com.instantiations.designer.rcp.databinding.emf_7.3.0.r35x201002110235.jar
com.instantiations.designer.rcp.databinding_7.3.0.r35x201002100647.jar
com.instantiations.designer.rcp.databinding_7.3.0.r35x201002110235.jar
com.instantiations.designer.rcp.doc.user_7.3.0.r35x201002100647.jar
com.instantiations.designer.rcp.doc.user_7.3.0.r35x201002110235.jar
com.instantiations.designer.rcp.nebula.lib_7.3.0.r35x201002100647.jar
com.instantiations.designer.rcp.nebula.lib_7.3.0.r35x201002110235.jar
com.instantiations.designer.rcp.nebula_7.3.0.r35x201002100647.jar
com.instantiations.designer.rcp.nebula_7.3.0.r35x201002110235.jar
com.instantiations.designer.rcp.swing2swt_7.3.0.r35x201002100647.jar
com.instantiations.designer.rcp.swing2swt_7.3.0.r35x201002110235.jar
com.instantiations.designer.rcp_7.3.0.r35x201002100647.jar
com.instantiations.designer.rcp_7.3.0.r35x201002110235.jar
com.instantiations.designer.runtime_7.3.0.r35x201002100632.jar
com.instantiations.designer.runtime_7.3.0.r35x201002110219.jar
com.instantiations.designer.swing.FormLayout_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing.FormLayout_7.3.0.r35x201002110230.jar
com.instantiations.designer.swing.LookAndFeel_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing.LookAndFeel_7.3.0.r35x201002110230.jar
com.instantiations.designer.swing.MigLayout.lib_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing.MigLayout.lib_7.3.0.r35x201002110230.jar
com.instantiations.designer.swing.MigLayout_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing.MigLayout_7.3.0.r35x201002110230.jar
com.instantiations.designer.swing.ams_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing.ams_7.3.0.r35x201002110230.jar
com.instantiations.designer.swing.databinding_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing.databinding_7.3.0.r35x201002110230.jar
com.instantiations.designer.swing.doc.user_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing.doc.user_7.3.0.r35x201002110230.jar
com.instantiations.designer.swing.hc_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing.hc_7.3.0.r35x201002110230.jar
com.instantiations.designer.swing.java6_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing.java6_7.3.0.r35x201002110230.jar
com.instantiations.designer.swing_7.3.0.r35x201002100642.jar
com.instantiations.designer.swing_7.3.0.r35x201002110230.jar
com.instantiations.designer.swt_7.3.0.r35x201002100640.jar
com.instantiations.designer.swt_7.3.0.r35x201002110228.jar
com.instantiations.eclipse.debug_5.6.0.r35x201002081657.jar
com.instantiations.eclipse.startup_5.6.0.r35x201002081657.jar
com.instantiations.eclipse.usageprofiler.ui_5.6.0.r35x201002081657.jar
com.instantiations.eclipse.usageprofiler_5.6.0.r35x201002081657.jar
com.instantiations.eclipse.util_5.6.0.r35x201002081657.jar
I have autoupdate enabled and it asks for some update daily!!
Is that normal?

Current behavior is as reported.

This eclipse installation has lots of added plugins in it.
Can this be a problem?
I can try again on a fresh Galileo installation on another machine, but will the codes instantiations sent me work again?
Should I ask for another eval license?
... and, above all: does it make sense?

Regards
Mauro
Mauro
 
Posts: 7
Joined: Mon Feb 08, 2010 5:39 pm

Re: Heavy problems with DetailsPage; SWT Designer bug?

Postby Eric Clayberg » Thu Feb 11, 2010 7:52 am

You need to update to the latest SWT Designer v7.3 build for this DetailsPage problem.

There are new updates available every day, if you want them.

You can request an extended eval from sales@instantiations.com.
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

Re: Heavy problems with DetailsPage; SWT Designer bug?

Postby Mauro » Thu Feb 11, 2010 9:14 am

Thanks.
I can confirm it works much better now.
There still are some quirks, but I suspect they are due to my incomplete understanding of the tool.

Regards
Mauro
Mauro
 
Posts: 7
Joined: Mon Feb 08, 2010 5:39 pm

Re: Heavy problems with DetailsPage; SWT Designer bug?

Postby Eric Clayberg » Thu Feb 11, 2010 10:05 am

Glad its working for you now.
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