Design view not working for GWT Mail sample

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

Design view not working for GWT Mail sample

Postby lmassand » Tue Sep 11, 2007 1:29 pm

When I try to open the Mail project (provided in GWT samples) Mail.java in the design view I get the following error:

"Designer was unable to find any GUI elements in your source."

Stack trace:
Java Model Exception: Java Model Status [treeLeaf() [in Images [in Mailboxes [in Mailboxes.java [in com.google.gwt.sample.mail.client [in src [in Mail]]]]]] does not exist]
at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:485)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:516)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:249)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:235)
at org.eclipse.jdt.internal.core.SourceRefElement.getSourceRange(SourceRefElement.java:211)
at com.swtdesigner.model.util.jdt.JavadocContentAccess.getContentReader(JavadocContentAccess.java:59)
at com.swtdesigner.model.util.jdt.JavaDocUtils.getJavaDoc(JavaDocUtils.java:52)
at com.swtdesigner.gwt.loader.GWTDumps.dump_ImageBundle(GWTDumps.java:88)
at com.swtdesigner.gwt.loader.GWTClassLoader.findClass(GWTClassLoader.java:126)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at java.beans.Introspector$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Unknown Source)
at java.beans.Introspector.getTargetMethodInfo(Unknown Source)
at java.beans.Introspector.getBeanInfo(Unknown Source)
at java.beans.Introspector.getBeanInfo(Unknown Source)
at com.swtdesigner.model.swing.JavaBeanInfo.createSharedBeanDefinition(JavaBeanInfo.java:3172)
at com.swtdesigner.model.swing.JavaBeanInfo.getSharedBeanDefinition(JavaBeanInfo.java:3135)
at com.swtdesigner.model.swing.JavaBeanInfo.initClassAndBounds(JavaBeanInfo.java:1718)
at com.swtdesigner.gwt.model.widgets.UIObjectInfo.initClassAndBounds(UIObjectInfo.java:122)
at com.swtdesigner.model.swing.JavaBeanInfo.<init>(JavaBeanInfo.java:277)
at com.swtdesigner.gwt.model.widgets.UIObjectInfo.<init>(UIObjectInfo.java:62)
at com.swtdesigner.gwt.model.widgets.WidgetInfo.<init>(WidgetInfo.java:49)
at com.swtdesigner.gwt.model.widgets.panel.AbstractContainerInfo.<init>(AbstractContainerInfo.java:35)
at com.swtdesigner.gwt.model.widgets.panel.CompositeInfo.<init>(CompositeInfo.java:26)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.swtdesigner.gwt.model.GWTJavaInfoFactory.create(GWTJavaInfoFactory.java:152)
at com.swtdesigner.model.parser.factory.JavaInfoFactory.create(JavaInfoFactory.java:112)
at com.swtdesigner.model.parser.factory.JavaInfoFactory.create(JavaInfoFactory.java:95)
at com.swtdesigner.model.parser.factory.JavaInfoFactory.create(JavaInfoFactory.java:88)
at com.swtdesigner.model.parser.JavaInfoParser$ParserVisitor.endVisit(JavaInfoParser.java:1444)
at org.eclipse.jdt.core.dom.ClassInstanceCreation.accept0(ClassInstanceCreation.java:336)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2523)
at org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:224)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546)
at org.eclipse.jdt.core.dom.FieldDeclaration.accept0(FieldDeclaration.java:286)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
at com.swtdesigner.model.parser.JavaInfoParser$ParserVisitor.visit(JavaInfoParser.java:2702)
at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:466)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:213)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
at com.swtdesigner.model.parser.JavaInfoParser.parse(JavaInfoParser.java:319)
at com.swtdesigner.gef.DesignerEditor.parseCompilationUnit(DesignerEditor.java:1136)
at com.swtdesigner.gef.DesignerEditor$17.execute(DesignerEditor.java:1068)
at com.swtdesigner.model.swing.properties.custom.DesignTimeHelper.execute(DesignTimeHelper.java:54)
at com.swtdesigner.gef.DesignerEditor.handleActivate(DesignerEditor.java:1062)
at com.swtdesigner.gef.DesignerEditor.handleActivate(DesignerEditor.java:1055)
at com.swtdesigner.editors.MultiPageEditor.showDesignEditor(MultiPageEditor.java:421)
at com.swtdesigner.editors.MultiPageEditor$2.widgetSelected(MultiPageEditor.java:191)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:706)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3227)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2005)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:316)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)


