public class ICustomComponent extends SimplePanel implements Container {
private static final String CLASSNAME = "i-customcomponent";
+ private String height;
+ private ApplicationConnection client;
+ private Paintable component;
+ private boolean rendering;
+ private String width;
public ICustomComponent() {
super();
}
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+ rendering = true;
if (client.updateComponent(this, uidl, true)) {
+ rendering = false;
return;
}
+ this.client = client;
final UIDL child = uidl.getChildUIDL(0);
if (child != null) {
clear();
}
setWidget((Widget) p);
+ component = p;
}
p.updateFromUIDL(child, client);
}
-
+ rendering = false;
}
public boolean hasChildComponent(Widget component) {
}
public void updateCaption(Paintable component, UIDL uidl) {
- // TODO custom component could handle its composition roots caption
+ // NOP, custom component dont render composition roots caption
}
public boolean requestLayout(Set<Paintable> child) {
.getOffsetHeight());
}
+ @Override
+ public void setHeight(String height) {
+ super.setHeight(height);
+ if (!height.equals(this.height)) {
+ this.height = height;
+ if (!rendering) {
+ client.runDescendentsLayout(this);
+ }
+ }
+ }
+
+ @Override
+ public void setWidth(String width) {
+ super.setWidth(width);
+ if (!width.equals(this.width)) {
+ this.width = width;
+ if (!rendering) {
+ client.runDescendentsLayout(this);
+ }
+ }
+ }
+
}