Revision: 6083
Author: [email protected]
Date: Thu Sep  3 14:07:51 2009
Log: Checkstyle fixes for DockLayoutPanel. Whoops.
http://code.google.com/p/google-web-toolkit/source/detail?r=6083

Modified:
  /trunk/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java

=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java  Thu  
Sep  3 12:28:14 2009
+++ /trunk/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java  Thu  
Sep  3 14:07:51 2009
@@ -61,6 +61,9 @@
      NORTH, EAST, SOUTH, WEST, CENTER, LINE_START, LINE_END
    }

+  /**
+   * Layout data associated with each widget.
+   */
    protected static class LayoutData {
      public Direction direction;
      public double oldSize, size;
@@ -105,6 +108,28 @@
    public void add(Widget widget, Direction direction, double size) {
      insert(widget, direction, size, null);
    }
+
+  /**
+   * TODO(jgw): Is this really the best way to do this?
+   */
+  public Element getContainerElementFor(Widget widget) {
+    assertIsChild(widget);
+    return  
((LayoutData)widget.getLayoutData()).layer.getContainerElement();
+  }
+
+  /**
+   * Gets the layout direction of the given child widget.
+   *
+   * @param w the widget to be queried
+   * @return the widget's layout direction, or <code>null</code> if it is  
not a
+   *         child of this panel
+   */
+  public Direction getWidgetDirection(Widget w) {
+    if (w.getParent() != this) {
+      return null;
+    }
+    return ((LayoutData) w.getLayoutData()).direction;
+  }

    /**
     * Adds a widget to the specified edge of the dock. If the widget is  
already a
@@ -148,62 +173,6 @@
      // Adopt.
      adopt(widget);
    }
-
-  /**
-   * Gets the layout direction of the given child widget.
-   *
-   * @param w the widget to be queried
-   * @return the widget's layout direction, or <code>null</code> if it is  
not a
-   *         child of this panel
-   */
-  public Direction getWidgetDirection(Widget w) {
-    if (w.getParent() != this) {
-      return null;
-    }
-    return ((LayoutData) w.getLayoutData()).direction;
-  }
-
-  public void onResize() {
-    for (Widget child : getChildren()) {
-      if (child instanceof RequiresResize) {
-        ((RequiresResize) child).onResize();
-      }
-    }
-  }
-
-  @Override
-  public boolean remove(Widget w) {
-    boolean removed = super.remove(w);
-    if (removed) {
-      // Clear the center widget.
-      if (w == center) {
-        center = null;
-      }
-
-      LayoutData data = (LayoutData) w.getLayoutData();
-      layout.removeChild(data.layer);
-    }
-
-    return removed;
-  }
-
-  protected Widget getCenter() {
-    return center;
-  }
-
-  protected Unit getUnit() {
-    return unit;
-  }
-
-  @Override
-  protected void onLoad() {
-    layout.onAttach();
-  }
-
-  @Override
-  protected void onUnload() {
-    layout.onDetach();
-  }

    public void layout() {
      layout(0);
@@ -282,12 +251,46 @@
      });
    }

-  /**
-   * TODO(jgw): Is this really the best way to do this?
-   */
-  public Element getContainerElementFor(Widget widget) {
-    assertIsChild(widget);
-    return  
((LayoutData)widget.getLayoutData()).layer.getContainerElement();
+  public void onResize() {
+    for (Widget child : getChildren()) {
+      if (child instanceof RequiresResize) {
+        ((RequiresResize) child).onResize();
+      }
+    }
+  }
+
+  @Override
+  public boolean remove(Widget w) {
+    boolean removed = super.remove(w);
+    if (removed) {
+      // Clear the center widget.
+      if (w == center) {
+        center = null;
+      }
+
+      LayoutData data = (LayoutData) w.getLayoutData();
+      layout.removeChild(data.layer);
+    }
+
+    return removed;
+  }
+
+  protected Widget getCenter() {
+    return center;
+  }
+
+  protected Unit getUnit() {
+    return unit;
+  }
+
+  @Override
+  protected void onLoad() {
+    layout.onAttach();
+  }
+
+  @Override
+  protected void onUnload() {
+    layout.onDetach();
    }

    private void assertIsChild(Widget widget) {

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to