// Changed invisibile <-> visible
if (wasVisible && manageCaption) {
// Must hide caption when component is hidden
- updateCaption(paintable, uidl);
+ paintable.getParent().updateCaption(paintable, uidl);
}
}
// Set captions
if (manageCaption) {
- updateCaption(paintable, uidl);
+ paintable.getParent().updateCaption(paintable, uidl);
}
// add error classname to components w/ error
return false;
}
- @Deprecated
- private void updateCaption(VPaintableWidget paintable, UIDL uidl) {
- VPaintableWidgetContainer parent = paintable.getParentPaintable();
- parent.updateCaption(paintable, uidl);
- }
-
/**
* Generates the style name for the widget based on the given primary style
* name (typically returned by Widget.getPrimaryStyleName()) and the UIDL.
boolean horizontalScrollBar = false;
boolean verticalScrollBar = false;
- VPaintableWidgetContainer parentPaintable = paintable
- .getParentPaintable();
+ VPaintableWidgetContainer parentPaintable = paintable.getParent();
RenderSpace renderSpace;
// Parent-less components (like sub-windows) are relative to browser
private Widget widget;
private ApplicationConnection connection;
private String id;
-
+ private VPaintableWidgetContainer parent;
+
/* State variables */
private boolean enabled = true;
this.id = id;
}
- public VPaintableWidgetContainer getParentPaintable() {
- // FIXME: Return VPaintableWidgetContainer
- // FIXME: Store hierarchy instead of doing lookup every time
-
+ public VPaintableWidgetContainer getParent() {
+ if (parent != null)
+ return parent;
+
+ // FIXME: Hierarchy should be set by framework instead of looked up here
VPaintableMap paintableMap = VPaintableMap.get(getConnection());
Widget w = getWidgetForPaintable();
while (w != null) {
w = w.getParent();
if (paintableMap.isPaintable(w)) {
- return (VPaintableWidgetContainer) paintableMap.getPaintable(w);
+ parent = (VPaintableWidgetContainer) paintableMap.getPaintable(w);
+ return parent;
}
}