]> source.dussan.org Git - vaadin-framework.git/commitdiff
Deprecated methods which do nothing and removed dead code (#10432) 42/442/2
authorArtur Signell <artur@vaadin.com>
Thu, 29 Nov 2012 17:43:57 +0000 (19:43 +0200)
committerVaadin Code Review <review@vaadin.com>
Wed, 5 Dec 2012 09:58:20 +0000 (09:58 +0000)
Change-Id: I5248a28289bc85cf737b43c7ac87f1b2c2e41a01

client/src/com/vaadin/client/ApplicationConnection.java
client/src/com/vaadin/client/ContainerResizedListener.java
client/src/com/vaadin/client/ui/VAccordion.java
client/src/com/vaadin/client/ui/VScrollTable.java
client/src/com/vaadin/client/ui/VTabsheet.java
client/src/com/vaadin/client/ui/VWindow.java
client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java

index 86ef6b054292406c7ddbfa2792ce40518268a324..e5c7011436c26e09e4ce2f586dd27e52c3dd487a 100644 (file)
@@ -2615,20 +2615,14 @@ public class ApplicationConnection {
         return result.toString();
     }
 
-    private boolean runningLayout = false;
-
     /**
-     * Causes a re-calculation/re-layout of all paintables in a container.
+     * Does absolutely nothing. Replaced by {@link LayoutManager}.
      * 
      * @param container
+     * @deprecated As of 7.0, serves no purpose
      */
+    @Deprecated
     public void runDescendentsLayout(HasWidgets container) {
-        if (runningLayout) {
-            return;
-        }
-        runningLayout = true;
-        internalRunDescendentsLayout(container);
-        runningLayout = false;
     }
 
     /**
@@ -2643,54 +2637,26 @@ public class ApplicationConnection {
         VConsole.log("forceLayout in " + duration.elapsedMillis() + " ms");
     }
 
-    private void internalRunDescendentsLayout(HasWidgets container) {
-        // getConsole().log(
-        // "runDescendentsLayout(" + Util.getSimpleName(container) + ")");
-        final Iterator<Widget> childWidgets = container.iterator();
-        while (childWidgets.hasNext()) {
-            final Widget child = childWidgets.next();
-
-            if (getConnectorMap().isConnector(child)) {
-
-                if (handleComponentRelativeSize(child)) {
-                    /*
-                     * Only need to propagate event if "child" has a relative
-                     * size
-                     */
-
-                    if (child instanceof ContainerResizedListener) {
-                        ((ContainerResizedListener) child).iLayout();
-                    }
-
-                    if (child instanceof HasWidgets) {
-                        final HasWidgets childContainer = (HasWidgets) child;
-                        internalRunDescendentsLayout(childContainer);
-                    }
-                }
-            } else if (child instanceof HasWidgets) {
-                // propagate over non Paintable HasWidgets
-                internalRunDescendentsLayout((HasWidgets) child);
-            }
-
-        }
-    }
-
     /**
-     * Converts relative sizes into pixel sizes.
+     * Returns false
      * 
-     * @param child
-     * @return true if the child has a relative size
+     * @param paintable
+     * @return false, always
+     * @deprecated As of 7.0, serves no purpose
      */
+    @Deprecated
     private boolean handleComponentRelativeSize(ComponentConnector paintable) {
         return false;
     }
 
     /**
-     * Converts relative sizes into pixel sizes.
+     * Returns false
      * 
-     * @param child
-     * @return true if the child has a relative size
+     * @param paintable
+     * @return false, always
+     * @deprecated As of 7.0, serves no purpose
      */
+    @Deprecated
     public boolean handleComponentRelativeSize(Widget widget) {
         return handleComponentRelativeSize(connectorMap.getConnector(widget));
 
index 3ccf68f9f9f3282db8dcf3633e0c05a7b3dcb031..5ea677eee87f4569932526df168f764856c5e7f8 100644 (file)
@@ -19,7 +19,11 @@ package com.vaadin.client;
 /**
  * ContainerResizedListener interface is useful for Widgets that support
  * relative sizes and who need some additional sizing logic.
+ * 
+ * @deprecated As of 7.0, serves no purpose. Use {@link LayoutManager} and its
+ *             methods instead.
  */
+@Deprecated
 public interface ContainerResizedListener {
     /**
      * This function is run when container box has been resized. Object
@@ -28,6 +32,9 @@ public interface ContainerResizedListener {
      * container has resized. runAnchestorsLayout(HasWidgets parent) function
      * from Util class may be a good helper for this.
      * 
+     * @deprecated As of 7.0, this method is never called by the framework.
+     * 
      */
+    @Deprecated
     public void iLayout();
 }
index b99d170c2367cb95fffac0517748f37ce74a81ce..90af5bf934d68df65edaa9d850c053a45276ae43 100644 (file)
@@ -379,13 +379,6 @@ public class VAccordion extends VTabsheetBase {
             } else if (getChildWidget() != newWidget) {
                 replaceWidget(newWidget);
             }
-            if (contentUidl.getBooleanAttribute("cached")) {
-                /*
-                 * The size of a cached, relative sized component must be
-                 * updated to report correct size.
-                 */
-                client.handleComponentRelativeSize(newPntbl.getWidget());
-            }
             if (isOpen() && isDynamicHeight()) {
                 setHeightFromWidget();
             }
index e0bd15995151dcf5d1b625e8d635d58c7786b1df..f74573c5c047de25d9d3edd2a0a10292bcdb442a 100644 (file)
@@ -1833,14 +1833,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
         }
 
         // TODO refactor this code to be the same as in resize timer
