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

Examples of com.google.gdt.eclipse.designer.gwtext.model.widgets.PanelInfo


    panel.refresh();
    assertNoErrors(panel);
  }

  public void test_CREATE() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}");
    panel.refresh();
    //
    PagingToolbarInfo toolbar = createJavaInfo("com.gwtext.client.widgets.PagingToolbar");
    panel.getLayout().command_CREATE(toolbar, null);
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new RowLayout());",
        "    {",
View Full Code Here


  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parse() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new FitLayout());",
            "  }",
            "}");
    panel.refresh();
    //
    TreePanelInfo treePanel =
        (TreePanelInfo) createWidget("com.gwtext.client.widgets.tree.TreePanel");
    panel.getLayout().command_CREATE(treePanel, null);
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new FitLayout());",
        "    {",
        "      TreePanel treePanel = new TreePanel();",
        "      {",
        "        TreeNode treeNode = new TreeNode('(Root)', '');",
        "        treePanel.setRootNode(treeNode);",
        "      }",
        "      add(treePanel);",
        "    }",
        "  }",
        "}");
    panel.refresh();
  }
View Full Code Here

  /**
   * When delete root node, new one should be added, because <code>TreePanel</code> requires it.
   */
  public void test_delete() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new FitLayout());",
            "    {",
            "      TreePanel treePanel = new TreePanel();",
            "      {",
            "        TreeNode root = new TreeNode('Initial root');",
            "        treePanel.setRootNode(root);",
            "      }",
            "      add(treePanel);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    TreePanelInfo treePanel = (TreePanelInfo) panel.getChildrenWidgets().get(0);
    // delete "root"
    treePanel.getRootNode().delete();
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parse() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new BorderLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label, new BorderLayoutData(RegionPosition.CENTER));",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new BorderLayout())/ /add(label, new BorderLayoutData(RegionPosition.CENTER))/}",
        "  {new: com.gwtext.client.widgets.layout.BorderLayout} {empty} {/setLayout(new BorderLayout())/}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label, new BorderLayoutData(RegionPosition.CENTER))/}",
        "    {new: com.gwtext.client.widgets.layout.BorderLayoutData} {empty} {/add(label, new BorderLayoutData(RegionPosition.CENTER))/}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    BorderLayoutDataInfo layoutData = BorderLayoutInfo.getBorderData(label);
    assertNotNull(layoutData);
    // check position
    assertEquals("center", layoutData.getPosition());
  }
View Full Code Here

  /**
   * We should be able to parse <code>BorderLayout</code> without center widget. We create
   * artificial <code>Panel</code> at center.
   */
  public void test_parseEmpty() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new BorderLayout());",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new BorderLayout())/}",
        "  {new: com.gwtext.client.widgets.layout.BorderLayout} {empty} {/setLayout(new BorderLayout())/}");
    // at refresh() we also should add fix
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here

    frame.refresh();
    assertNoErrors(frame);
  }

  public void test_setLayout() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    {",
            "      Label label_1 = new Label();",
            "      add(label_1);",
            "    }",
            "    {",
            "      Label label_2 = new Label();",
            "      add(label_2);",
            "    }",
            "  }",
            "}");
    {
      LayoutInfo layout = createJavaInfo("com.gwtext.client.widgets.layout.BorderLayout");
      panel.setLayout(layout);
    }
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/add(label_1, new BorderLayoutData(RegionPosition.CENTER))/ /add(label_2, new BorderLayoutData(RegionPosition.CENTER))/ /setLayout(new BorderLayout())/}",
        "  {new: com.gwtext.client.widgets.layout.BorderLayout} {empty} {/setLayout(new BorderLayout())/}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label_1} {/new Label()/ /add(label_1, new BorderLayoutData(RegionPosition.CENTER))/}",
View Full Code Here

  /**
   * Test for {@link BorderLayoutDataInfo#setPosition(String)}.
   */
  public void test_setPosition() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new BorderLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label, new BorderLayoutData(RegionPosition.CENTER));",
            "    }",
            "    {",
            "      Label label_2 = new Label();",
            "      add(label_2, new BorderLayoutData(RegionPosition.NORTH));",
            "    }",
            "  }",
            "}");
    WidgetInfo label_2 = panel.getChildrenWidgets().get(1);
    BorderLayoutDataInfo layoutData = BorderLayoutInfo.getBorderData(label_2);
    assertNotNull(layoutData);
    // check position
    assertEquals("north", layoutData.getPosition());
    layoutData.setPosition("west");
View Full Code Here

  /**
   * Test for {@link BorderLayoutInfo#getWidget(String)}.
   */
  public void test_getWidget() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new BorderLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label, new BorderLayoutData(RegionPosition.CENTER));",
            "    }",
            "    {",
            "      Label label_2 = new Label();",
            "      add(label_2, new BorderLayoutData(RegionPosition.NORTH));",
            "    }",
            "  }",
            "}");
    BorderLayoutInfo layout = (BorderLayoutInfo) panel.getLayout();
    WidgetInfo label_1 = panel.getChildrenWidgets().get(0);
    WidgetInfo label_2 = panel.getChildrenWidgets().get(1);
    //
    assertSame(label_2, layout.getWidget("north"));
    assertSame(null, layout.getWidget("south"));
    assertSame(null, layout.getWidget("west"));
    assertSame(null, layout.getWidget("east"));
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parse() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    assertInstanceOf(RowLayoutInfo.class, panel.getLayout());
    //
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    assertNotNull(RowLayoutInfo.getRowData(label));
  }
View Full Code Here

            "    }",
            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    PanelInfo panel = (PanelInfo) frame.getChildrenWidgets().get(0);
    RowLayoutInfo layout = (RowLayoutInfo) panel.getLayout();
    //
    WidgetInfo label_1 = panel.getChildrenWidgets().get(0);
    layout.command_MOVE(label_1, null);
    assertEditor(
        "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.gwtext.model.widgets.PanelInfo

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.