Changeset cc74de9d3 in vaadin
- Timestamp:
- 03/21/12 13:28:09 (14 months ago)
- Branches:
- master, 7.0, 8a42394c6341f26066f41d3560f2419658a67a62
- Children:
- 0ccbb6f7
- Parents:
- 49c33ff2d
- git-author:
- Artur Signell <artur@…> (03/20/12 13:57:37)
- git-committer:
- Artur Signell <artur@…> (03/21/12 13:28:09)
- Location:
- src/com/vaadin/terminal/gwt/client/ui
- Files:
-
- 3 edited
-
AbstractOrderedLayoutConnector.java (modified) (1 diff)
-
VGridLayout.java (modified) (6 diffs)
-
layout/ComponentConnectorLayoutSlot.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java
rce24fb4f rcc74de9d3 242 242 // create a new slot. 243 243 slot = new ComponentConnectorLayoutSlot(getWidget() 244 .getStylePrimaryName(), child );244 .getStylePrimaryName(), child, this); 245 245 } 246 246 layout.addOrMove(slot, currentIndex++); -
src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
r6cf9afc8 rcc74de9d3 60 60 } 61 61 62 private ComponentConnector getPaintable() { 63 return ConnectorMap.get(client).getConnector(this); 62 private GridLayoutConnector getConnector() { 63 return (GridLayoutConnector) ConnectorMap.get(client) 64 .getConnector(this); 64 65 } 65 66 … … 236 237 237 238 private boolean isUndefinedHeight() { 238 return get Paintable().isUndefinedHeight();239 return getConnector().isUndefinedHeight(); 239 240 } 240 241 241 242 private boolean isUndefinedWidth() { 242 return get Paintable().isUndefinedWidth();243 return getConnector().isUndefinedWidth(); 243 244 } 244 245 … … 456 457 public boolean hasRelativeHeight() { 457 458 if (slot != null) { 458 return slot.get Paintable().isRelativeHeight();459 return slot.getChild().isRelativeHeight(); 459 460 } else { 460 461 return true; … … 514 515 protected boolean hasRelativeWidth() { 515 516 if (slot != null) { 516 return slot.get Paintable().isRelativeWidth();517 return slot.getChild().isRelativeWidth(); 517 518 } else { 518 519 return true; … … 552 553 hasContent = childUidl != null; 553 554 if (hasContent) { 554 ComponentConnector paintable = client.getPaintable(childUidl); 555 556 if (slot == null || slot.getPaintable() != paintable) { 555 ComponentConnector childConnector = client 556 .getPaintable(childUidl); 557 558 if (slot == null || slot.getChild() != childConnector) { 557 559 slot = new ComponentConnectorLayoutSlot(CLASSNAME, 558 paintable);560 childConnector, getConnector()); 559 561 Element slotWrapper = slot.getWrapperElement(); 560 562 getElement().appendChild(slotWrapper); 561 563 562 Widget widget = paintable.getWidget();564 Widget widget = childConnector.getWidget(); 563 565 insert(widget, slotWrapper, getWidgetCount(), false); 564 566 Cell oldCell = widgetToCell.put(widget, this); … … 569 571 } 570 572 571 paintable.updateFromUIDL(childUidl, client);573 childConnector.updateFromUIDL(childUidl, client); 572 574 } 573 575 } -
src/com/vaadin/terminal/gwt/client/ui/layout/ComponentConnectorLayoutSlot.java
r6cf9afc8 rcc74de9d3 11 11 public class ComponentConnectorLayoutSlot extends VLayoutSlot { 12 12 13 final ComponentConnector paintable;14 private LayoutManager layoutManager;13 final ComponentConnector child; 14 final ManagedLayout layout; 15 15 16 16 public ComponentConnectorLayoutSlot(String baseClassName, 17 ComponentConnector paintable) {18 super(baseClassName, paintable.getWidget());19 this. paintable = paintable;20 layoutManager = paintable.getLayoutManager();17 ComponentConnector child, ManagedLayout layout) { 18 super(baseClassName, child.getWidget()); 19 this.child = child; 20 this.layout = layout; 21 21 } 22 22 23 public ComponentConnector get Paintable() {24 return paintable;23 public ComponentConnector getChild() { 24 return child; 25 25 } 26 26 … … 28 28 protected int getCaptionHeight() { 29 29 VCaption caption = getCaption(); 30 return caption != null ? layoutManager.getOuterHeight(caption31 .getElement()) : 0;30 return caption != null ? getLayoutManager().getOuterHeight( 31 caption.getElement()) : 0; 32 32 } 33 33 … … 35 35 protected int getCaptionWidth() { 36 36 VCaption caption = getCaption(); 37 return caption != null ? layoutManager.getOuterWidth(caption 38 .getElement()) : 0; 37 return caption != null ? getLayoutManager().getOuterWidth( 38 caption.getElement()) : 0; 39 } 40 41 public LayoutManager getLayoutManager() { 42 return layout.getLayoutManager(); 39 43 } 40 44 … … 43 47 VCaption oldCaption = getCaption(); 44 48 if (oldCaption != null) { 45 layoutManager.unregisterDependency( 46 (ManagedLayout) paintable.getParent(), 49 getLayoutManager().unregisterDependency(layout, 47 50 oldCaption.getElement()); 48 51 } 49 52 super.setCaption(caption); 50 53 if (caption != null) { 51 layoutManager 52 .registerDependency((ManagedLayout) paintable.getParent(), 53 caption.getElement()); 54 getLayoutManager().registerDependency( 55 (ManagedLayout) child.getParent(), caption.getElement()); 54 56 } 55 57 } … … 57 59 @Override 58 60 public int getWidgetHeight() { 59 return layoutManager.getOuterHeight(paintable.getWidget().getElement()); 61 return getLayoutManager() 62 .getOuterHeight(child.getWidget().getElement()); 60 63 } 61 64 62 65 @Override 63 66 public int getWidgetWidth() { 64 return layoutManager.getOuterWidth(paintable.getWidget().getElement());67 return getLayoutManager().getOuterWidth(child.getWidget().getElement()); 65 68 } 66 69 67 70 @Override 68 71 public boolean isUndefinedHeight() { 69 return paintable.isUndefinedHeight();72 return child.isUndefinedHeight(); 70 73 } 71 74 72 75 @Override 73 76 public boolean isUndefinedWidth() { 74 return paintable.isUndefinedWidth();77 return child.isUndefinedWidth(); 75 78 } 76 79 77 80 @Override 78 81 public boolean isRelativeHeight() { 79 return paintable.isRelativeHeight();82 return child.isRelativeHeight(); 80 83 } 81 84 82 85 @Override 83 86 public boolean isRelativeWidth() { 84 return paintable.isRelativeWidth();87 return child.isRelativeWidth(); 85 88 } 86 89 }
Note: See TracChangeset
for help on using the changeset viewer.
