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

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


  //
  // Parse empty
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parseEmpty_ClassInstanceCreation() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    StackLayoutPanel panel = new StackLayoutPanel(Unit.PX);",
            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    StackLayoutPanelInfo panel = getJavaInfoByName("panel");
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    // Unit property
View Full Code Here


        "  {new: com.google.gwt.user.client.ui.Button empty} {local-unique: button} {/new Button()/ /add(button, new HTML('New Widget'), 2.0)/}",
        "    {new: com.google.gwt.user.client.ui.HTML} {empty} {/add(button, new HTML('New Widget'), 2.0)/}");
  }

  public void test_CREATE_local() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    StackLayoutPanel panel = new StackLayoutPanel(Unit.EM);",
            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    StackLayoutPanelInfo panel = getJavaInfoByName("panel");
    //
    WidgetInfo newButton = createButton();
    panel.command_CREATE2(newButton, null);
    assertEditor(
View Full Code Here

        "    {new: com.google.gwt.user.client.ui.Button empty} {local-unique: button} {/new Button()/ /panel.add(button, new HTML('New Widget'), 2.0)/}",
        "      {new: com.google.gwt.user.client.ui.HTML} {empty} {/panel.add(button, new HTML('New Widget'), 2.0)/}");
  }

  public void test_ADD_local() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      StackLayoutPanel panel = new StackLayoutPanel(Unit.EM);",
            "      rootPanel.add(panel);",
            "    }",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    StackLayoutPanelInfo panel = getJavaInfoByName("panel");
    //
    WidgetInfo button = getJavaInfoByName("button");
    panel.command_MOVE2(button, null);
    assertEditor(
View Full Code Here

  /**
   * Copy/paste of {@link StackLayoutPanelInfo} with {@link WidgetInfo}s.
   */
  public void test_clipboard_Panel() throws Exception {
    final RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      StackLayoutPanel panel = new StackLayoutPanel(Unit.EM);",
            "      {",
            "        Button buttonA = new Button('A');",
            "        panel.add(buttonA, new HTML('Header A'), 1.0);",
            "      }",
            "      {",
            "        Button buttonB = new Button('B');",
            "        panel.add(buttonB, new HTML('Header B'), 3.5);",
            "      }",
            "      rootPanel.add(panel);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    {
      StackLayoutPanelInfo panel = getJavaInfoByName("panel");
      doCopyPaste(panel, new PasteProcedure<WidgetInfo>() {
        public void run(WidgetInfo copy) throws Exception {
          frame.command_CREATE2(copy, null);
        }
      });
    }
    assertEditor(
        "public class Test implements EntryPoint {",
View Full Code Here

  //
  // Parse empty
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parseEmpty_ClassInstanceCreation() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    TabLayoutPanel panel = new TabLayoutPanel(1.5, Unit.EM);",
            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    TabLayoutPanelInfo panel = getJavaInfoByName("panel");
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
  }
View Full Code Here

        "{this: com.google.gwt.user.client.ui.TabLayoutPanel} {this} {/add(button, 'New Widget', false)/}",
        "  {new: com.google.gwt.user.client.ui.Button empty} {local-unique: button} {/new Button()/ /add(button, 'New Widget', false)/}");
  }

  public void test_CREATE_local() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    TabLayoutPanel panel = new TabLayoutPanel(1.5, Unit.EM);",
            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    TabLayoutPanelInfo panel = getJavaInfoByName("panel");
    //
    WidgetInfo newButton = createButton();
    panel.command_CREATE2(newButton, null);
    assertEditor(
View Full Code Here

        "  {new: com.google.gwt.user.client.ui.TabLayoutPanel} {local-unique: panel} {/new TabLayoutPanel(1.5, Unit.EM)/ /rootPanel.add(panel)/ /panel.add(button, 'New Widget', false)/}",
        "    {new: com.google.gwt.user.client.ui.Button empty} {local-unique: button} {/new Button()/ /panel.add(button, 'New Widget', false)/}");
  }

  public void test_ADD_local() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      TabLayoutPanel panel = new TabLayoutPanel(1.5, Unit.EM);",
            "      rootPanel.add(panel);",
            "    }",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    TabLayoutPanelInfo panel = getJavaInfoByName("panel");
    //
    WidgetInfo button = getJavaInfoByName("button");
    panel.command_MOVE2(button, null);
    assertEditor(
View Full Code Here

  /**
   * Copy/paste of {@link TabLayoutPanelInfo} with {@link WidgetInfo}s.
   */
  public void test_clipboard_Panel() throws Exception {
    final RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      TabLayoutPanel panel = new TabLayoutPanel(2.4, Unit.EM);",
            "      {",
            "        Button buttonA = new Button('A');",
            "        panel.add(buttonA, 'Header A', false);",
            "      }",
            "      {",
            "        Button buttonB = new Button('B');",
            "        panel.add(buttonB, 'Header B', false);",
            "      }",
            "      rootPanel.add(panel);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    {
      TabLayoutPanelInfo panel = getJavaInfoByName("panel");
      doCopyPaste(panel, new PasteProcedure<WidgetInfo>() {
        public void run(WidgetInfo copy) throws Exception {
          frame.command_CREATE2(copy, null);
        }
      });
    }
    assertEditor(
        "public class Test implements EntryPoint {",
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_empty() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "  }",
            "}");
    assertHierarchy("{RootLayoutPanel.get()} {local-unique: rootPanel} {/RootLayoutPanel.get()/}");
    frame.refresh();
    // RootLayoutPanel_CreationSupport
    {
      RootLayoutPanelCreationSupport creationSupport =
          (RootLayoutPanelCreationSupport) frame.getCreationSupport();
      assertEquals("RootLayoutPanel.get()", m_lastEditor.getSource(creationSupport.getNode()));
      assertFalse(creationSupport.canDelete());
      assertFalse(creationSupport.canReorder());
      assertFalse(creationSupport.canReparent());
    }
    // default bounds
    assertEquals(new Rectangle(0, 0, 450, 300), frame.getBounds());
    // set new size
    {
      TopBoundsSupport topBoundsSupport = frame.getTopBoundsSupport();
      topBoundsSupport.setSize(500, 400);
      frame.refresh();
      assertEquals(new Rectangle(0, 0, 500, 400), frame.getBounds());
    }
  }
View Full Code Here

      assertEquals(new Rectangle(0, 0, 500, 400), frame.getBounds());
    }
  }

  public void test_withButton() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "      rootPanel.setWidgetLeftRight(button, 10, Unit.PX, 20, Unit.PX);",
            "      rootPanel.setWidgetTopBottom(button, 30, Unit.PX, 40, Unit.PX);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{RootLayoutPanel.get()} {local-unique: rootPanel} {/RootLayoutPanel.get()/ /rootPanel.add(button)/ /rootPanel.setWidgetLeftRight(button, 10, Unit.PX, 20, Unit.PX)/ /rootPanel.setWidgetTopBottom(button, 30, Unit.PX, 40, Unit.PX)/}",
        "  {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /rootPanel.add(button)/ /rootPanel.setWidgetLeftRight(button, 10, Unit.PX, 20, Unit.PX)/ /rootPanel.setWidgetTopBottom(button, 30, Unit.PX, 40, Unit.PX)/}");
    frame.refresh();
    // bounds
    WidgetInfo button = getJavaInfoByName("button");
    {
      Rectangle expected = new Rectangle(10, 30, 450 - 10 - 20, 300 - 30 - 40);
      assertEquals(expected, button.getBounds());
View Full Code Here

TOP

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

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.