GWT Designer and IsWidget

185 views
Skip to first unread message

Stefan

unread,
Jun 28, 2011, 9:15:41 AM6/28/11
to Google Web Toolkit
Hi All,
I am implementing a view that cannot extends from Widget. It must
extend from another type. The view does implement IsWidget.

My issue is that the GWT Designer does not allow the view to be used.
My question is does the GWT Designer support IsWidget and if it does,
what do I need to do in order to make my view Designer friendly?

Thanks
Stefan

Benoit Landrieu

unread,
Jun 28, 2011, 9:17:27 AM6/28/11
to google-we...@googlegroups.com
I am not a specialist but why you didn't use the view class ? widget
is more lower than view class and you can add widget to the view and
use powerful pattern like mvc ;)

Hope that it will help you !

Benoit

> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

Eric Clayberg - Instantiations

unread,
Jun 28, 2011, 12:17:31 PM6/28/11
to Google Web Toolkit
If you want to create a custom component that will work with GWT
Designer, you should ideally subclass Composite although subclassing
Widget will also work.

If you place your class somewhere other than the Widget hierarchy,
then you really aren't creating a valid GWT UI component. Implementing
an isWidget() method does not actually make the component a widget.

See "Creating Custom Widgets" in the GWT Developer's Guide...

http://code.google.com/webtoolkit/doc/latest/DevGuideUiCustomWidgets.html

On Jun 28, 9:15 am, Stefan <sbara...@gmail.com> wrote:
> Hi All,
> I am implementing a view that cannot extends from Widget. It must
> extend from another type. The view does implement IsWidget.
>
> My issue is that theGWTDesignerdoes not allow the view to be used.
> My question is does theGWTDesignersupport IsWidget and if it does,

Thomas Broyer

unread,
Jun 28, 2011, 1:43:37 PM6/28/11
to google-we...@googlegroups.com


On Tuesday, June 28, 2011 6:17:31 PM UTC+2, Eric Clayberg - Instantiations wrote:
If you want to create a custom component that will work with GWT
Designer, you should ideally subclass Composite although subclassing
Widget will also work.

If you place your class somewhere other than the Widget hierarchy,
then you really aren't creating a valid GWT UI component. Implementing
an isWidget() method does not actually make the component a widget.

That's true that it's not reall a widget, but it can be used as such (including in UiBinder!) with most widgets, now that they all accept IsWidget as children.

Stefan

unread,
Jun 28, 2011, 4:38:42 PM6/28/11
to Google Web Toolkit
> If you want to create a custom component that will work with GWT
> Designer, you should ideally subclass Composite although subclassing
> Widget will also work.

Well, in my case I was trying to build a widget that extends from
ListEditor so it works with the Editor framework. And since ListEditor
is not part of the Widget hierarchy I figured implementing IsWidget
should do the trick. And it does it for the UiBinder. The GWT Designer
also recognized it as a widget and even managed to preview it.
Unfortunately, the GWT Designer did not allow me to drag and drop it,
nor it showed it in the widget hierarchy. So I was thinking that by
implementing some other interface I can make the GWT Designer work.

Eventually, I figured out that ListEditor is a bad choice, so I
rewrote my widget and now it extends from Composite and all is good.

Thanks
Stefan
Reply all
Reply to author
Forward
0 new messages