setStyleName(CLASSNAME);
}
- private ComponentConnector getPaintable() {
- return ConnectorMap.get(client).getConnector(this);
+ private GridLayoutConnector getConnector() {
+ return (GridLayoutConnector) ConnectorMap.get(client)
+ .getConnector(this);
}
/**
}
private boolean isUndefinedHeight() {
- return getPaintable().isUndefinedHeight();
+ return getConnector().isUndefinedHeight();
}
private boolean isUndefinedWidth() {
- return getPaintable().isUndefinedWidth();
+ return getConnector().isUndefinedWidth();
}
private void detectRowHeights() {
public boolean hasRelativeHeight() {
if (slot != null) {
- return slot.getPaintable().isRelativeHeight();
+ return slot.getChild().isRelativeHeight();
} else {
return true;
}
protected boolean hasRelativeWidth() {
if (slot != null) {
- return slot.getPaintable().isRelativeWidth();
+ return slot.getChild().isRelativeWidth();
} else {
return true;
}
// about childUidl
hasContent = childUidl != null;
if (hasContent) {
- ComponentConnector paintable = client.getPaintable(childUidl);
+ ComponentConnector childConnector = client
+ .getPaintable(childUidl);
- if (slot == null || slot.getPaintable() != paintable) {
+ if (slot == null || slot.getChild() != childConnector) {
slot = new ComponentConnectorLayoutSlot(CLASSNAME,
- paintable);
+ childConnector, getConnector());
Element slotWrapper = slot.getWrapperElement();
getElement().appendChild(slotWrapper);
- Widget widget = paintable.getWidget();
+ Widget widget = childConnector.getWidget();
insert(widget, slotWrapper, getWidgetCount(), false);
Cell oldCell = widgetToCell.put(widget, this);
if (oldCell != null) {
}
}
- paintable.updateFromUIDL(childUidl, client);
+ childConnector.updateFromUIDL(childUidl, client);
}
}
public class ComponentConnectorLayoutSlot extends VLayoutSlot {
- final ComponentConnector paintable;
- private LayoutManager layoutManager;
+ final ComponentConnector child;
+ final ManagedLayout layout;
public ComponentConnectorLayoutSlot(String baseClassName,
- ComponentConnector paintable) {
- super(baseClassName, paintable.getWidget());
- this.paintable = paintable;
- layoutManager = paintable.getLayoutManager();
+ ComponentConnector child, ManagedLayout layout) {
+ super(baseClassName, child.getWidget());
+ this.child = child;
+ this.layout = layout;
}
- public ComponentConnector getPaintable() {
- return paintable;
+ public ComponentConnector getChild() {
+ return child;
}
@Override
protected int getCaptionHeight() {
VCaption caption = getCaption();
- return caption != null ? layoutManager.getOuterHeight(caption
- .getElement()) : 0;
+ return caption != null ? getLayoutManager().getOuterHeight(
+ caption.getElement()) : 0;
}
@Override
protected int getCaptionWidth() {
VCaption caption = getCaption();
- return caption != null ? layoutManager.getOuterWidth(caption
- .getElement()) : 0;
+ return caption != null ? getLayoutManager().getOuterWidth(
+ caption.getElement()) : 0;
+ }
+
+ public LayoutManager getLayoutManager() {
+ return layout.getLayoutManager();
}
@Override
public void setCaption(VCaption caption) {
VCaption oldCaption = getCaption();
if (oldCaption != null) {
- layoutManager.unregisterDependency(
- (ManagedLayout) paintable.getParent(),
+ getLayoutManager().unregisterDependency(layout,
oldCaption.getElement());
}
super.setCaption(caption);
if (caption != null) {
- layoutManager
- .registerDependency((ManagedLayout) paintable.getParent(),
- caption.getElement());
+ getLayoutManager().registerDependency(
+ (ManagedLayout) child.getParent(), caption.getElement());
}
}
@Override
public int getWidgetHeight() {
- return layoutManager.getOuterHeight(paintable.getWidget().getElement());
+ return getLayoutManager()
+ .getOuterHeight(child.getWidget().getElement());
}
@Override
public int getWidgetWidth() {
- return layoutManager.getOuterWidth(paintable.getWidget().getElement());
+ return getLayoutManager().getOuterWidth(child.getWidget().getElement());
}
@Override
public boolean isUndefinedHeight() {
- return paintable.isUndefinedHeight();
+ return child.isUndefinedHeight();
}
@Override
public boolean isUndefinedWidth() {
- return paintable.isUndefinedWidth();
+ return child.isUndefinedWidth();
}
@Override
public boolean isRelativeHeight() {
- return paintable.isRelativeHeight();
+ return child.isRelativeHeight();
}
@Override
public boolean isRelativeWidth() {
- return paintable.isRelativeWidth();
+ return child.isRelativeWidth();
}
}