克隆一组小部件 [英] Clone a panel of widgets
问题描述
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屋!