Writing a custom layout that can work with gwt designer

132 views
Skip to first unread message

Onur Canci

unread,
Aug 24, 2011, 9:43:08 AM8/24/11
to google-we...@googlegroups.com
I need to write a new panel component that has custom layout which is extended from widget class.
I wrote a panel with custom layout like ext gwt's layout managers but i can't find a way to integrate it with gwt-designer.
When i write panel add code of a component by hand it works normally. but designer doesn't drop new components to my new panel.


What can i do to add designer integration like ext gwt's custom panel components.

Thanks for replies,

Konstantin Scheglov

unread,
Aug 24, 2011, 2:18:29 PM8/24/11
to google-we...@googlegroups.com
In general case support for new layout requires adding special support for this layout into GWT Designer.
There are no way to GWT Designer to know magically how to generate code, show editing feedbacks, etc.

In simplest case, when layout is flow-based, you can use wbp-component.xml description for your new layout.
See file FlowLayout.wbp-component.xml in "wbp-meta" folder of com.google.gdt.eclipse.designer.GXT plugin.

In more complex cases you need to write JavaInfo model, register your plugin as GWT toolkit contributor and write GEF EditPart, LayoutEditPolicy, etc.

Eric Clayberg (Google)

unread,
Aug 24, 2011, 2:26:32 PM8/24/11
to google-we...@googlegroups.com
Adding support for a new custom layout is a very complex task (there is no magic Java Bean model for layouts, for example), but there are a lot of example available. WindowBuilder (upon which GWT Designer is based) is an open source project at Eclipse. There you will find full source code to Swing Designer and SWT Designer - both of which contains a great many complex layout examples that you can emulate. And, as Konstantin says, if your layout can be represented as a simple flow (left/right or up/down), you can add support for your custom layout quite easily. Something more complex (like a grid) will require a great deal more work.
Reply all
Reply to author
Forward
0 new messages