Revision: 8432
Author: [email protected]
Date: Wed Jul 28 13:10:14 2010
Log: Rolls back UiBinder AbsolutePanelParser due to breakage of existing code.

http://code.google.com/p/google-web-toolkit/source/detail?r=8432

Deleted:
/trunk/user/src/com/google/gwt/uibinder/elementparsers/AbsolutePanelParser.java /trunk/user/test/com/google/gwt/uibinder/elementparsers/AbsolutePanelParserTest.java
Modified:
 /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java
 /trunk/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java
 /trunk/user/src/com/google/gwt/user/client/ui/LayoutPanel.java
 /trunk/user/test/com/google/gwt/uibinder/UiBinderJreSuite.java
 /trunk/user/test/com/google/gwt/uibinder/rebind/DesignTimeUtilsTest.java
 /trunk/user/test/com/google/gwt/uibinder/test/UiJavaResources.java
 /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java
 /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.java
 /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml

=======================================
--- /trunk/user/src/com/google/gwt/uibinder/elementparsers/AbsolutePanelParser.java Wed Jul 28 11:49:56 2010
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.uibinder.elementparsers;
-
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.typeinfo.JClassType;
-import com.google.gwt.uibinder.rebind.UiBinderWriter;
-import com.google.gwt.uibinder.rebind.XMLElement;
-
-/**
- * Parses {...@link com.google.gwt.user.client.ui.AbsolutePanel AbsolutePanel}
- * widgets.
- */
-public class AbsolutePanelParser implements ElementParser {
-
-  private static final String CHILD = "child";
-
-  public void parse(XMLElement elem, String fieldName, JClassType type,
-      UiBinderWriter writer) throws UnableToCompleteException {
-
-    // Parse children.
-    for (XMLElement positionElem : elem.consumeChildElements()) {
-      // Ensure position element.
-      if (!isPositionElement(elem, positionElem)) {
-        writer.die(positionElem, "Only <%s:%s> children are allowed.",
-            elem.getPrefix(), CHILD);
-      }
-
-      // Parse position.
-      String left = positionElem.consumeRequiredIntAttribute("left");
-      String top = positionElem.consumeRequiredIntAttribute("top");
-
-      // Add child widget.
-      XMLElement widgetElem = positionElem.consumeSingleChildElement();
-      String widgetFieldName = writer.parseElementToField(widgetElem);
-      writer.addStatement("%1$s.add(%2$s, %3$s, %4$s);", fieldName,
-          widgetFieldName, left, top);
-    }
-  }
-
-  private boolean isPositionElement(XMLElement parent, XMLElement child) {
-    if (!parent.getNamespaceUri().equals(child.getNamespaceUri())) {
-      return false;
-    }
-    if (!CHILD.equals(child.getLocalName())) {
-      return false;
-    }
-    return true;
-  }
-}
=======================================
--- /trunk/user/test/com/google/gwt/uibinder/elementparsers/AbsolutePanelParserTest.java Wed Jul 28 11:49:56 2010
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.uibinder.elementparsers;
-
-import com.google.gwt.core.ext.UnableToCompleteException;
-
-import junit.framework.TestCase;
-
-import java.util.Iterator;
-
-/**
- * Test for {...@link AbsolutePanelParser}.
- */
-public class AbsolutePanelParserTest extends TestCase {
-
- private static final String PARSED_TYPE = "com.google.gwt.user.client.ui.AbsolutePanel";
-
-  private ElementParserTester tester;
-
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
- tester = new ElementParserTester(PARSED_TYPE, new AbsolutePanelParser());
-  }
-
-  public void testBadChild_namespace() throws Exception {
-    checkBadLine("<ui:blah/>", "Only <g:child> children");
-  }
-
-  public void testBadChild_name() throws Exception {
-    checkBadLine("<g:blah/>", "Only <g:child> children");
-  }
-
-  public void testBadPosition_leftNo() throws Exception {
-    checkBadPosition("top='0'", "Missing required attribute \"left\"");
-  }
-
-  public void testBadPosition_left() throws Exception {
- checkBadPosition("left='bad' top='0'", "Cannot parse attribute \"left\"");
-  }
-
-  public void testBadPosition_topNo() throws Exception {
-    checkBadPosition("left='0'", "Missing required attribute \"top\"");
-  }
-
-  public void testBadPosition_top() throws Exception {
- checkBadPosition("left='0' top='bad'", "Cannot parse attribute \"top\"");
-  }
-
-  public void testBad_noWidget() throws Exception {
-    checkBadLine("<g:child left='1' top='2'/>",
-        "Element must have a single child element");
-  }
-
-  public void testBad_moreThanOneWidget() throws Exception {
-    checkBadLine("<g:child left='1' top='2'>"
-        + "<g:Button id='1'/><g:Button id='2'/></g:child>",
-        "Element may only contain a single child element");
-  }
-
-  private void checkBadLine(String badLine, String expectedDied)
-      throws Exception {
-    StringBuffer b = new StringBuffer();
-    b.append("<g:AbsolutePanel>");
-    b.append("  " + badLine);
-    b.append("</g:AbsolutePanel>");
-
-    try {
-      tester.parse(b.toString());
-      fail();
-    } catch (UnableToCompleteException e) {
-      assertTrue(tester.logger.died.contains(expectedDied));
-    }
-  }
-
- private void checkBadPosition(String positionAttributes, String expectedDied)
-      throws Exception {
-    String badLine = "<g:child " + positionAttributes
-        + "><g:Button/></g:child>";
-    checkBadLine(badLine, expectedDied);
-  }
-
-  public void testGood() throws Exception {
-    StringBuffer b = new StringBuffer();
-    b.append("<g:AbsolutePanel>");
-    b.append("  <g:child left='1' top='2'>");
-    b.append("    <g:Button/>");
-    b.append("  </g:child>");
-    b.append("  <g:child left='10' top='20'>");
-    b.append("    <g:Label/>");
-    b.append("  </g:child>");
-    b.append("</g:AbsolutePanel>");
-
-    String[] expected = {
- "fieldName.add(<g:Button>, 1, 2);", "fieldName.add(<g:Label>, 10, 20);"};
-
-    tester.parse(b.toString());
-
-    Iterator<String> i = tester.writer.statements.iterator();
-    for (String e : expected) {
-      assertEquals(e, i.next());
-    }
-    assertFalse(i.hasNext());
-    assertNull(tester.logger.died);
-  }
-}
=======================================
--- /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java Wed Jul 28 11:49:56 2010 +++ /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java Wed Jul 28 13:10:14 2010
@@ -974,7 +974,6 @@
     addWidgetParser("HasHTML");
     addWidgetParser("HasWidgets");
     addWidgetParser("HTMLPanel");
