开发者

Extend GWT widget built using UIBinder

开发者 https://www.devze.com 2022-12-27 02:22 出处:网络
I\'m trying to extend a GWT widget that is built using UIBinder. UIBinder expects the fields in ui.xml to be in the extended widget. The problem that was well described开发者_如何转开发 by \'Blessed G

I'm trying to extend a GWT widget that is built using UIBinder. UIBinder expects the fields in ui.xml to be in the extended widget. The problem that was well described开发者_如何转开发 by 'Blessed Geek' on Google Groups. Any tips/tricks?


'Blessed Geek' found the right solution here: the caption is in a composition relationship with its panel. As such, it should use a different class (which could be a static inner class to keep things together).

In my experience, inheritance works with UiBinder, as long as your subclass' ui.xml file defines all the ui:field of its superclass. If it doesn't, then inheritance might not be the right pattern. (Naturally, you can always add fields in your subclass.)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号