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

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


      assertTrue(panel.shouldDrawDotsBorder());
    }
  }

  public void test_clientAreaInsets() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setTitle('My title');",
            "  }",
            "}");
    panel.refresh();
    // check insets
    Insets insets = panel.getClientAreaInsets();
    assertEquals(new Insets(26, 0, 0, 0), insets);
  }
View Full Code Here


   * buggy.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.php?44153
   */
  public void test_removePropertyHtml_whenAddChild() throws Exception {
    final PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setHtml('My html');",
            "  }",
            "}");
    panel.refresh();
    //
    ExecutionUtils.run(panel, new RunnableEx() {
      public void run() throws Exception {
        ComponentInfo treePanel = createJavaInfo("com.gwtext.client.widgets.tree.TreePanel");
        panel.getLayout().command_CREATE(treePanel, null);
      }
    });
    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 CardLayout());",
            "    {",
            "      Label label = new Label();",
            "      add(label);",
            "    }",
            "  }",
            "}");
    CardLayoutInfo layout = (CardLayoutInfo) panel.getLayout();
    // no LayoutData
    {
      WidgetInfo label = panel.getChildrenWidgets().get(0);
      assertNull(LayoutInfo.getLayoutData(label));
    }
    // no SimpleContainer
    {
      List<SimpleContainer> containers = new SimpleContainerFactory(layout, true).get();
View Full Code Here

  //
  // Manage active
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_manageActive() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new CardLayout());",
            "    {",
            "      Panel panel_1 = new Panel();",
            "      add(panel_1);",
            "    }",
            "    {",
            "      Panel panel_2 = new Panel();",
            "      add(panel_2);",
            "    }",
            "    {",
            "      Panel panel_3 = new Panel();",
            "      add(panel_3);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    List<WidgetInfo> panels = panel.getChildrenWidgets();
    // initially "panel_1" is expanded
    assertActiveIndex(panel, 0);
    // notify about "panel_2"
    {
      boolean shouldRefresh = notifySelecting(panels.get(1));
      assertTrue(shouldRefresh);
      panel.refresh();
      // now "panel_2" is expanded
      assertActiveIndex(panel, 1);
    }
    // second notification about "panel_2" does not cause refresh()
    {
View Full Code Here

    int actual = ((CardLayoutInfo) cardPanel.getLayout()).getActiveIndex();
    assertEquals(expected, actual);
  }

  public void test_case_40821() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new CardLayout());",
            "    {",
            "      Panel panel_1 = new Panel();",
            "      add(panel_1);",
            "    }",
            "    {",
            "      Panel panel_2 = new Panel();",
            "      add(panel_2);",
            "    }",
            "  }",
            "}");
    // layout
    CardLayoutInfo layout = (CardLayoutInfo) panel.getChildrenJava().get(0);
    assertSame(layout, panel.getLayout());
    // set active item
    Property activeItemProperty = layout.getPropertyByTitle("activeItem(int)");
    activeItemProperty.setValue(1);
    // check source
    assertEditor(
View Full Code Here

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

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

    TableLayoutDataInfo layoutData = TableLayoutInfo.getTableData(label);
    assertNotNull(layoutData);
  }

  public void test_parseEmpty() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(1));",
            "  }",
            "}");
    panel.refresh();
    //
    TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
    IGridInfo gridInfo = layout.getGridInfo();
    assertThat(gridInfo.getRowCount()).isZero();
    assertThat(gridInfo.getRowIntervals()).isEmpty();
    assertThat(gridInfo.getColumnCount()).isZero();
    assertThat(gridInfo.getColumnIntervals()).isEmpty();
View Full Code Here

  /**
   * Fillers should be filtered out from presentation children.
   */
  public void test_excludeFillersFromPresentationChildren() throws Exception {
    PanelInfo shell =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(1));",
            "    {",
            "      Button button = new Button();",
            "      add(button);",
            "    }",
            "    add(new Label());",
            "  }",
            "}");
    shell.refresh();
    assertThat(shell.getChildrenWidgets()).hasSize(2);
    WidgetInfo button = shell.getChildrenWidgets().get(0);
    WidgetInfo filler = shell.getChildrenWidgets().get(1);
    //
    IObjectPresentation presentation = shell.getPresentation();
    {
      List<ObjectInfo> presentationChildren = presentation.getChildrenTree();
      assertTrue(presentationChildren.contains(button));
      assertFalse(presentationChildren.contains(filler));
    }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for initializing {@link TableLayoutDataInfo}.
   */
  public void test_initializeTable_noSpans() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(2));",
            "    {",
            "      Label label_1 = new Label();",
            "      add(label_1);",
            "    }",
            "    {",
            "      Label label_2 = new Label();",
            "      add(label_2);",
            "    }",
            "    {",
            "      Label label_3 = new Label();",
            "      add(label_3);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    assertCells(panel.getChildrenWidgets().get(0), 0, 0, 1, 1);
    assertCells(panel.getChildrenWidgets().get(1), 1, 0, 1, 1);
    assertCells(panel.getChildrenWidgets().get(2), 0, 1, 1, 1);
    // refresh() second time, just to covert double initialization, no changes expected
    panel.refresh();
    assertCells(panel.getChildrenWidgets().get(0), 0, 0, 1, 1);
    assertCells(panel.getChildrenWidgets().get(1), 1, 0, 1, 1);
    assertCells(panel.getChildrenWidgets().get(2), 0, 1, 1, 1);
  }
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.