Fixes Layout checkstyle errors git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@5878 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/layout/client/LayoutImpl.java b/user/src/com/google/gwt/layout/client/LayoutImpl.java index a5e9730..4085413 100644 --- a/user/src/com/google/gwt/layout/client/LayoutImpl.java +++ b/user/src/com/google/gwt/layout/client/LayoutImpl.java
@@ -60,6 +60,10 @@ protected DivElement relativeRuler; + public void attach(Element parent) { + // Do nothing. This exists only to help LayoutImplIE6 avoid memory leaks. + } + public Element attachChild(Element parent, Element child) { DivElement container = Document.get().createDivElement(); container.appendChild(child); @@ -77,6 +81,10 @@ return container; } + public void detach(Element parent) { + // Do nothing. This exists only to help LayoutImplIE6 avoid memory leaks. + } + public void fillParent(Element elem) { Style style = elem.getStyle(); style.setPosition(Position.ABSOLUTE); @@ -95,9 +103,6 @@ } switch (unit) { - default: - case PX: - return 1; case PCT: return (vertical ? parent.getClientHeight() : parent.getClientWidth()) / 100.0; case EM: @@ -114,6 +119,9 @@ return fixedRuler.getOffsetWidth() / 28.4; case PC: return fixedRuler.getOffsetWidth() / 2.36; + default: + case PX: + return 1; } } @@ -156,12 +164,4 @@ style.clearWidth(); style.clearHeight(); } - - public void detach(Element parent) { - // Do nothing. This exists only to help LayoutImplIE6 avoid memory leaks. - } - - public void attach(Element parent) { - // Do nothing. This exists only to help LayoutImplIE6 avoid memory leaks. - } }
diff --git a/user/src/com/google/gwt/user/client/ui/LayoutPanel.java b/user/src/com/google/gwt/user/client/ui/LayoutPanel.java index 880b8ae..99d067b 100644 --- a/user/src/com/google/gwt/user/client/ui/LayoutPanel.java +++ b/user/src/com/google/gwt/user/client/ui/LayoutPanel.java
@@ -79,6 +79,24 @@ } /** + * Gets the {@link Layer} associated with the given widget. This layer may be + * used to manipulate the child widget's layout constraints. + * + * <p> + * After you have made changes to any of the child widgets' constraints, you + * must call one of the {@link HasAnimatedLayout} methods for those changes to + * be reflected visually. + * </p> + * + * @param child the child widget whose layer is to be retrieved + * @return the associated layer + */ + public Layout.Layer getLayer(Widget child) { + assert child.getParent() == this : "The requested widget is not a child of this panel"; + return (Layout.Layer) child.getLayoutData(); + } + + /** * This method, or one of its overloads, must be called whenever any of the * {@link Layout.Layer layers} associated with its children is modified. * @@ -157,24 +175,6 @@ } } - /** - * Gets the {@link Layer} associated with the given widget. This layer may be - * used to manipulate the child widget's layout constraints. - * - * <p> - * After you have made changes to any of the child widgets' constraints, you - * must call one of the {@link HasAnimatedLayout} methods for those changes to - * be reflected visually. - * </p> - * - * @param child the child widget whose layer is to be retrieved - * @return the associated layer - */ - public Layout.Layer getLayer(Widget child) { - assert child.getParent() == this : "The requested widget is not a child of this panel"; - return (Layout.Layer) child.getLayoutData(); - } - @Override public boolean remove(Widget w) { boolean removed = super.remove(w);