我正在尝试使用ResizableComposite
进行简单的实验,记录宽度和宽度。小部件的高度,但我没有得到任何回应。
ResizableFlowPanel
public class ResizableFlowPanel extends FlowPanel implements RequiresResize, ProvidesResize {
public ResizableFlowPanel() {
super();
}
@Override
public void onResize() {
GWT.log(this.getOffsetHeight() +","+this.getOffsetWidth());
}
}
AppBody.java
public class AppBody extends ResizeComposite implements RequiresResize,
ProvidesResize {
private static AppBodyUiBinder uiBinder = GWT.create(AppBodyUiBinder.class);
public AppBody() {
initWidget(uiBinder.createAndBindUi(this));
}
@Override
public void onResize() {
GWT.log(this.getOffsetHeight() + "," + this.getOffsetWidth());
super.onResize();
}
interface AppBodyUiBinder extends UiBinder<Widget, AppBody> {
}
}
AppBody.ui.xml
<ui:UiBinder ...>
<e:ResizableFlowPanel styleName="{bundle.appBodyStyle.app_body}">
</e:ResizableFlowPanel>
</ui:UiBinder>
当我调整浏览器大小时,我没有收到任何日志消息。