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

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.TabLayoutPanelInfo$WidgetHandle


            "    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


    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
  }

  public void test_parseEmpty_this() throws Exception {
    TabLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends TabLayoutPanel {",
            "  public Test() {",
            "    super(1.5, Unit.EM);",
            "  }",
            "}");
    panel.refresh();
    assertNoErrors(panel);
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
  }
View Full Code Here

   * Test for {@link TabLayoutPanelInfo#getWidgetHandles()}.
   * <p>
   * No widgets, no {@link WidgetHandle}'s.
   */
  public void test_WidgetHandle_empty() throws Exception {
    TabLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends TabLayoutPanel {",
            "  public Test() {",
            "    super(1.5, Unit.EM);",
            "  }",
            "}");
    panel.refresh();
    assertTrue(panel.getWidgetHandles().isEmpty());
  }
View Full Code Here

   * Test for {@link TabLayoutPanelInfo#getWidgetHandles()}.
   * <p>
   * {@link WidgetHandle}'s should have some good bounds.
   */
  public void test_WidgetHandle_getBounds() throws Exception {
    TabLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends TabLayoutPanel {",
            "  public Test() {",
            "    super(1.5, Unit.EM);",
            "    {",
            "      Button button_1 = new Button();",
            "      add(button_1, 'ABC', false);",
            "    }",
            "    {",
            "      Button button_2 = new Button();",
            "      add(button_2, 'ABCABC', false);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    //
    List<WidgetHandle> handles = panel.getWidgetHandles();
    assertThat(handles).hasSize(2);
    WidgetHandle handle_1 = handles.get(0);
    WidgetHandle handle_2 = handles.get(1);
    Rectangle bounds_1 = handle_1.getBounds();
    Rectangle bounds_2 = handle_2.getBounds();
View Full Code Here

  /**
   * Test for {@link AbstractWidgetHandle#show()}.
   */
  public void test_WidgetHandle_show() throws Exception {
    TabLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends TabLayoutPanel {",
            "  public Test() {",
            "    super(1.5, Unit.EM);",
            "    {",
            "      Button button_1 = new Button();",
            "      add(button_1, 'ABC', false);",
            "    }",
            "    {",
            "      Button button_2 = new Button();",
            "      add(button_2, 'ABCABC', false);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    assertTrue(isVisible(panel, button_1));
    assertFalse(isVisible(panel, button_2));
    //
    panel.getWidgetHandles().get(1).show();
    assertFalse(isVisible(panel, button_1));
    assertTrue(isVisible(panel, button_2));
  }
View Full Code Here

    assertFalse(isVisible(panel, button_1));
    assertTrue(isVisible(panel, button_2));
  }

  public void test_TabText_property() throws Exception {
    TabLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends TabLayoutPanel {",
            "  public Test() {",
            "    super(1.5, Unit.EM);",
            "    {",
            "      Button button = new Button();",
            "      add(button, 'My widget', false);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    Property property = button.getPropertyByTitle("TabText");
    assertNotNull(property);
    assertTrue(property.getCategory().isSystem());
View Full Code Here

  //
  // Commands
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_CREATE_this() throws Exception {
    TabLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends TabLayoutPanel {",
            "  public Test() {",
            "    super(1.5, Unit.EM);",
            "  }",
            "}");
    panel.refresh();
    //
    WidgetInfo newButton = createButton();
    panel.command_CREATE2(newButton, null);
    assertEditor(
        "public class Test extends TabLayoutPanel {",
        "  public Test() {",
        "    super(1.5, Unit.EM);",
        "    {",
View Full Code Here

            "    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(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
        "    TabLayoutPanel panel = new TabLayoutPanel(1.5, Unit.EM);",
View Full Code Here

            "      rootPanel.add(button);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    TabLayoutPanelInfo panel = getJavaInfoByName("panel");
    //
    WidgetInfo button = getJavaInfoByName("button");
    panel.command_MOVE2(button, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
        "    {",
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Copy/paste of {@link WidgetInfo} on {@link TabLayoutPanelInfo}.
   */
  public void test_clipboard_Widget() throws Exception {
    final TabLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends TabLayoutPanel {",
            "  public Test() {",
            "    super(1.5, Unit.EM);",
            "    {",
            "      Button myButton = new Button();",
            "      add(myButton, 'tab', false);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    //
    {
      WidgetInfo myButton = getJavaInfoByName("myButton");
      doCopyPaste(myButton, new PasteProcedure<WidgetInfo>() {
        public void run(WidgetInfo copy) throws Exception {
          panel.command_CREATE2(copy, null);
        }
      });
    }
    assertEditor(
        "public class Test extends TabLayoutPanel {",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.panels.TabLayoutPanelInfo$WidgetHandle

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.