-    addWidgetParser("AbsolutePanel");
     addWidgetParser("DockPanel");
     addWidgetParser("StackPanel");
     addWidgetParser("DisclosurePanel");
=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java Wed Jul 28 11:49:56 2010 +++ /trunk/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java Wed Jul 28 13:10:14 2010
@@ -33,24 +33,6 @@
* "owns" the positioning of the widget. Any existing positioning attributes on
  * the widget may be modified by the panel.
  * </p>
- *
- * <h3>Use in UiBinder Templates</h3>
- * <p>
- * AbsolutePanel elements in {...@link com.google.gwt.uibinder.client.UiBinder
- * UiBinder} templates lay out their children with absolute position, using
- * &lt;g:position> elements. Each position should have <code>left</code> and
- * <code>top</code> attributes in pixels.
- *
- * <p>
- * For example:
- *
- * <pre>
- * &lt;g:AbsolutePanel>
- *   &lt;g:position left='10' top='20'>
- *     &lt;g:Label>Lorem ipsum...&lt;/g:Label>
- *   &lt;/g:position>
- * &lt;/g:AbsolutePanel>
- * </pre>
  */
 public class AbsolutePanel extends ComplexPanel implements InsertPanel {

@@ -197,7 +179,7 @@

   protected void setWidgetPositionImpl(Widget w, int left, int top) {
     Element h = w.getElement();
-    if (left == -1 && top == -1) {
+    if ((left == -1) && (top == -1)) {
       changeToStaticPositioning(h);
     } else {
       DOM.setStyleAttribute(h, "position", "absolute");
=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/LayoutPanel.java Wed Jul 28 11:49:56 2010 +++ /trunk/user/src/com/google/gwt/user/client/ui/LayoutPanel.java Wed Jul 28 13:10:14 2010
@@ -50,7 +50,7 @@
  *
  * <p>
* Precisely zero or two constraints are required for each axis (horizontal and - * vertical). Specifying no constraints implies that the child should fill that + * vertial). Specifying no constraints implies that the child should fill that
  * axis completely.
  *
  * <p>
=======================================
--- /trunk/user/test/com/google/gwt/uibinder/UiBinderJreSuite.java Wed Jul 28 11:49:56 2010 +++ /trunk/user/test/com/google/gwt/uibinder/UiBinderJreSuite.java Wed Jul 28 13:10:14 2010
@@ -25,7 +25,6 @@
 import com.google.gwt.uibinder.attributeparsers.StringAttributeParserTest;
import com.google.gwt.uibinder.attributeparsers.TextAlignConstantParserTest; import com.google.gwt.uibinder.attributeparsers.VerticalAlignmentConstantParserTest;
-import com.google.gwt.uibinder.elementparsers.AbsolutePanelParserTest;
 import com.google.gwt.uibinder.elementparsers.DialogBoxParserTest;
 import com.google.gwt.uibinder.elementparsers.DockLayoutPanelParserTest;
 import com.google.gwt.uibinder.elementparsers.GridParserTest;
@@ -82,7 +81,6 @@
     suite.addTestSuite(TextAlignConstantParserTest.class);

     // elementparsers
-    suite.addTestSuite(AbsolutePanelParserTest.class);
     suite.addTestSuite(DialogBoxParserTest.class);
     suite.addTestSuite(DockLayoutPanelParserTest.class);
     suite.addTestSuite(GridParserTest.class);
=======================================
--- /trunk/user/test/com/google/gwt/uibinder/rebind/DesignTimeUtilsTest.java Wed Jul 28 11:49:56 2010 +++ /trunk/user/test/com/google/gwt/uibinder/rebind/DesignTimeUtilsTest.java Wed Jul 28 13:10:14 2010
@@ -38,6 +38,11 @@
   private final DesignTimeUtils stub = DesignTimeUtilsStub.EMPTY;
   private final DesignTimeUtilsImpl impl = new DesignTimeUtilsImpl();

+ ////////////////////////////////////////////////////////////////////////////
+  //
+  // addDeclarations()
+  //
+ ///////////////////////////////////////////////////////////////////////////
   /**
    * Test for {...@link DesignTimeUtils#addDeclarations(IndentedWriter)}.
    */
@@ -71,6 +76,11 @@
     assertTrue(subString, content.contains(subString));
   }

+ ////////////////////////////////////////////////////////////////////////////
+  //
+  // getImplName()
+  //
+ ///////////////////////////////////////////////////////////////////////////
   /**
    * Test for {...@link DesignTimeUtils#getImplName(String)}.
    */
@@ -95,6 +105,11 @@
     assertTrue(Math.abs(delta) < 1000 * 3600);
   }

+ ////////////////////////////////////////////////////////////////////////////
+  //
+  // Path
+  //
+ ///////////////////////////////////////////////////////////////////////////
   /**
    * Test for {...@link DesignTimeUtils#getPath(Element)} and related methods.
    */
@@ -122,6 +137,11 @@
     assertEquals("0/1/0", impl.getPath(subSecond));
   }

