Examples of RootPanelInfo


Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

  /**
   * Test parse on RootPanel.
   */
  public void test_parse_onRootPanel() throws Exception {
    dontUseSharedGWTState();
    RootPanelInfo rootPanel =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    Canvas canvas = new Canvas();",
            "    rootPanel.add(canvas, 10, 10);",
            "    canvas.setSize('250px', '200px');",
            "  }",
            "}");
    rootPanel.refresh();
    CanvasInfo canvas = rootPanel.getChildren(CanvasInfo.class).get(0);
    assertThat(canvas.getBounds()).isEqualTo(new Rectangle(10, 10, 250, 200));
  }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

            "    </method>",
            "  </methods>",
            "</component>"));
    waitForAutoBuild();
    // parse
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    MyPanel myPanel = new MyPanel();",
            "    rootPanel.add(myPanel);",
            "    //",
            "    Button button = new Button();",
            "    myPanel.addWidget(button);",
            "  }",
            "}");
    frame.refresh();
    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(myPanel)/}",
        "  {new: test.client.MyPanel} {local-unique: myPanel} {/new MyPanel()/ /rootPanel.add(myPanel)/ /myPanel.addWidget(button)/}",
        "    {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /myPanel.addWidget(button)/}");
  }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

            "    </method>",
            "  </methods>",
            "</component>"));
    waitForAutoBuild();
    // parse
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    MyPanel myPanel = new MyPanel();",
            "    rootPanel.add(myPanel);",
            "    //",
            "    Button button = new Button();",
            "    myPanel.addWidget(button);",
            "  }",
            "}");
    frame.refresh();
    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(myPanel)/}",
        "  {new: test.client.MyPanel} {local-unique: myPanel} {/new MyPanel()/ /rootPanel.add(myPanel)/ /myPanel.addWidget(button)/}",
        "    {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /myPanel.addWidget(button)/}");
  }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

            "    return m_button;",
            "  }",
            "}"));
    waitForAutoBuild();
    // parse
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    MyPanel myPanel = new MyPanel();",
            "    rootPanel.add(myPanel);",
            "  }",
            "}");
    frame.refresh();
    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(myPanel)/}",
        "  {new: test.client.MyPanel} {local-unique: myPanel} {/new MyPanel()/ /rootPanel.add(myPanel)/}",
        "    {method: public com.google.gwt.user.client.ui.FlowPanel test.client.MyPanel.getContainer()} {property} {}",
        "      {method: public com.google.gwt.user.client.ui.Button test.client.MyPanel.getButton()} {property} {}");
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

            "    return m_button;",
            "  }",
            "}"));
    waitForAutoBuild();
    // parse
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    MyPanel myPanel = new MyPanel();",
            "    rootPanel.add(myPanel);",
            "  }",
            "}");
    frame.refresh();
    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(myPanel)/}",
        "  {new: test.client.MyPanel} {local-unique: myPanel} {/new MyPanel()/ /rootPanel.add(myPanel)/}",
        "    {method: public com.google.gwt.user.client.ui.FlowPanel test.client.MyPanel.getContainer()} {property} {}",
        "      {method: public com.google.gwt.user.client.ui.Button test.client.MyPanel.getButton()} {property} {}");
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_items() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      ListBox listBox = new ListBox();",
            "      rootPanel.add(listBox);",
            "      listBox.setVisibleItemCount(5);",
            "      listBox.addItem('text_0');",
            "      listBox.addItem('text_1', 'value_1');",
            "      listBox.insertItem('text_2', 2);",
            "      listBox.insertItem('text_3', 'value_3', 3);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    WidgetInfo listBox = frame.getChildrenWidgets().get(0);
    Object listBoxObject = listBox.getObject();
    // check
    assertEquals(4, ReflectionUtils.invokeMethod(listBoxObject, "getItemCount()"));
    // item: 0
    assertEquals("text_0", ReflectionUtils.invokeMethod(listBoxObject, "getItemText(int)", 0));
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

    assertEquals("text_3", ReflectionUtils.invokeMethod(listBoxObject, "getItemText(int)", 3));
    assertEquals("value_3", ReflectionUtils.invokeMethod(listBoxObject, "getValue(int)", 3));
  }

  public void test_itemsProperty() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      ListBox listBox = new ListBox();",
            "      rootPanel.add(listBox);",
            "      listBox.setVisibleItemCount(5);",
            "      listBox.addItem('text_0');",
            "      listBox.addItem('text_1');",
            "    }",
            "  }",
            "}");
    frame.refresh();
    WidgetInfo listBox = frame.getChildrenWidgets().get(0);
    // prepare "items" property
    Property itemsProperty = listBox.getPropertyByTitle("items");
    assertNotNull(itemsProperty);
    // initial state
    {
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

      assertTrue(ArrayUtils.isEquals(new String[]{"text_0", "text_1"}, itemsProperty.getValue()));
    }
  }

  public void test_setSelectedIndex() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      ListBox listBox = new ListBox();",
            "      rootPanel.add(listBox);",
            "      listBox.setVisibleItemCount(5);",
            "      listBox.addItem('item_0');",
            "      listBox.addItem('item_1');",
            "    }",
            "  }",
            "}");
    frame.refresh();
    WidgetInfo listBox = frame.getChildrenWidgets().get(0);
    listBox.getPropertyByTitle("selectedIndex").setValue(1);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

  //
  // CREATE
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_CREATE_asList() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "  }",
            "}");
    frame.refresh();
    // do create
    WidgetInfo listBox = createJavaInfo("com.google.gwt.user.client.ui.ListBox");
    frame.command_CREATE2(listBox, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

        "  }",
        "}");
  }

  public void test_CREATE_asCombo() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "  }",
            "}");
    frame.refresh();
    // do create
    WidgetInfo comboBox = createJavaInfo("com.google.gwt.user.client.ui.ListBox", "combo");
    frame.command_CREATE2(comboBox, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.