]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixed wrong function name + fixes to tabsheet
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 6 Nov 2007 09:10:41 +0000 (09:10 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 6 Nov 2007 09:10:41 +0000 (09:10 +0000)
svn changeset:2717/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/Util.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IExpandLayout.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java
src/com/itmill/toolkit/terminal/gwt/client/ui/ISplitPanel.java
src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java

index f0c7883ad2429b95be7b0851f3f02626b1118f36..6540e662ec9cfe9499983adcf63a61234977f9a2 100644 (file)
@@ -66,7 +66,7 @@ public class Util {
         * 
         * @param container
         */
-       public static void runAncestorsLayout(HasWidgets container) {
+       public static void runDescendentsLayout(HasWidgets container) {
                Iterator childWidgets = container.iterator();
                while (childWidgets.hasNext()) {
                        Widget child = (Widget) childWidgets.next();
@@ -74,7 +74,7 @@ public class Util {
                                ((ContainerResizedListener) child).iLayout();
                        } else if (child instanceof HasWidgets) {
                                HasWidgets childContainer = (HasWidgets) child;
-                               runAncestorsLayout(childContainer);
+                               runDescendentsLayout(childContainer);
                        }
                }
        }
index 2854e1635ef8b1bfa84fcfd084b3eba10da6b673..2a838fba1b77d48a2f8dedad86cf5efe59a7d2f9 100644 (file)
@@ -160,7 +160,7 @@ public class IExpandLayout extends IOrderedLayout implements
                DOM.removeChild(childContainer, meter);
 
                // TODO save previous size and only propagate if really changed
-               Util.runAncestorsLayout(this);
+               Util.runDescendentsLayout(this);
        }
 
 }
index 8f894990fed88f143df925c18818ede4e9413d6d..6bcaf49d6eb7eba2b76924e2f0596a3a0b72d581 100644 (file)
@@ -145,7 +145,7 @@ public class IPanel extends SimplePanel implements Paintable,
                } else {
                        DOM.setStyleAttribute(contentNode, "height", "");
                }
-               Util.runAncestorsLayout(this);
+               Util.runDescendentsLayout(this);
        }
 
 }
index 7b6b7abcd892dd21a0544edc8e8832a490f34998..1e6a043d102d263a547385c9bc981d769f200e7f 100644 (file)
@@ -186,7 +186,6 @@ public class ISplitPanel extends ComplexPanel implements Paintable,
                        pixelPosition = DOM.getElementPropertyInt(splitter, "offsetTop");
 
                        // reposition splitter in case it is out of box
-                       int pixelSize = getSplitterSize();
                        if (pixelPosition > 0
                                        && pixelPosition + getSplitterSize() > wholeSize) {
                                pixelPosition = wholeSize - getSplitterSize();
@@ -212,7 +211,7 @@ public class ISplitPanel extends ComplexPanel implements Paintable,
                        break;
                }
 
-               Util.runAncestorsLayout(this);
+               Util.runDescendentsLayout(this);
        }
 
        private void setFirstWidget(Widget w) {
index cb766441d36ccc9236fda192990505c2160c2a6d..b98c92581a27035fc1ee8704b6476d67651c5d9d 100644 (file)
@@ -45,10 +45,13 @@ public class ITabsheet extends FlowPanel implements Paintable,
                        if (ITabsheet.this.client != null
                                        && ITabsheet.this.activeTabIndex != tabIndex) {
                                addStyleDependentName("loading");
-                               ITabsheet.this.tp.getWidget(
-                                               ITabsheet.this.tp.getVisibleWidget()).setVisible(false);
+                               // run updating variables in deferred command to bypass some FF
+                               // optimization issues
                                DeferredCommand.addCommand(new Command() {
                                        public void execute() {
+                                               ITabsheet.this.tp.getWidget(
+                                                               ITabsheet.this.tp.getVisibleWidget())
+                                                               .setVisible(false);
                                                ITabsheet.this.client.updateVariable(ITabsheet.this.id,
                                                                "selected", ""
                                                                                + ITabsheet.this.tabKeys.get(tabIndex),
@@ -117,14 +120,11 @@ public class ITabsheet extends FlowPanel implements Paintable,
 
                // Height calculations
                if (h != null) {
-                       setHeight(h);
+                       if (!h.equals(height))
+                               setHeight(h);
                } else {
                        this.height = null;
-                       this.tp.setHeight("auto");
-                       // We don't need overflow:auto when tabsheet height is not set
-                       // TODO reconsider, we might sometimes have wide, non-breaking
-                       // content
-                       DOM.setStyleAttribute(this.tp.getElement(), "overflow", "hidden");
+                       this.tp.setHeight("");
                }
 
                // Render content
@@ -181,14 +181,12 @@ public class ITabsheet extends FlowPanel implements Paintable,
 
                // Open selected tab
                this.tb.selectTab(this.activeTabIndex);
-               // tp.showWidget(activeTabIndex);
 
        }
 
        private void renderContent(final UIDL contentUIDL) {
                DeferredCommand.addCommand(new Command() {
                        public void execute() {
-                               // Loading done, start drawing
                                Widget content = ITabsheet.this.client.getWidget(contentUIDL);
                                ITabsheet.this.tp.remove(ITabsheet.this.activeTabIndex);
                                ITabsheet.this.tp
@@ -197,8 +195,10 @@ public class ITabsheet extends FlowPanel implements Paintable,
                                ((Paintable) content).updateFromUIDL(contentUIDL,
                                                ITabsheet.this.client);
                                removeStyleDependentName("loading");
+                               ITabsheet.this.iLayout();
                        }
                });
+
        }
 
        private void clearTabs() {
@@ -234,6 +234,6 @@ public class ITabsheet extends FlowPanel implements Paintable,
                        this.tp.setHeight(neededHeight - pixelHeight + "px");
                        DOM.setStyleAttribute(this.tp.getElement(), "overflow", "");
                }
-               Util.runAncestorsLayout(this);
+               Util.runDescendentsLayout(this);
        }
 }
index 30fe2a3d4e5b5630e8456c81604450462c96be65..80184505e4ab9c9d1fa5af67ea04a2b2a5d7366f 100644 (file)
@@ -152,7 +152,7 @@ public class IView extends SimplePanel implements Paintable,
        }
 
        public void onWindowResized(int width, int height) {
-               Util.runAncestorsLayout(this);
+               Util.runDescendentsLayout(this);
        }
 
 }
index e6694023dadef50243c2217c6ad1e0a575d3e0e3..c5ab9c9463e90f4e515617ad077893060c6fba8a 100644 (file)
@@ -342,7 +342,7 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener {
                        client.updateVariable(id, "height", h, false);
                }
                // Update child widget dimensions
-               Util.runAncestorsLayout(this);
+               Util.runDescendentsLayout(this);
        }
 
        public void setWidth(String width) {