Package com.google.gdt.eclipse.designer.model.widgets

Examples of com.google.gdt.eclipse.designer.model.widgets.CompositeInfo


      assertEquals(new Rectangle(0, 0, 500, 250), composite.getBounds());
    }
  }

  public void test_withVerticalPanel() throws Exception {
    CompositeInfo composite =
        parseJavaInfo(
            "public class Test extends Composite {",
            "  public Test() {",
            "    initWidget(new VerticalPanel());",
            "  }",
            "}");
    composite.refresh();
    assertNoErrors(composite);
    assertHierarchy(
        "{this: com.google.gwt.user.client.ui.Composite} {this} {/initWidget(new VerticalPanel())/}",
        "  {new: com.google.gwt.user.client.ui.VerticalPanel} {empty} {/initWidget(new VerticalPanel())/}");
  }
View Full Code Here


            "    initWidget(new Button());",
            "  }",
            "}"));
    waitForAutoBuild();
    // parse
    CompositeInfo composite =
        parseJavaInfo(
            "// filler filler filler",
            "public class Test extends MyComposite {",
            "  public Test() {",
            "  }",
            "}");
    assertHierarchy("{this: test.client.MyComposite} {this} {}");
    // do refresh()
    composite.refresh();
    assertFalse(composite.isEmpty());
    assertNull(composite.getWidget());
  }
View Full Code Here

    assertFalse(composite.isEmpty());
    assertNull(composite.getWidget());
  }

  public void test_empty() throws Exception {
    CompositeInfo composite =
        parseJavaInfo(
            "// filler filler filler",
            "public class Test extends Composite {",
            "  public Test() {",
            "  }",
            "}");
    assertHierarchy("{this: com.google.gwt.user.client.ui.Composite} {this} {}");
    // do refresh()
    composite.refresh();
    assertTrue(composite.isEmpty());
    assertNull(composite.getWidget());
    // no properties
    assertThat(composite.getProperties()).isEmpty();
  }
View Full Code Here

        "      rootPanel.add(composite);",
        "    }",
        "  }",
        "}");
    refresh();
    CompositeInfo composite = getJavaInfoByName("composite");
    // "MyComposite" does not set Widget, but we should do this (in reality parse with fail otherwise)
    assertTrue(composite.isEmpty());
    {
      Object widget = ReflectionUtils.invokeMethod(composite.getObject(), "getWidget()");
      assertNotNull(widget);
    }
  }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * If Composite has no Widget, we should not show properties.
   */
  public void test_getProperties_noWidget() throws Exception {
    CompositeInfo composite =
        parseJavaInfo(
            "// filler filler filler",
            "public class Test extends Composite {",
            "  public Test() {",
            "  }",
            "}");
    composite.refresh();
    assertThat(composite.getProperties()).isEmpty();
  }
View Full Code Here

  /**
   * If Composite has Widget, we show properties.
   */
  public void test_getProperties_hasWidget() throws Exception {
    CompositeInfo composite =
        parseJavaInfo(
            "public class Test extends Composite {",
            "  public Test() {",
            "    {",
            "      Button button = new Button();",
            "      initWidget(button);",
            "    }",
            "  }",
            "}");
    composite.refresh();
    // prepare properties
    Property[] properties = composite.getProperties();
    assertThat(properties).isNotEmpty();
    // usual properties
    {
      String[] titles = PropertyUtils.getTitles(properties);
      assertThat(titles).contains("Class");
View Full Code Here

  /**
   * New method invocations should be added at the end of constructor.
   */
  public void test_this_setProperty() throws Exception {
    CompositeInfo composite =
        parseJavaInfo(
            "public class Test extends Composite {",
            "  public Test() {",
            "    {",
            "      Button button = new Button();",
            "      initWidget(button);",
            "    }",
            "  }",
            "}");
    composite.refresh();
    // add setWidth()
    composite.addMethodInvocation(
        "setWidth(java.lang.String)",
        StringConverter.INSTANCE.toJavaSource(null, "150px"));
    assertEditor(
        "public class Test extends Composite {",
        "  public Test() {",
        "    {",
        "      Button button = new Button();",
        "      initWidget(button);",
        "    }",
        "    setWidth('150px');",
        "  }",
        "}");
    // refresh
    composite.refresh();
    assertNoErrors(composite);
  }
View Full Code Here

            "    }",
            "    rootPanel.setTitle('RootPanel');",
            "  }",
            "}");
    frame.refresh();
    CompositeInfo composite = (CompositeInfo) frame.getChildrenWidgets().get(0);
    // add setWidth()
    composite.addMethodInvocation(
        "setWidth(java.lang.String)",
        StringConverter.INSTANCE.toJavaSource(null, "150px"));
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
View Full Code Here

            "      rootPanel.add(composite);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    CompositeInfo composite = (CompositeInfo) frame.getChildrenWidgets().get(0);
    //
    assertTrue(composite.shouldDrawDotsBorder());
  }
View Full Code Here

            "      rootPanel.add(composite);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    CompositeInfo composite = (CompositeInfo) frame.getChildrenWidgets().get(0);
    //
    assertFalse(composite.shouldDrawDotsBorder());
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.CompositeInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.