+ ////////////////////////////////////////////////////////////////////////////
+  //
+  // getTemplateContent()
+  //
+ ///////////////////////////////////////////////////////////////////////////
   /**
    * Test for {...@link DesignTimeUtils#getTemplateContent(String)}.
    */
@@ -145,6 +165,11 @@
     }
   }

+ ////////////////////////////////////////////////////////////////////////////
+  //
+  // handleUIObject()
+  //
+ ///////////////////////////////////////////////////////////////////////////
   /**
    * Test for
* {...@link DesignTimeUtils#handleUIObject(IUiBinderWriterStatements, XMLElement, String)}
@@ -184,6 +209,11 @@
         statements.get(0));
   }

+ ////////////////////////////////////////////////////////////////////////////
+  //
+  // putAttribute(String)
+  //
+ ///////////////////////////////////////////////////////////////////////////
   /**
* Test for {...@link DesignTimeUtils#putAttribute(XMLElement, String, String)}
    * and {...@link DesignTimeUtils#writeAttributes(Statements)}.
@@ -227,6 +257,11 @@
     return statements;
   }

+ ////////////////////////////////////////////////////////////////////////////
+  //
+  // putAttribute(String[])
+  //
+ ///////////////////////////////////////////////////////////////////////////
   /**
* Test for {...@link DesignTimeUtils#putAttribute(XMLElement, String, String[])}
    * .
@@ -281,6 +316,12 @@
     }
     return statements;
   }
+
+ ////////////////////////////////////////////////////////////////////////////
+  //
+  // Utilities
+  //
+ ///////////////////////////////////////////////////////////////////////////

   /**
    * @return the only child {...@link Element} with given tag name.
@@ -299,6 +340,11 @@
     return new XMLElement(elem, null, null, null, null, designTime, null);
   }

+ ////////////////////////////////////////////////////////////////////////////
+  //
+  // WriterStatements
+  //
+ ///////////////////////////////////////////////////////////////////////////
   /**
* Implementation of {...@link IUiBinderWriterStatements} for simple statements.
    */