Pls help me in resolving this issue as I need to take decision whether using Designer will help me save time and at the same time provide flexibility.
Thanx in advance.
lmassand
 
Posts: 2
Joined: Tue Sep 11, 2007 1:12 pm

Re: Design view not working for GWT Mail sample

Postby Eric Clayberg » Wed Sep 12, 2007 11:32 am

lmassand wrote:When I try to open the Mail project (provided in GWT samples) Mail.java in the design view I get the following error

Give this a try with the latest v2.0.1 build. We made a few tweaks to address some of the problems specific to that example.

lmassand wrote:Pls help me in resolving this issue as I need to take decision whether using Designer will help me save time and at the same time provide flexibility.

Whether Designer can or can't open that example shouldn't make any difference. You should give the tool a try yourself and put it through its paces (maybe even run throug the tutorial). We only gurantee that GWT Designer will be able to edit code that it creates itself. The product does pretty well with hand written or refactored code, but we make no claims that it will handle all hand written GWT code out there...especially questionable code like the Mail example. The Mail example has several issues that need to be addressed before I would ever recommend using it as an example of how to write good GWT code or good Java code in general.

For example, the MailList class sends a get() call to the Mail class to access its singleton without testing that it is non null or ensuring that the singleton is actually created. The get() method itself returns the singleton field without ensuring that it is populated. The example relies on runtime-specific behavior to populate the singleton instance (the call to the Mail.onLoadModule() method). When editing the Mail class at design time, there is no instance of the Mail class created. The Mail class is parsed; it is not instantiated. Any code that tries to actually access the instance of the class being edited will not work because there is no such instance.

From a purely OO point of view, the Mail example is also poorly designed. The classes are tightly coupled (when they don't need to be) and the MailList class unnecessarily breaks encapsulation by talking directly back to the Mail class via its singleton.
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 lmassand » Wed Sep 12, 2007 2:37 pm

Thanx Eric for your reply.

I am using GWTD v2.0.1 only. I tried the designer tool with the KitchenSink sample of GWT and got the following error:

"Exception during creation of SinkList"
Even though the application works perfectly fine when I run it. I tried all options given in some of the related messages in this forum.

I need to create an application very similar to Mail or KitchenSink sample therefore I was hoping to use one of these applications as base and customize it to quickly build my front end. Unfortunately GWTD does not give me any such examples and tutorials weren't enough to build a serious application quickly.

It would be very helpful if your tool can support the basic samples provided by the GWT team as part of their software.

I appreciate your help.
lmassand
 
Posts: 2
Joined: Tue Sep 11, 2007 1:12 pm

Postby peterblazejewicz » Wed Sep 12, 2007 3:08 pm

hi,

the base steps that needs to be done if you want to use "Design" view is to change any example you came into to meet at least two requirements:
- component should have public constructor
- component should have no argument constructor
That way components are like java bean which are usually best suited for any IDE's.
Issue is that most samples are not written that way as Eric mentioned,

regards,
Peter
Peter Blazejewicz
GWT groups profile
peterblazejewicz
 
Posts: 153
Joined: Fri Jul 27, 2007 7:09 pm
Location: Europe/Poland/Warsaw

Postby Eric Clayberg » Wed Sep 12, 2007 6:18 pm

lmassand wrote:I am using GWTD v2.0.1 only. I tried the designer tool with the KitchenSink sample of GWT and got the following error

Are you using the latest 2.0.1 build? I was able to open all of the classes associated with the KitchenSink example...

Image

lmassand wrote:It would be very helpful if your tool can support the basic samples provided by the GWT team as part of their software.

I am also able to open all of the classes associated with the Mail example using the latest build...

Image
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