我目前正在与SmartGWT合作,并一直试图获得一种方法,将gwt标准VerticalPanel等面板纳入智能GWT窗口.VerticalPanel的原因是我可以将小部件附加到verticalpanel对象,而无需重新设置整个内容,例如:
HTMLPane hPaneObj = new HTMLPane();
hPaneObj.setContents("Foo");
Run Code Online (Sandbox Code Playgroud)
现在要追加我只能看到我能做到:
hPaneObj.setContents(hPaneObj.getContents() + "Bar");
Run Code Online (Sandbox Code Playgroud)
这不是我需要的.
在我添加了VerticalPanel之后出现问题,即使使用带有true的'setCanSelectText'方法作为参数,我也无法在窗口中选择任何文本.以下是我放在一起的简短示例:
public void onModuleLoad() {
Window theWindow = new Window();
theWindow.setTitle("Good evening");
theWindow.setWidth(500);
theWindow.setHeight(500);
theWindow.setCanSelectText(true);
VerticalPanel vp = new VerticalPanel();
vp.add(new HTML("foo"));
vp.add(new HTML("bar"));
theWindow.addItem(vp);
Canvas canvas = new Canvas();
canvas.addChild(theWindow);
canvas.draw();
}
Run Code Online (Sandbox Code Playgroud)
然而,我很惊讶HTMLPane不允许我在不重置整个内容的情况下追加.
任何建议都会受到赞赏,但我需要能够'追加'到专家组.我并不特别喜欢使用垂直面板的想法,但我需要找到允许上述方法或允许我允许垂直面板可访问的方法,即选择文本.
非常感谢
克里斯托弗.