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

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


  /**
   * Test for {@link VirtualLayoutDataVariableSupport} and {@link VirtualLayoutDataCreationSupport}.
   */
  public void test_LayoutData_virtualVariable() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/ /add(label)/}",
        "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label)/}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    RowLayoutDataInfo rowData = RowLayoutInfo.getRowData(label);
    //
    VirtualLayoutDataVariableSupport variable =
        (VirtualLayoutDataVariableSupport) rowData.getVariableSupport();
    assertTrue(variable.isDefault());
View Full Code Here


  /**
   * Test for {@link VirtualLayoutDataCreationSupport}.
   */
  public void test_LayoutData_virtualCreationSupport() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/ /add(label)/}",
        "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label)/}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    RowLayoutDataInfo rowData = RowLayoutInfo.getRowData(label);
    VirtualLayoutDataCreationSupport creationSupport =
        (VirtualLayoutDataCreationSupport) rowData.getCreationSupport();
    // access
    assertNull(creationSupport.getNode());
View Full Code Here

  /**
   * Test for materializing {@link LayoutDataInfo} when try to set its property.
   */
  public void test_LayoutData_materialize() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/ /add(label)/}",
        "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label)/}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    RowLayoutDataInfo rowData = RowLayoutInfo.getRowData(label);
    // set "height"
    rowData.getPropertyByTitle("height(int)").setValue(100);
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/ /add(label, new RowLayoutData(100))/}",
View Full Code Here

  /**
   * Test for complex "LayoutData" property.
   */
  public void test_LayoutData_property() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label, new RowLayoutData(50));",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    // check for "LayoutData" property
    Property layoutDataProperty = label.getPropertyByTitle("LayoutData");
    assertTrue(layoutDataProperty.isModified());
    // sub properties
    {
View Full Code Here

    String setLayoutSource = MessageFormat.format("setLayout({0});", layoutSource);
    check_SomeLayout0(setLayoutSource, horizontal);
  }

  private void check_SomeLayout0(String setLayoutSource, boolean horizontal) throws Exception {
    PanelInfo panel =
        openPanel("public class Test extends Panel {", "  public Test() {", "    "
            + setLayoutSource, "  }", "}");
    // CREATE "label_1"
    GraphicalEditPart labelPart_1;
    {
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 ColumnLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    assertInstanceOf(ColumnLayoutInfo.class, panel.getLayout());
    //
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new ColumnLayout())/ /add(label)/}",
        "  {new: com.gwtext.client.widgets.layout.ColumnLayout} {empty} {/setLayout(new ColumnLayout())/}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label)/}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.ColumnLayoutData} {virtual-layout-data} {}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    ColumnLayoutDataInfo layoutData = ColumnLayoutInfo.getColumnData(label);
    assertNotNull(layoutData);
    // set width
    {
      layoutData.setWidth(0.2);
View Full Code Here

  /**
   * Test for complex "LayoutData" property.
   */
  public void test_LayoutData_property_whenWasVirtual() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new ColumnLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    // initially it is virtual, so no "LayoutData" property
    assertNull(label.getPropertyByTitle("LayoutData"));
    // set "width", so materialize
    ColumnLayoutInfo.getColumnData(label).setWidth(0.2);
    // now we have "LayoutData" property
View Full Code Here

            "    RootPanel rootPanel = RootPanel.get();",
            "  }",
            "}");
    frame.refresh();
    {
      PanelInfo panel = (PanelInfo) createWidget("com.gwtext.client.widgets.Panel");
      assertThat(panel).isNotNull();
      assertThat(panel.getImage()).isNotNull();
    }
  }
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    // has border
    {
      PanelInfo panel = (PanelInfo) frame.getChildrenWidgets().get(0);
      assertEquals(true, panel.getPropertyByTitle("border").getValue());
      assertFalse(panel.shouldDrawDotsBorder());
    }
    // no border
    {
      PanelInfo panel = (PanelInfo) frame.getChildrenWidgets().get(1);
      assertEquals(false, panel.getPropertyByTitle("border").getValue());
      assertTrue(panel.shouldDrawDotsBorder());
    }
  }
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.