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

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


  /**
   * Test for {@link RowLayoutDataInfo#setHeight(int)} and
   * {@link RowLayoutDataInfo#setHeight(String)}.
   */
  public void test_RowLayoutData_setHeightMethods() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    RowLayoutDataInfo rowData = RowLayoutInfo.getRowData(label);
    // set "int"
    rowData.setHeight(50);
    assertEditor(
        "public class Test extends Panel {",
View Full Code Here


        "  }",
        "}");
  }

  public void test_RowLayoutData_heightProperties() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    RowLayoutDataInfo rowData = RowLayoutInfo.getRowData(label);
    // set "int"
    rowData.getPropertyByTitle("height(int)").setValue(50);
    assertEditor(
        "public class Test extends Panel {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_RowLayoutData_materializeHeightAsString() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    RowLayoutDataInfo rowData = RowLayoutInfo.getRowData(label);
    // set "string"
    rowData.getPropertyByTitle("height(java.lang.String)").setValue("20%");
    assertEditor(
        "public class Test extends Panel {",
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parse() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Toolbar toolbar = new Toolbar();",
            "      toolbar.setAutoHeight(true);",
            "      toolbar.addButton(new ToolbarButton('A'));",
            "      toolbar.addButton(new ToolbarMenuButton('B'));",
            "      toolbar.addItem(new ToolbarTextItem('C'));",
            "      toolbar.addField(new TextField('D'));",
            "      add(toolbar);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    //
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/ /add(toolbar)/}",
        "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.Toolbar} {local-unique: toolbar} {/new Toolbar()/ /toolbar.setAutoHeight(true)/ /toolbar.addButton(new ToolbarButton('A'))/ /toolbar.addButton(new ToolbarMenuButton('B'))/ /toolbar.addItem(new ToolbarTextItem('C'))/ /toolbar.addField(new TextField('D'))/ /add(toolbar)/}",
        "    {new: com.gwtext.client.widgets.ToolbarButton} {empty} {/toolbar.addButton(new ToolbarButton('A'))/}",
        "    {new: com.gwtext.client.widgets.ToolbarMenuButton} {empty} {/toolbar.addButton(new ToolbarMenuButton('B'))/}",
        "    {new: com.gwtext.client.widgets.ToolbarTextItem} {empty} {/toolbar.addItem(new ToolbarTextItem('C'))/}",
        "    {new: com.gwtext.client.widgets.form.TextField} {empty} {/toolbar.addField(new TextField('D'))/}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}");
    //
    ToolbarInfo toolbar = (ToolbarInfo) panel.getChildrenWidgets().get(0);
    assertFalse(toolbar.shouldDrawDotsBorder());
  }
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parse() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    assertInstanceOf(AbsoluteLayoutInfo.class, panel.getLayout());
    //
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new AbsoluteLayout())/ /add(label)/}",
        "  {new: com.gwtext.client.widgets.layout.AbsoluteLayout} {empty} {/setLayout(new AbsoluteLayout())/}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label)/}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.AbsoluteLayoutData} {virtual-layout-data} {}");
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    AbsoluteLayoutDataInfo layoutData = AbsoluteLayoutInfo.getAbsoluteData(label);
    assertNotNull(layoutData);
  }
View Full Code Here

    AbsoluteLayoutDataInfo layoutData = AbsoluteLayoutInfo.getAbsoluteData(label);
    assertNotNull(layoutData);
  }

  public void test_BOUNDS_location() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) panel.getLayout();
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    //
    layout.command_BOUNDS(label, new Point(100, 50), null);
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_BOUNDS_size() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) panel.getLayout();
    WidgetInfo label = panel.getChildrenWidgets().get(0);
    //
    layout.command_BOUNDS(label, null, new Dimension(100, 40));
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_setAbsoluteLayout() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      Label label_1 = new Label();",
            "      add(label_1);",
            "    }",
            "    {",
            "      Label label_2 = new Label();",
            "      add(label_2);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // set AbsoluteLayout
    {
      LayoutInfo layout = createJavaInfo("com.gwtext.client.widgets.layout.AbsoluteLayout");
      panel.setLayout(layout);
    }
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new AbsoluteLayout());",
View Full Code Here

        "  }",
        "}");
  }

  public void test_deleteAbsoluteLayout() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Label label_1 = new Label();",
            "      add(label_1, new AbsoluteLayoutData(0, 0));",
            "      label_1.setSize('448px', '149px');",
            "    }",
            "    {",
            "      Label label_2 = new Label();",
            "      add(label_2, new AbsoluteLayoutData(0, 149));",
            "      label_2.setSize('448px', '149px');",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // set RowLayout
    {
      LayoutInfo layout = createJavaInfo("com.gwtext.client.widgets.layout.RowLayout");
      panel.setLayout(layout);
    }
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new RowLayout());",
View Full Code Here

  /**
   * Test applying creation flow order.
   */
  public void test_BOUNDS_CreationFlow() throws Exception {
    preferences.setValue(IPreferenceConstants.P_CREATION_FLOW, true);
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      com.google.gwt.user.client.ui.Button button = new com.google.gwt.user.client.ui.Button();",
            "      add(button, new AbsoluteLayoutData(100, 50));",
            "    }",
            "    {",
            "      com.google.gwt.user.client.ui.Label label = new com.google.gwt.user.client.ui.Label();",
            "      add(label, new AbsoluteLayoutData(100, 200));",
            "    }",
            "  }",
            "}");
    panel.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) panel.getLayout();
    WidgetInfo label = panel.getChildrenWidgets().get(1);
    // Bounds
    layout.command_BOUNDS(label, new Point(5, 5), null);
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
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.