GWT Designer custom bean design restrictions

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

GWT Designer custom bean design restrictions

Postby peterblazejewicz » Wed Sep 12, 2007 2:27 pm

Hi all,
that's probably question to Designer dev-team:
What are exact java bean desing requirements that should be followed by custom widget/composite built for use with GWT Designer upon existing GWT widgets or 3rd party widgets?
Especially I want to know if there are special non-javadoc/javadoc comments/annotations that could be applied to 3rd party components or my own ones to enable them succesfully being rendered in "Design" mode,
Also I'm wondering if dev-team could provide more specific GWT Designer annotation to instruct which constructor is to be used in Design mode (e.g. @gwtDesigner.constructor or anything similiar),
I'm aware that there was a topic on GWT toolkit JIRA about better GWT/3rd party ide's integration about that matter,

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

Re: GWT Designer custom bean design restrictions

Postby Eric Clayberg » Thu Sep 13, 2007 3:55 am

peterblazejewicz wrote:What are exact java bean desing requirements that should be followed by custom widget/composite built for use with GWT Designer upon existing GWT widgets or 3rd party widgets?

The basic rules are the same as those defined by the JavaBean spec and are discussed in this FAQ entry.

    For GWT, any public Widget subclass that has a public, zero-argument constructor can be used (as is standard for all base GWT widgets). Custom properties are derived through reflection by looking for getter/setter pairs of known types. Custom Composite subclasses will show their subcomponents when placed in Designer.
peterblazejewicz wrote:Especially I want to know if there are special non-javadoc/javadoc comments/annotations that could be applied to 3rd party components or my own ones to enable them succesfully being rendered in "Design" mode

At the moment, no.

peterblazejewicz wrote:Also I'm wondering if dev-team could provide more specific GWT Designer annotation to instruct which constructor is to be used in Design mode (e.g. @gwtDesigner.constructor or anything similiar)

What would that annotation do in design mode?

peterblazejewicz wrote:I'm aware that there was a topic on GWT toolkit JIRA about better GWT/3rd party ide's integration about that matter

I think this is an area that Google needs to step into an assert some leadership...either by formally adopting the JavaBean spec (which they mostly do for their own widgets), or establishing some other convention (annotations or otherwise). We would certainly support anything that is officially made part of the GWT API.
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 peterblazejewicz » Thu Sep 13, 2007 11:47 am

Hello Eric,

thanks for answer and confirming my thoughs about design requirements,

I think this is an area that Google needs to step into an assert some leadership...either by formally adopting the JavaBean spec (which they mostly do for their own widgets), or establishing some other convention (annotations or otherwise). We would certainly support anything that is officially made part of the GWT API.


they have just opened incubator area (like e.g. SwingX project):
http://code.google.com/p/google-web-toolkit-incubator/
small startup, maybe yuo could participate in gathering widget stuff requirements?

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 » Thu Sep 13, 2007 5:29 pm

peterblazejewicz wrote:maybe yuo could participate in gathering widget stuff requirements?

We'll talk to our contacts at Google about that.
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: GWT Designer custom bean design restrictions

Postby ekuleshov » Mon Jan 21, 2008 9:08 pm

Eric, I took the last build of MyGWT which seem to have all default constructors and bean properties, so I've added MyGWT to the module config:

<module>
<inherits name="net.mygwt.ui.MyGWT" />
<inherits name="com.google.gwt.user.User"/>
<entry-point class="com.mycompany.project.client.ConfigExt"/>
</module>

And then tried to net.mygwt.ui.client.widget.Button widget to the root panel and for the following error, which seem like caused by NoClassDefFoundError upon Button class initialization (see below). Even visual editor shows that error I can run the app with GWT shell and can see MyGWT button in the shell. Do you have any clue what could be wrong?

Thanks
Eugene

Designer internal error [6.5.1.20080121131339]: Designer is unable to create the 'button' component at line 15 of ConfigExt.java, using public net.mygwt.ui.client.widget.Button() and arguments {}.
This can be caused by problems evaluating the arguments of the constructor, or by any other problem that triggers an exception in the component when instantiated.
See your Eclipse <workspace>.metadata\.log file for details.
Could not initialize class net.mygwt.ui.client.widget.Button

