]> source.dussan.org Git - vaadin-framework.git/commitdiff
enhanced absolute grid
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 7 Oct 2008 11:44:09 +0000 (11:44 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 7 Oct 2008 11:44:09 +0000 (11:44 +0000)
svn changeset:5604/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/absolutegrid/ISizeableGridLayout.java

index ed07b06f2a0dec43aeb5c9186a71477451c27a14..918b91639095b0b321741d2bb2d6123dee20652d 100644 (file)
@@ -28,7 +28,7 @@ public class ISizeableGridLayout extends IAbsoluteGrid implements Paintable,
         Container {
     public static final String CLASSNAME = "i-gridlayout";
     private int spacing;
-    private HashMap paintableToCellMap = new HashMap();
+    private HashMap<Paintable, IAbsoluteGridCell> paintableToCellMap = new HashMap<Paintable, IAbsoluteGridCell>();
     private MarginPixels mp;
     private String oldStyleString = "";
 
@@ -183,8 +183,7 @@ public class ISizeableGridLayout extends IAbsoluteGrid implements Paintable,
     }
 
     public void updateCaption(Paintable component, UIDL uidl) {
-        IAbsoluteGridCell cell = (IAbsoluteGridCell) paintableToCellMap
-                .get(component);
+        IAbsoluteGridCell cell = paintableToCellMap.get(component);
         ICaption c = cell.getCaption();
         if (c == null) {
             c = new ICaption(component, client);
@@ -251,13 +250,22 @@ public class ISizeableGridLayout extends IAbsoluteGrid implements Paintable,
     }
 
     public boolean requestLayout(Set<Paintable> child) {
-        // TODO Auto-generated method stub
-        return false;
+        for (Iterator iterator = child.iterator(); iterator.hasNext();) {
+            Paintable paintable = (Paintable) iterator.next();
+            if (hasChildComponent((Widget) paintable)) {
+                IAbsoluteGridCell absoluteGridCell = paintableToCellMap
+                        .get(paintable);
+                absoluteGridCell.vAling();
+            }
+        }
+        // always has size, never change due child change
+        return true;
     }
 
     public RenderSpace getAllocatedSpace(Widget child) {
-        // TODO Auto-generated method stub
-        return null;
+        com.google.gwt.dom.client.Element e = child.getElement()
+                .getParentElement();
+        return new RenderSpace(e.getOffsetWidth(), e.getOffsetHeight());
     }
 
 }