=======================================
--- /trunk/user/test/com/google/gwt/uibinder/test/UiJavaResources.java Wed Jul 28 11:49:56 2010 +++ /trunk/user/test/com/google/gwt/uibinder/test/UiJavaResources.java Wed Jul 28 13:10:14 2010
@@ -29,17 +29,6 @@
  */
 public class UiJavaResources {

- public static final MockJavaResource ABSOLUTE_PANEL = new MockJavaResource(
-      "com.google.gwt.user.client.ui.AbsolutePanel") {
-    @Override
-    protected CharSequence getContent() {
-      StringBuffer code = new StringBuffer();
-      code.append("package com.google.gwt.user.client.ui;\n");
-      code.append("public class AbsolutePanel extends Widget {\n");
-      code.append("}\n");
-      return code;
-    }
-  };
   public static final MockJavaResource BUTTON = new MockJavaResource(
       "com.google.gwt.user.client.ui.Button") {
     @Override
@@ -118,9 +107,9 @@
     }
   };
   public static final MockJavaResource GRID = new MockJavaResource(
-      "com.google.gwt.user.client.ui.Grid") {
-    @Override
-    protected CharSequence getContent() {
+    "com.google.gwt.user.client.ui.Grid") {
+  @Override
+  protected CharSequence getContent() {
       StringBuffer code = new StringBuffer();
       code.append("package com.google.gwt.user.client.ui;\n");
       code.append("public class Grid extends Widget {\n");
@@ -393,7 +382,6 @@
   public static Set<Resource> getUiResources() {
     Set<Resource> rtn = new HashSet<Resource>(
         Arrays.asList(JavaResourceBase.getStandardResources()));
-    rtn.add(ABSOLUTE_PANEL);
     rtn.add(BUTTON);
     rtn.add(CLICK_EVENT);
     rtn.add(CLICK_HANDLER);
=======================================
--- /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java Wed Jul 28 11:49:56 2010 +++ /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java Wed Jul 28 13:10:14 2010
@@ -22,11 +22,10 @@
 import com.google.gwt.dom.client.SpanElement;
 import com.google.gwt.junit.client.GWTTestCase;
 import com.google.gwt.resources.client.ClientBundle;
-import com.google.gwt.resources.client.CssResource.NotStrict;
 import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.resources.client.CssResource.NotStrict;
 import com.google.gwt.uibinder.test.client.EnumeratedLabel.Suffix;
 import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.DisclosurePanel;
 import com.google.gwt.user.client.ui.HTML;
@@ -66,12 +65,12 @@
     assertEquals("th", domUi.th1.getTagName().toLowerCase());
     assertEquals("th", domUi.th2.getTagName().toLowerCase());
   }
-
+
   public void testTableWithExplicitTbody() {
     assertEquals("tbody", domUi.tbody.getTagName().toLowerCase());
     assertEquals("th", domUi.th4.getTagName().toLowerCase());
   }
-
+
   public void testAutoboxingFieldRef() {
     FakeBundle fakeBundle = new FakeBundle();

@@ -85,8 +84,7 @@

     assertEquals(new Integer((int) fakeBundle.aDouble()),
         widgetUi.mismatchPrimitiveIntoObject.getObjectInteger());
-    assertEquals((int) fakeBundle.aDouble(),
-        widgetUi.allMismatchPrimitive.getRawInt());
+ assertEquals((int) fakeBundle.aDouble(), widgetUi.allMismatchPrimitive.getRawInt());

     assertEquals(new Boolean(fakeBundle.aBoolean()),
         widgetUi.primitiveBooleanIntoObject.getObjectBoolean());
@@ -94,28 +92,26 @@
         widgetUi.objectBooleanIntoPrimitive.getRawBoolean());
     assertEquals(fakeBundle.aBooleanObject(),
         widgetUi.allObjectBoolean.getObjectBoolean());
-    assertEquals(fakeBundle.aBoolean(),
-        widgetUi.allPrimitiveBoolean.getRawBoolean());
+ assertEquals(fakeBundle.aBoolean(), widgetUi.allPrimitiveBoolean.getRawBoolean());
   }

   public void testAccessToNonStandardElement() {
     Element elm = widgetUi.nonStandardElement;
     assertEquals("I", elm.getTagName());
   }
-
+
   public void testAddStyleNamesAndDebugId() {
     Label l = widgetUi.lblDebugId;
     assertEquals("gwt-debug-joe", l.getElement().getId());

     assertEquals("styleName", l.getStylePrimaryName());
-
+
WidgetBasedUiExternalResources resources = GWT.create(WidgetBasedUiExternalResources.class);
     assertTrue(l.getStyleName().contains("newStyle"));
     assertTrue(l.getStyleName().contains("anotherStyle"));
     assertTrue(l.getStyleName().contains("styleName-dependentStyle"));
assertTrue(l.getStyleName().contains("styleName-anotherDependentStyle"));
-    assertTrue(l.getStyleName().contains(
-        "styleName-" + resources.style().prettyText()));
+ assertTrue(l.getStyleName().contains("styleName-" + resources.style().prettyText()));
   }

   // TODO(rjrjr) The direction stuff in these tests really belongs in
@@ -135,8 +131,7 @@
     assertEquals(getCenter(), widgetUi.bundledLabel.getParent());
assertEquals(new FakeBundle().helloText(), widgetUi.bundledLabel.getText()); WidgetBasedUiExternalResources resources = GWT.create(WidgetBasedUiExternalResources.class);
-    assertEquals(resources.style().prettyText(),
-        widgetUi.bundledLabel.getStyleName());
+ assertEquals(resources.style().prettyText(), widgetUi.bundledLabel.getStyleName());

     Element pretty = DOM.getElementById("prettyPara");
     assertEquals(resources.style().prettyText(), pretty.getClassName());
@@ -146,7 +141,7 @@
     foo.setPojo(pojo);
     assertEquals(foo.getText(), widgetUi.theFoo.getText());
   }
-
+
   public void testBundleLegacyBeansText() {
     assertEquals(widgetUi.legacyValuesForBeans.helloText(),
         widgetUi.bundledLabelLegacy.getText());
@@ -167,8 +162,7 @@
     // TODO(rjrjr) More of a test of HTMLPanelParser

     Widget center = getCenter();
-    assertEquals(com.google.gwt.user.client.ui.DockPanel.CENTER,
-        root.getWidgetDirection(center));
+ assertEquals(com.google.gwt.user.client.ui.DockPanel.CENTER, root.getWidgetDirection(center));
     assertEquals(HTMLPanel.class, center.getClass());
     String html = center.getElement().getInnerHTML();
     assertTrue(html.contains("main area"));
@@ -188,11 +182,11 @@
WidgetBasedUiExternalResources resources = GWT.create(WidgetBasedUiExternalResources.class); assertEquals(resources.style().tmText(), widgetUi.tmElement.getClassName());
   }
-
+
   public void testCustomButtonBody() {
     assertEquals("Hi mom", widgetUi.toggle.getText());
   }
-
+
   public void testCustomDialogBox() {
     assertEquals("Custom dialog am I", widgetUi.fooDialog.getText());
     Widget body = widgetUi.fooDialog.iterator().next();
@@ -241,18 +235,16 @@
assertEquals("They might show up in body text that has been marked for "
         + "translation: funny characters \\ \" \" ' ' & < > > { }", t);
   }
-
+
   public void testEmptyAttributesOkay() {
     assertEquals("", widgetUi.styleLess.getStyleName());
   }

   public void testMixOfWidgetsAndElementsInUiMsg() {
-    assertEquals("single translatable message",
-        widgetUi.mixedMessageWidget.getText());
-    assertEquals("exciting and subtle",
-        widgetUi.mixedMessageSpan.getInnerText());
-  }
-
+ assertEquals("single translatable message", widgetUi.mixedMessageWidget.getText()); + assertEquals("exciting and subtle", widgetUi.mixedMessageSpan.getInnerText());
+  }
+
   public void testEnums() {
     Suffix expected = EnumeratedLabel.Suffix.tail;
     assertTrue("Should end with suffix \"" + expected + "\"",
@@ -269,7 +261,7 @@
         widgetUi.pushButton.getUpHoveringFace().getHTML().toLowerCase());
     // Can't test the images at all :-P
   }
