isDesignTime question

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

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

isDesignTime question

Postby hhale » Wed Jun 04, 2008 10:40 am

I am using Designer version 3. If I have tree = new Tree((myTreeImages) GWT.create(myTreeImages.class)); in my constructor and open the composite in the Designer, I get an exception (IllegalArgumentException), so I tried to use isDesignTime() as shown below. I no longer get the error but the tree is not rendered either. Just get "Empty FlexTable" in the design view. It is visible in the property editor.

Should this work?


Code: Select all
class Test {
    private final Tree tree;

    public Test()
    {
        final FlexTable flexTable = new FlexTable();
        initWidget(flexTable);

        if (isDesignTime())
        {
            tree = new Tree();
        }
        else
        {
            tree = new Tree((myTreeImages) GWT.create(myTreeImages.class));
        }
    }
    private static final boolean isDesignTime()
    {
        return false;
    }
}
hhale
 
Posts: 3
Joined: Fri Sep 07, 2007 10:19 am

Re: isDesignTime question

Postby Eric Clayberg » Thu Jun 05, 2008 10:36 am

The class Test should be a Composite subclass and the Tree should be added to the FlexTable somewhere.
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 GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests