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

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.ComplexPanelInfo


  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_CREATE() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
            "  public Test() {",
            "  }",
            "}");
    panel.refresh();
    // prepare new widget
    WidgetInfo newWidget = createJavaInfo("com.extjs.gxt.ui.client.widget.ListView");
    // check "live image"
    {
      Image liveImage = newWidget.getImage();
      assertEquals(300, liveImage.getBounds().width);
      assertEquals(200, liveImage.getBounds().height);
    }
    // do create
    panel.command_CREATE2(newWidget, null);
    assertEditor(
        "import com.extjs.gxt.ui.client.store.ListStore;",
        "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
        "  public Test() {",
        "    {",
View Full Code Here


  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_CREATE() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
            "  public Test() {",
            "  }",
            "}");
    panel.refresh();
    // prepare new Table
    WidgetInfo newTable = createJavaInfo("com.extjs.gxt.ui.client.widget.table.Table");
    // check "live image"
    {
      Image liveImage = newTable.getImage();
      assertEquals(300, liveImage.getBounds().width);
      assertEquals(200, liveImage.getBounds().height);
    }
    // do create
    panel.command_CREATE2(newTable, null);
    assertEditor(
        "import com.extjs.gxt.ui.client.widget.table.Table;",
        "import com.extjs.gxt.ui.client.widget.table.TableColumnModel;",
        "import com.extjs.gxt.ui.client.widget.table.TableColumn;",
        "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Use {@link DeviceSelectionSupport#setDevice(IUIObjectInfo, DeviceInfo)} directly.
   */
  public void test_setDevice() throws Exception {
    ComplexPanelInfo originalPanel;
    {
      originalPanel =
          openJavaInfo(
              "// filler filler filler filler filler",
              "// filler filler filler filler filler",
              "public class Test extends FlowPanel {",
              "  public Test() {",
              "  }",
              "}");
      GraphicalEditPart panelEditPart = canvas.getEditPart(originalPanel);
      Figure panelFigure = panelEditPart.getFigure();
      // no device yet
      assertEquals(new Rectangle(20, 20, 450, 300), panelFigure.getBounds());
      assertTrue(hasTopSelectionPolicy(panelEditPart));
      // set device
      DeviceSelectionSupport.setDevice(originalPanel, DeviceManager.getDevice("generic.qvga"));
      assertEquals(new Rectangle(25, 25, 240, 320), panelFigure.getBounds());
      assertFalse(hasTopSelectionPolicy(panelEditPart));
    }
    // parse again
    {
      openSourcePage();
      m_lastEditor.replaceSubstring(0, 0, " ");
      m_lastEditor.commitChanges();
      openDesignPage();
      fetchContentFields();
    }
    // ...still has device
    {
      ComplexPanelInfo newPanel = (ComplexPanelInfo) m_contentJavaInfo;
      assertNotSame(originalPanel, newPanel);
      // has device
      assertNotNull(DeviceSelectionSupport.getDevice(newPanel));
      // device bounds applied
      GraphicalEditPart panelEditPart = canvas.getEditPart(newPanel);
View Full Code Here

  /**
   * Use {@link DeviceSelectionSupport#setOrientation(IUIObjectInfo, Orientation)}.
   */
  public void test_setOrientation() throws Exception {
    ComplexPanelInfo panel =
        openJavaInfo(
            "// filler filler filler filler filler",
            "// filler filler filler filler filler",
            "public class Test extends FlowPanel {",
            "  public Test() {",
View Full Code Here

  /**
   * Use {@link MenuItem} to choose device.
   */
  public void test_useDeviceMenu() throws Exception {
    ComplexPanelInfo panel =
        openJavaInfo(
            "// filler filler filler filler filler",
            "// filler filler filler filler filler",
            "public class Test extends FlowPanel {",
            "  public Test() {",
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_CREATE() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
            "  public Test() {",
            "  }",
            "}");
    panel.refresh();
    // prepare new Table
    WidgetInfo newTable = createJavaInfo("com.extjs.gxt.ui.client.widget.treetable.TreeTable");
    // check "live image"
    {
      Image liveImage = newTable.getImage();
      assertEquals(300, liveImage.getBounds().width);
      assertEquals(200, liveImage.getBounds().height);
    }
    // do create
    panel.command_CREATE2(newTable, null);
    assertEditor(
        "import com.extjs.gxt.ui.client.widget.treetable.TreeTable;",
        "import com.extjs.gxt.ui.client.widget.treetable.TreeTableColumnModel;",
        "import java.util.Collections;",
        "import com.extjs.gxt.ui.client.widget.treetable.TreeTableColumn;",
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parse() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "import java.util.Collections;",
            "import com.extjs.gxt.ui.client.store.*;",
            "import com.extjs.gxt.ui.client.widget.grid.*;",
            "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
            "  public Test() {",
            "    {",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(Collections.<ColumnConfig>emptyList()));",
            "      add(grid);",
            "      grid.setBorders(true);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.google.gwt.user.client.ui.HorizontalPanel} {this} {/add(grid)/}",
        "  {new: com.extjs.gxt.ui.client.widget.grid.Grid} {local-unique: grid} {/new Grid(new ListStore(), new ColumnModel(Collections.<ColumnConfig>emptyList()))/ /add(grid)/ /grid.setBorders(true)/}");
    //
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here

   * should replace it with empty, because <code>GridView</code> does not like <code>null</code>.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.php?43315
   */
  public void test_null_ColumnModel() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "import java.util.Collections;",
            "import com.extjs.gxt.ui.client.store.*;",
            "import com.extjs.gxt.ui.client.widget.grid.*;",
            "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
            "  public Test() {",
            "    {",
            "      Grid grid = new Grid(new ListStore(), null);",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.google.gwt.user.client.ui.HorizontalPanel} {this} {/add(grid)/}",
        "  {new: com.extjs.gxt.ui.client.widget.grid.Grid} {local-unique: grid} {/new Grid(new ListStore(), null)/ /add(grid)/}");
    //
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here

   * replace it with empty, because <code>GridView</code> does not like <code>null</code>.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.php?44403
   */
  public void test_null_ListStore() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "import com.extjs.gxt.ui.client.widget.grid.*;",
            "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
            "  public Test() {",
            "    {",
            "      Grid grid = new Grid(null, null);",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.google.gwt.user.client.ui.HorizontalPanel} {this} {/add(grid)/}",
        "  {new: com.extjs.gxt.ui.client.widget.grid.Grid} {local-unique: grid} {/new Grid(null, null)/ /add(grid)/}");
    //
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here

   * replace it with empty, because <code>GridView</code> does not like <code>null</code>.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.php?44403
   */
  public void test_null_ListStore_GroupingView() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "import com.extjs.gxt.ui.client.widget.grid.*;",
            "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
            "  public Test() {",
            "    {",
            "      Grid grid = new Grid(null, null);",
            "      grid.setView(new GroupingView());",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.google.gwt.user.client.ui.HorizontalPanel} {this} {/add(grid)/}",
        "  {new: com.extjs.gxt.ui.client.widget.grid.Grid} {local-unique: grid} {/new Grid(null, null)/ /grid.setView(new GroupingView())/ /add(grid)/}");
    //
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.panels.ComplexPanelInfo

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.