克隆一组小部件 [英] Clone a panel of widgets

查看:117
本文介绍了克隆一组小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GWT有可能克隆一个面板吗?如果是的话,所有的处理程序设置是否也被复制过?



基本上我有一个完整的控制面板,所有布局,我想复制它并弹出一个PopupPanel,而不必经过创建控件的代码。



我得到了DOM.clone(),并且此消息帖子。但是在Widget,UIObject等中没有wrap()方法,setElement()被保护。 GWT小部件,包含所有这些控件?这样,您可以在两个地方托管窗口小部件面板,而无需克隆它。 (并且可能会在流程中节省您的微妙bug。)


is it possible in GWT to clone a panel? If so, are all the handler settings copied as well?

Basically I have a Panel full of controls, all laid out, I want to copy it and pop it up in a PopupPanel without having to go through the code that created the controls in the first place.

I got as far as DOM.clone(), and this message post. But there is no wrap() in Widget, UIObject etc. setElement() is protected.

解决方案

Have you considered creating a new GWT widget, consisting of all of those controls? That way you can host the widget panel in both places without resorting to cloning it. (And possibly saving you subtle bugs in the process.)

这篇关于克隆一组小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