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

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


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


  /**
   * Test {@link LayoutInfo#isActive()}.
   */
  public void test_Layout_isActive() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "// filler filler filler",
            "public class Test extends Panel {",
            "  public Test() {",
            "  }",
            "}");
    panel.refresh();
    // "default" is active
    LayoutInfo defaultLayout = panel.getLayout();
    assertTrue(defaultLayout.isActive());
    assertSame(panel, defaultLayout.getContainer());
    // set RowLayout
    LayoutInfo rowLayout;
    {
      rowLayout = createJavaInfo("com.gwtext.client.widgets.layout.RowLayout");
      panel.setLayout(rowLayout);
      assertHierarchy(
          "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/}",
          "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}");
      assertSame(rowLayout, panel.getLayout());
    }
    // RowLayout is active now
    assertTrue(rowLayout.isActive());
    assertFalse(defaultLayout.isActive());
    // both layouts bounds to same container
View Full Code Here

  /**
   * Test {@link LayoutInfo} properties.
   */
  public void test_Layout_properties() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "  }",
            "}");
    //
    Property layoutProperty = panel.getPropertyByTitle("Layout");
    assertNotNull(layoutProperty);
    assertTrue(layoutProperty.isModified());
    assertEquals("(com.gwtext.client.widgets.layout.RowLayout)", getPropertyText(layoutProperty));
    {
      Property[] subProperties = getSubProperties(layoutProperty);
View Full Code Here

  /**
   * Test for {@link DefaultLayoutInfo} properties.
   */
  public void test_Layout_defaultLayoutProperties() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "// filler filler filler",
            "public class Test extends Panel {",
            "  public Test() {",
            "  }",
            "}");
    //
    Property layoutProperty = panel.getPropertyByTitle("Layout");
    assertNotNull(layoutProperty);
    assertTrue(layoutProperty.isModified());
    assertEquals("(default)", getPropertyText(layoutProperty));
    {
      Property[] subProperties = getSubProperties(layoutProperty);
View Full Code Here

  //
  // LayoutData management, support for virtual
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_LayoutDataMng_addLayoutData_whenSetLayout() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // initial state
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/add(label)/}",
        "  {implicit-layout: default} {implicit-layout} {}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label)/}");
    // set RowLayout
    LayoutInfo rowLayout = createJavaInfo("com.gwtext.client.widgets.layout.RowLayout");
    panel.setLayout(rowLayout);
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new RowLayout());",
        "    {",
View Full Code Here

        "  {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} {}");
  }

  public void test_LayoutDataMng_addLayoutData_whenAddWidget() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "  }",
            "}");
    panel.refresh();
    // initial state
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}");
    RowLayoutInfo layout = (RowLayoutInfo) panel.getLayout();
    // add Label widget
    WidgetInfo label = createJavaInfo("com.gwtext.client.widgets.form.Label");
    layout.command_CREATE(label, null);
    assertEditor(
        "public class Test extends Panel {",
View Full Code Here

        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label('New Label')/ /add(label)/}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}");
  }

  public void test_LayoutDataMng_addLayoutData_whenMoveWidgetTo() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    {",
            "      Panel inner = new Panel();",
            "      inner.setLayout(new RowLayout());",
            "      add(inner);",
            "    }",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // initial state
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/add(inner)/ /add(label)/}",
        "  {implicit-layout: default} {implicit-layout} {}",
        "  {new: com.gwtext.client.widgets.Panel} {local-unique: inner} {/new Panel()/ /inner.setLayout(new RowLayout())/ /add(inner)/}",
        "    {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/inner.setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label)/}");
    PanelInfo inner = (PanelInfo) panel.getChildrenWidgets().get(0);
    WidgetInfo label = panel.getChildrenWidgets().get(1);
    // move "label" to "inner"
    ((RowLayoutInfo) inner.getLayout()).command_MOVE(label, null);
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    {",
        "      Panel inner = new Panel();",
View Full Code Here

        "    {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /inner.add(label)/}",
        "      {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}");
  }

  public void test_LayoutDataMng_deleteLayoutData_whenMoveWidgetFrom() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Panel inner = new Panel();",
            "      add(inner);",
            "    }",
            "    {",
            "      Label label = new Label();",
            "      add(label, new RowLayoutData(50));",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // initial state
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/ /add(inner)/ /add(label, new RowLayoutData(50))/}",
        "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.Panel} {local-unique: inner} {/new Panel()/ /add(inner)/}",
        "    {implicit-layout: default} {implicit-layout} {}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label, new RowLayoutData(50))/}",
        "    {new: com.gwtext.client.widgets.layout.RowLayoutData} {empty} {/add(label, new RowLayoutData(50))/}");
    PanelInfo inner = (PanelInfo) panel.getChildrenWidgets().get(0);
    WidgetInfo label = panel.getChildrenWidgets().get(1);
    // move "label" to "inner"
    inner.getLayout().command_MOVE(label, null);
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new RowLayout());",
        "    {",
View Full Code Here

        "    {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}",
        "    {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /inner.add(label)/}");
  }

  public void test_LayoutDataMng_deleteLayoutData_whenReplaceLayout() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // initial state
    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} {}");
    // set ColumnLayout
    {
      LayoutInfo rowLayout = createJavaInfo("com.gwtext.client.widgets.layout.ColumnLayout");
      panel.setLayout(rowLayout);
    }
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new ColumnLayout());",
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for parsing {@link LayoutDataInfo}.
   */
  public void test_parseLayoutData() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label, new RowLayoutData(50));",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/ /add(label, new RowLayoutData(50))/}",
        "  {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, new RowLayoutData(50))/}",
        "    {new: com.gwtext.client.widgets.layout.RowLayoutData} {empty} {/add(label, new RowLayoutData(50))/}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    RowLayoutDataInfo rowData = RowLayoutInfo.getRowData(label);
    assertVisible(rowData, false);
  }
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.