Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java GWT:SplitLayoutPanel UiBinder_Java_Gwt_Resize_Uibinder - Fatal编程技术网

Java GWT:SplitLayoutPanel UiBinder

Java GWT:SplitLayoutPanel UiBinder,java,gwt,resize,uibinder,Java,Gwt,Resize,Uibinder,我也有类似的问题 有没有办法重写onResize方法并在uibinder中使用它 SplitLayoutPanel mainPanel = new SplitLayoutPanel() { @Override public void onResize() { super.onResize(); //some other resizing stuff } }; 对。定义类: package com.foo; publ

我也有类似的问题

有没有办法重写onResize方法并在uibinder中使用它

SplitLayoutPanel mainPanel = new SplitLayoutPanel() {
    @Override
    public void onResize() {
        super.onResize();
        //some other resizing stuff
    }           
};
对。定义类:

package com.foo;

public class MySplitLayoutPanel extends SplitLayoutPanel() {
  @Override
  public void onResize() {
    super.onResize();
    //some other resizing stuff
  }           
};
然后将类所在的包绑定到您选择的xml名称空间(与
UiBinder
模板中定义的其他名称空间不冲突):

这是针对
UiBinder
部分的,但我认为您链接的答案根本不是解决方案,因为当浏览器窗口调整大小时,
onResize()
也将被调用(主要是)

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
             xmlns:g='urn:import:com.google.gwt.user.client.ui'
             xmlns:foo='urn:import:com.foo'>
<foo:MySplitLayoutPanel />