-
+
   public void testProtectedDomTextMessageWithFunnyChars() {
     String t = widgetUi.funnyCharsProtectedMessageParagraph.getInnerText();
     assertEquals("Don't forget about protected untranslatable blocks: "
@@ -301,14 +293,14 @@
   public void testFieldInPlaceholderedElement() {
     assertEquals("named portions", widgetUi.spanInMsg.getInnerText());
   }
-
+
   public void testGrid() {
     assertTrue(widgetUi.fooGrid.getWidget(0, 0) instanceof Label);
     assertTrue(widgetUi.fooGrid.getWidget(0, 1) instanceof Button);
     assertEquals(2, widgetUi.fooGrid.getColumnCount());
     assertEquals(1, widgetUi.fooGrid.getRowCount());
   }
-
+
   public void testListBox() {
     assertEquals(2, widgetUi.fooListBox.getItemCount());
     assertEquals("bar", widgetUi.fooListBox.getItemText(0));
@@ -377,8 +369,7 @@
   @SuppressWarnings("deprecation")
   public void testNorth() {
     Widget north = root.getWidget(0);
-    assertEquals(com.google.gwt.user.client.ui.DockPanel.NORTH,
-        root.getWidgetDirection(north));
+ assertEquals(com.google.gwt.user.client.ui.DockPanel.NORTH, root.getWidgetDirection(north));
     assertEquals(HTML.class, north.getClass());
     assertTrue(((HTML) north).getHTML().contains("Title area"));
   }
@@ -430,20 +421,6 @@
     assertNotNull("Widget exists", w);
     assertEquals("Panel contains widget", w, p.getContent());
   }
-
-  public void testAbsolutePanel() {
-    AbsolutePanel p = widgetUi.myAbsolutePanel;
-    assertNotNull("Panel exists", p);
-
-    Widget w = widgetUi.myAbsolutePanelItem;
-    assertNotNull("Widget exists", w);
-
- assertEquals("Panel contains exactly one widgets", 1, p.getWidgetCount());
-    assertEquals("Panel contains expected widget", w, p.getWidget(0));
-
-    assertEquals("Widget has left", 1, p.getWidgetLeft(w));
-    assertEquals("Widget has top", 2, p.getWidgetTop(w));
-  }

   public void testStringAttributeIgnoresStaticSetter() {
     // Assumes setPopupText() is overloaded such that there is a static
@@ -460,8 +437,7 @@
   @SuppressWarnings("deprecation")
   public void testWest() {
     Widget west = root.getWidget(1);
-    assertEquals(com.google.gwt.user.client.ui.DockPanel.WEST,
-        root.getWidgetDirection(west));
+ assertEquals(com.google.gwt.user.client.ui.DockPanel.WEST, root.getWidgetDirection(west));
     assertEquals(HTML.class, west.getClass());
     String html = ((HTML) west).getHTML();
     assertTrue(html.contains("side bar"));
@@ -487,7 +463,7 @@
     assertEquals(resource.getTop(), widget.getOriginTop());
     assertEquals(resource.getLeft(), widget.getOriginLeft());
   }
-
+
   public void testImageResourceInImageWidget() {
     ImageResource resource = widgetUi.prettyImage;
     Image widget = widgetUi.babyWidget;
@@ -495,7 +471,7 @@
     assertEquals(resource.getHeight(), widget.getOffsetHeight());
     assertEquals(resource.getTop(), widget.getOriginTop());
     assertEquals(resource.getLeft(), widget.getOriginLeft());
-
+
     assertEquals("expected alt text", widget.getAltText());
     assertEquals("expected style name", widget.getStyleName());
   }
@@ -504,7 +480,7 @@
     assertEquals(100, widgetUi.sideBarWidget.getOffsetWidth());
     assertEquals(150, widgetUi.sideBarWidget.getOffsetHeight());
   }
-
+
   public void testDataResource() {
     assertNotNull(widgetUi.heartCursorResource.getUrl());
   }
=======================================
--- /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.java Wed Jul 28 11:49:56 2010 +++ /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.java Wed Jul 28 13:10:14 2010
@@ -30,7 +30,6 @@
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiFactory;
 import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.DisclosurePanel;
@@ -163,8 +162,6 @@
   @UiField FooDialog fooDialog;
   @UiField ListBox fooListBox;
   @UiField Grid fooGrid;
-  @UiField AbsolutePanel myAbsolutePanel;
-  @UiField Widget myAbsolutePanelItem;

   public WidgetBasedUi() {
     external.style().ensureInjected();
=======================================
--- /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml Wed Jul 28 11:49:56 2010 +++ /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml Wed Jul 28 13:10:14 2010
@@ -614,12 +614,6 @@
     </gwt:row>
   </gwt:Grid>

-  <gwt:AbsolutePanel ui:field='myAbsolutePanel'>
-    <gwt:child left='1' top='2'>
- <gwt:Button ui:field='myAbsolutePanelItem'>AbsolutePanel item</gwt:Button>
-    </gwt:child>
-  </gwt:AbsolutePanel>
-
    </gwt:HTMLPanel>
   </gwt:Dock>
 </gwt:DockPanel>

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

Reply via email to