-        boolean needsReLayout = false;
 
         if (availW > total) {
             // natural size is smaller than available space
             final int extraSpace = availW - total;
             final int totalWidthR = total - totalExplicitColumnsWidths;
             int checksum = 0;
-            needsReLayout = true;
 
             if (extraSpace == 1) {
                 // We cannot divide one single pixel so we give it the first
@@ -1930,10 +1928,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
 
         initializedAndAttached = true;
 
-        if (needsReLayout) {
-            scrollBody.reLayoutComponents();
-        }
-
         updatePageLength();
 
         /*
@@ -2007,7 +2001,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
          * Ensures the column alignments are correct at initial loading. <br/>
          * (child components widths are correct)
          */
-        scrollBody.reLayoutComponents();
         Scheduler.get().scheduleDeferred(new Command() {
 
             @Override
@@ -4526,15 +4519,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
             }
         }
 
-        private void reLayoutComponents() {
-            for (Widget w : this) {
-                VScrollTableRow r = (VScrollTableRow) w;
-                for (Widget widget : r) {
-                    client.handleComponentRelativeSize(widget);
-                }
-            }
-        }
-
         public int getLastRendered() {
             return lastRendered;
         }
@@ -6096,7 +6080,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
                     Util.notifyParentOfSizeChange(VScrollTable.this, false);
                 }
             }
-            scrollBody.reLayoutComponents();
             Scheduler.get().scheduleDeferred(new Command() {
 
                 @Override
index a63af0ba6f7b78237f4547ef0387397364bb36bc..9e6ee75965a8d15463848f84875d66053b3ad9c1 100644 (file)
@@ -939,13 +939,6 @@ public class VTabsheet extends VTabsheetBase implements Focusable,
         tp.showWidget(activeTabIndex);
 
         VTabsheet.this.iLayout();
-        /*
-         * The size of a cached, relative sized component must be updated to
-         * report correct size to updateOpenTabSize().
-         */
-        if (contentUIDL.getBooleanAttribute("cached")) {
-            client.handleComponentRelativeSize(content.getWidget());
-        }
         updateOpenTabSize();
         VTabsheet.this.removeStyleDependentName("loading");
     }
index dc64eb75298d857b26112d5c4d5242085b668d1e..5c0d895d5942f795eb84589ba7beb769c2ffbdae 100644 (file)
@@ -35,7 +35,6 @@ import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.HasWidgets;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.client.ApplicationConnection;
 import com.vaadin.client.BrowserInfo;
@@ -738,16 +737,6 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
     }
 
     private void updateContentsSize() {
-        Widget childWidget = getWidget();
-
-        // Update child widget dimensions
-        if (client != null && childWidget != null) {
-            client.handleComponentRelativeSize(childWidget);
-            if (childWidget instanceof HasWidgets) {
-                client.runDescendentsLayout((HasWidgets) childWidget);
-            }
-        }
-
         LayoutManager layoutManager = getLayoutManager();
         layoutManager.setNeedsMeasure(ConnectorMap.get(client).getConnector(
                 this));
index edf257ad52f8cc5163d54a2b0af7ba92c5bf1916..c5cc0194c47b7f8b3e24291e85164a063c8e067a 100644 (file)
@@ -67,15 +67,6 @@ public class TabsheetConnector extends TabsheetBaseConnector implements
 
         getWidget().iLayout();
 
-        // Re run relative size update to ensure optimal scrollbars
-        // TODO isolate to situation that visible tab has undefined height
-        try {
-            client.handleComponentRelativeSize(getWidget().tp
-                    .getWidget(getWidget().tp.getVisibleWidget()));
-        } catch (Exception e) {
-            // Ignore, most likely empty tabsheet
-        }
-
         getWidget().waitingForResponse = false;
     }