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

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


  //
  // setLocation()
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_setLocation_addIntInt() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button, 10, 20);",
            "    }",
            "  }",
            "}");
    refresh();
    WidgetInfo button = getJavaInfoByName("button");
    // set new location
    frame.command_BOUNDS(button, new Point(1, 2), null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here


  /**
   * Case when <code>add()</code> without location is used and no <code>setWidgetPosition()</code>.
   * Invocation of <code>add()</code> should be updated to use location.
   */
  public void test_setLocation_add() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(button)/}",
        "  {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /rootPanel.add(button)/}");
    refresh();
    WidgetInfo button = getJavaInfoByName("button");
    // set new location
    frame.command_BOUNDS(button, new Point(1, 2), null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_setLocation_setWidgetPosition() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "      rootPanel.setWidgetPosition(button, 10, 20);",
            "    }",
            "  }",
            "}");
    refresh();
    WidgetInfo button = getJavaInfoByName("button");
    // set new location
    frame.command_BOUNDS(button, new Point(1, 2), null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

            "    <parameter name='GWT.AbsolutePanel: force setWidgetPosition'>true</parameter>",
            "  </parameters>",
            "</component>"));
    waitForAutoBuild();
    // parse
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      MyButton button = new MyButton();",
            "      rootPanel.add(button);",
            "    }",
            "  }",
            "}");
    refresh();
    WidgetInfo button = getJavaInfoByName("button");
    // set new location
    frame.command_BOUNDS(button, new Point(1, 2), null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

  /**
   * We update all places with location.
   */
  public void test_setLocation_addPlusSet() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button, 10, 20);",
            "      rootPanel.setWidgetPosition(button, 10, 20);",
            "      rootPanel.setWidgetPosition(button, 30, 40);",
            "    }",
            "  }",
            "}");
    refresh();
    WidgetInfo button = getJavaInfoByName("button");
    // set new location
    frame.command_BOUNDS(button, new Point(1, 2), null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * <code>UIObject.setSize(String,String)</code> is used.
   */
  public void test_setSize() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "      button.setSize('10px', '20px');",
            "    }",
            "  }",
            "}");
    refresh();
    WidgetInfo button = getJavaInfoByName("button");
    // set new size
    frame.command_BOUNDS(button, null, new Dimension(100, 50));
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for {@link AbsolutePanelInfo#command_CREATE(WidgetInfo)}.
   */
  public void test_CREATE() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "  }",
            "}");
    refresh();
    // do CREATE
    WidgetInfo button = createButton();
    frame.command_CREATE2(button, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

  /**
   * Test for {@link AbsolutePanelInfo#command_MOVE2(WidgetInfo, WidgetInfo)}.
   */
  public void test_MOVE() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      Button button_1 = new Button();",
            "      rootPanel.add(button_1, 10, 20);",
            "    }",
            "    {",
            "      Button button_2 = new Button();",
            "      rootPanel.add(button_2, 10, 200);",
            "    }",
            "  }",
            "}");
    refresh();
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    // do ADD
    frame.command_MOVE2(button_2, button_1);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

  /**
   * There was problem that sequence: reparent, move does not moves add() association.
   */
  public void test_ADD_associationProblem() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      AbsolutePanel panel = new AbsolutePanel();",
            "      rootPanel.add(panel);",
            "      {",
            "        Button button = new Button();",
            "        panel.add(button);",
            "      }",
            "    }",
            "  }",
            "}");
    refresh();
    WidgetInfo button = getJavaInfoByName("button");
    AbsolutePanelInfo panel = getJavaInfoByName("panel");
    // do ADD
    frame.command_MOVE2(button, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
        "      AbsolutePanel panel = new AbsolutePanel();",
        "      rootPanel.add(panel);",
        "    }",
        "    {",
        "      Button button = new Button();",
        "      rootPanel.add(button);",
        "    }",
        "  }",
        "}");
    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(panel)/ /rootPanel.add(button)/}",
        "  {new: com.google.gwt.user.client.ui.AbsolutePanel} {local-unique: panel} {/new AbsolutePanel()/ /rootPanel.add(panel)/}",
        "  {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /rootPanel.add(button)/}");
    // set location
    frame.command_BOUNDS(button, new Point(50, 100), null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
        "      AbsolutePanel panel = new AbsolutePanel();",
        "      rootPanel.add(panel);",
        "    }",
        "    {",
        "      Button button = new Button();",
        "      rootPanel.add(button, 50, 100);",
        "    }",
        "  }",
        "}");
    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(panel)/ /rootPanel.add(button, 50, 100)/}",
        "  {new: com.google.gwt.user.client.ui.AbsolutePanel} {local-unique: panel} {/new AbsolutePanel()/ /rootPanel.add(panel)/}",
        "  {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /rootPanel.add(button, 50, 100)/}");
    // move "button" before "panel"
    frame.command_MOVE2(button, panel);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

  /**
   * Test for copy/paste {@link AbsolutePanelInfo} with its children.
   */
  public void test_clipboard() throws Exception {
    final RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo

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.