public void setComponentResized(JavaScriptObject aValue) { if (componentResized != aValue) { if (componentResizedReg != null) { componentResizedReg.removeHandler(); componentResizedReg = null; } componentResized = aValue; if (componentResized != null && component instanceof HasResizeHandlers) componentResizedReg = ((HasResizeHandlers) component).addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { if (componentResized != null) { executeEvent(componentResized, EventsPublisher.publish(event)); } } }); } }