com.swtdesigner.properties.PropertyException: Designer is unable to create the 'button' component at line 15 of ConfigExt.java, using public net.mygwt.ui.client.widget.Button() and arguments {}.
This can be caused by problems evaluating the arguments of the constructor, or by any other problem that triggers an exception in the component when instantiated.
See your Eclipse <workspace>.metadata\.log file for details.
Could not initialize class net.mygwt.ui.client.widget.Button
at com.swtdesigner.model.swt.widgets.ConstructorSourcePropertiesHelper.createObject(ConstructorSourcePropertiesHelper.java:274)
at com.swtdesigner.gwt.model.widgets.UIObjectInfo.createWidgetInstance(UIObjectInfo.java:312)
at com.swtdesigner.gwt.model.widgets.UIObjectInfo.createWidget(UIObjectInfo.java:264)
at com.swtdesigner.gwt.model.widgets.WidgetInfo.createWidget(WidgetInfo.java:169)
at com.swtdesigner.gwt.model.widgets.panel.AbstractContainerInfo.createChildrenWidgets(AbstractContainerInfo.java:195)
at com.swtdesigner.gwt.model.widgets.panel.RootPanelInfo.createGUIComponent(RootPanelInfo.java:69)
at com.swtdesigner.model.JavaInfo$18.execute(JavaInfo.java:5608)
at com.swtdesigner.model.swing.properties.custom.DesignTimeHelper.execute(DesignTimeHelper.java:54)
at com.swtdesigner.model.JavaInfo.notifyPropertyChanged(JavaInfo.java:5603)
at com.swtdesigner.model.JavaInfo.notifyPropertyChanged(JavaInfo.java:5584)
at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.handleRootNodeSelected(DesignerEditorPropertyComposite.java:662)
at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.updatePropertyComposite(DesignerEditorPropertyComposite.java:865)
at com.swtdesigner.gef.DesignerEditor.parseCompilationUnit(DesignerEditor.java:1170)
at com.swtdesigner.gef.DesignerEditor$17.execute(DesignerEditor.java:1072)
at com.swtdesigner.model.swing.properties.custom.DesignTimeHelper.execute(DesignTimeHelper.java:54)
at com.swtdesigner.gef.DesignerEditor.handleActivate(DesignerEditor.java:1066)
at com.swtdesigner.gef.DesignerEditor.handleActivate(DesignerEditor.java:1059)
at com.swtdesigner.editors.MultiPageEditor.showDesignEditor(MultiPageEditor.java:426)
at com.swtdesigner.editors.MultiPageEditor$2.widgetSelected(MultiPageEditor.java:196)
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:952)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:976)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:961)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:720)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3236)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2011)
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:952)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3758)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3369)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2392)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2356)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2222)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:474)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:469)
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:193)
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:362)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:564)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1251)
at org.eclipse.equinox.launcher.Main.main(Main.java:1227)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.mygwt.ui.client.widget.Button
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.swtdesigner.model.swt.widgets.ConstructorSourcePropertiesHelper.createObject(ConstructorSourcePropertiesHelper.java:271)
... 52 more
ekuleshov
 
Posts: 1
Joined: Mon Jan 21, 2008 8:52 pm

Re: GWT Designer custom bean design restrictions

Postby Eric Clayberg » Tue Jan 22, 2008 11:00 am

ekuleshov wrote:And then tried to net.mygwt.ui.client.widget.Button widget to the root panel and for the following error, which seem like caused by NoClassDefFoundError upon Button class initialization (see below). Even visual editor shows that error I can run the app with GWT shell and can see MyGWT button in the shell. Do you have any clue what could be wrong?

Yes. We had added an earlier hack to specifically work around MyGWT's non standard naming of its MyDOMIEImpl class. It appears that the MyGWT build corrects that problem, so the hack we added is no longer needed. We have now removed that hack and the MyGWT widgets appear to be showing up OK (I tried Button and List).

With the addition of default constructors and proper accessors, most of the simple MyGWT widgets should work. Complex MyGWT widgets (like containers or tables) will still need to have specific edit-time support added to GWT Designer (which we fully intend to do once the MyGWT API stabilizes) just as we did for the basic GWT panels and widgets.
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