Example #1
0
 /** Even empty <code>Tree</code> should have two items. */
 public void test_empty_this() throws Exception {
   TreeInfo tree =
       parse(
           "// filler filler filler filler filler",
           "<ui:UiBinder>",
           "  <g:Tree/>",
           "</ui:UiBinder>");
   refresh();
   // bounds
   assertEquals(new Rectangle(0, 0, 450, 300), tree.getBounds());
   // has items
   assertEquals(2, ScriptUtils.evaluate("getItemCount()", tree.getObject()));
 }
 /** Even empty <code>DockLayoutPanel</code> should have one <code>Widget</code>. */
 public void test_empty() throws Exception {
   parse(
       "// filler filler filler filler filler",
       "<ui:UiBinder>",
       "  <g:FlowPanel>",
       "    <g:DockLayoutPanel wbp:name='panel' width='150' height='100'/>",
       "  </g:FlowPanel>",
       "</ui:UiBinder>");
   assertHierarchy(
       "// filler filler filler filler filler",
       "// filler filler filler filler filler",
       "<g:FlowPanel>",
       "  <g:DockLayoutPanel wbp:name='panel' width='150' height='100'>");
   refresh();
   DockLayoutPanelInfo panel = getObjectByName("panel");
   // bounds
   assertEquals(new Rectangle(0, 0, 150, 100), panel.getBounds());
   // has widget
   assertEquals(1, ScriptUtils.evaluate("getWidgetCount()", panel.getObject()));
 }
Example #3
0
 /** Even empty <code>Tree</code> should have two items. */
 public void test_empty() throws Exception {
   parse(
       "// filler filler filler filler filler",
       "<ui:UiBinder>",
       "  <g:FlowPanel>",
       "    <g:Tree wbp:name='tree'/>",
       "  </g:FlowPanel>",
       "</ui:UiBinder>");
   refresh();
   TreeInfo tree = getObjectByName("tree");
   // bounds
   {
     Rectangle bounds = tree.getBounds();
     assertThat(bounds.x).isEqualTo(0);
     assertThat(bounds.y).isEqualTo(0);
     assertThat(bounds.width).isEqualTo(450);
     assertThat(bounds.height).isGreaterThan(50);
   }
   // has items
   assertEquals(2, ScriptUtils.evaluate("getItemCount()", tree.getObject()));
 }