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

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


        "}");
  }

  public void test_clipboard_addNewInstance() throws Exception {
    prepare_clipboard_MyImageBundle();
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "  }",
            "}");
    frame.refresh();
    // paste Tree
    addTreeFromMemento(frame);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  private static final MyImageBundle myImageBundle = GWT.create(MyImageBundle.class);",
View Full Code Here


        "  }",
        "}");
  }

  public void test_clipboard_noSuchImageBundle() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "  }",
            "}");
    frame.refresh();
    // paste Tree
    try {
      addTreeFromMemento(frame);
    } catch (Throwable e) {
      DesignerException de = DesignerExceptionUtils.getDesignerException(e);
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Even empty <code>DockPanel</code> has some reasonable size.
   */
  public void test_empty() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    DockPanel panel = new DockPanel();",
            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    DockPanelInfo panel = (DockPanelInfo) frame.getChildrenWidgets().get(0);
    assertThat(panel.getBounds().width).isGreaterThan(140);
    assertThat(panel.getBounds().height).isGreaterThan(20);
  }
View Full Code Here

  /**
   * <code>DockPanel</code> has <code>"horizontalAlignment"</code> and
   * <code>"verticalAlignment"</code> properties.
   */
  public void test_alignmentProperties() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    DockPanel panel = new DockPanel();",
            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    DockPanelInfo panel = (DockPanelInfo) frame.getChildrenWidgets().get(0);
    assertNotNull(panel.getPropertyByTitle("horizontalAlignment"));
    assertNotNull(panel.getPropertyByTitle("verticalAlignment"));
  }
View Full Code Here

  /**
   * Direction should be reflected in child {@link WidgetInfo} title.
   */
  public void test_DirectionInTitle() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    DockPanel panel = new DockPanel();",
            "    rootPanel.add(panel);",
            "    {",
            "      Button button_1 = new Button();",
            "      panel.add(button_1, DockPanel.WEST);",
            "    }",
            "    {",
            "      Button button_2 = new Button();",
            "      panel.add(button_2, DockPanel.NORTH);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    DockPanelInfo panel = (DockPanelInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo button_1 = panel.getChildrenWidgets().get(0);
    WidgetInfo button_2 = panel.getChildrenWidgets().get(1);
    // check title decorations
    {
      String title = ObjectsLabelProvider.INSTANCE.getText(button_1);
View Full Code Here

  /**
   * Test for contributed "Direction" property.
   */
  public void test_DirectionProperty() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    DockPanel panel = new DockPanel();",
            "    rootPanel.add(panel);",
            "    {",
            "      Button button = new Button();",
            "      panel.add(button, DockPanel.WEST);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    DockPanelInfo panel = (DockPanelInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    // check that "Direction" property exists
    Property directionProperty;
    {
      directionProperty = button.getPropertyByTitle("Direction");
View Full Code Here

  /**
   * Test for contributed "Cell" property.
   */
  public void test_CellProperty() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    DockPanel panel = new DockPanel();",
            "    rootPanel.add(panel);",
            "    {",
            "      Button button = new Button();",
            "      panel.add(button, DockPanel.WEST);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    DockPanelInfo panel = (DockPanelInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    // check that "Cell" property exists
    Property cellProperty;
    {
      cellProperty = button.getPropertyByTitle("Cell");
View Full Code Here

  /**
   * Test for copy/paste {@link DockPanelInfo} with its children.
   */
  public void test_clipboard_it() throws Exception {
    final RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      DockPanel panel = new DockPanel();",
            "      rootPanel.add(panel);",
            "      {",
            "        Button button_1 = new Button();",
            "        panel.add(button_1, DockPanel.WEST);",
            "      }",
            "      {",
            "        Button button_2 = new Button();",
            "        panel.add(button_2, DockPanel.NORTH);",
            "      }",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    {
      DockPanelInfo 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

            "    });",
            "  }",
            "}"));
    waitForAutoBuild();
    // parse
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    rootPanel.add(new MyComposite());",
            "  }",
            "}");
    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(new MyComposite())/}",
        "  {new: test.client.MyComposite} {empty} {/rootPanel.add(new MyComposite())/}");
    // refresh()
    frame.refresh();
    assertNoErrors(frame);
  }
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parse() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "import com.google.gwt.text.client.IntegerRenderer;",
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      ValueListBox valueListBox = new ValueListBox(IntegerRenderer.instance());",
            "      rootPanel.add(valueListBox);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    CompositeInfo valueListBox = (CompositeInfo) frame.getChildrenWidgets().get(0);
    Class<?> valueListBoxClass = valueListBox.getDescription().getComponentClass();
    assertTrue(ReflectionUtils.isSuccessorOf(
        valueListBoxClass,
        "com.google.gwt.user.client.ui.ValueListBox"));
  }
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.