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

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


  /**
   * Test for {@link GridInfo#command_CREATE(ColumnConfigInfo, ColumnConfigInfo)}.
   */
  public void test_columns_CREATE_noOtherColumns() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "import java.util.List;",
            "import java.util.ArrayList;",
            "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() {",
            "    {",
            "      List<ColumnConfig> configs = new ArrayList<ColumnConfig>();",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(configs));",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    GridInfo grid = getJavaInfoByName("grid");
    //
    ColumnConfigInfo newColumn = createJavaInfo("com.extjs.gxt.ui.client.widget.grid.ColumnConfig");
    grid.command_CREATE(newColumn, null);
    assertEditor(
View Full Code Here


  /**
   * Test for {@link GridInfo#command_CREATE(ColumnConfigInfo, ColumnConfigInfo)}.
   */
  public void test_columns_CREATE_beforeOtherColumns() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "import java.util.List;",
            "import java.util.ArrayList;",
            "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() {",
            "    {",
            "      List<ColumnConfig> configs = new ArrayList<ColumnConfig>();",
            "      {",
            "        ColumnConfig column_1 = new ColumnConfig();",
            "        configs.add(column_1);",
            "      }",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(configs));",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    GridInfo grid = getJavaInfoByName("grid");
    ColumnConfigInfo column_1 = getJavaInfoByName("column_1");
    //
    ColumnConfigInfo newColumn = createJavaInfo("com.extjs.gxt.ui.client.widget.grid.ColumnConfig");
    grid.command_CREATE(newColumn, column_1);
View Full Code Here

   * When <code>Grid</code> itself was just created.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.asp?47667
   */
  public void test_columns_CREATE_intoNewGrid() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "// filler filler filler filler filler",
            "// filler filler filler filler filler",
            "public class Test extends com.google.gwt.user.client.ui.HorizontalPanel {",
            "  public Test() {",
            "  }",
            "}");
    panel.refresh();
    // create Grid
    GridInfo newGrid = createJavaInfo("com.extjs.gxt.ui.client.widget.grid.Grid");
    flowContainer_CREATE(panel, newGrid, null);
    assertEditor(
        "import com.extjs.gxt.ui.client.widget.grid.Grid;",
View Full Code Here

  /**
   * Test for {@link GridInfo#command_MOVE(ColumnConfigInfo, ColumnConfigInfo)}.
   */
  public void test_columns_MOVE_beforeOtherColumns() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "import java.util.List;",
            "import java.util.ArrayList;",
            "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() {",
            "    {",
            "      List<ColumnConfig> configs = new ArrayList<ColumnConfig>();",
            "      {",
            "        ColumnConfig column_1 = new ColumnConfig();",
            "        configs.add(column_1);",
            "      }",
            "      {",
            "        ColumnConfig column_2 = new ColumnConfig();",
            "        configs.add(column_2);",
            "      }",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(configs));",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    GridInfo grid = getJavaInfoByName("grid");
    ColumnConfigInfo column_1 = getJavaInfoByName("column_1");
    ColumnConfigInfo column_2 = getJavaInfoByName("column_2");
    //
    grid.command_MOVE(column_2, column_1);
View Full Code Here

  /**
   * Test for {@link GridInfo#command_MOVE(ColumnConfigInfo, ColumnConfigInfo)}.
   */
  public void test_columns_MOVE_toLast() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "import java.util.List;",
            "import java.util.ArrayList;",
            "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() {",
            "    {",
            "      List<ColumnConfig> configs = new ArrayList<ColumnConfig>();",
            "      {",
            "        ColumnConfig column_1 = new ColumnConfig();",
            "        configs.add(column_1);",
            "      }",
            "      {",
            "        ColumnConfig column_2 = new ColumnConfig();",
            "        configs.add(column_2);",
            "      }",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(configs));",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    GridInfo grid = getJavaInfoByName("grid");
    ColumnConfigInfo column_1 = getJavaInfoByName("column_1");
    //
    grid.command_MOVE(column_1, null);
    assertEditor(
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * <code>ColumnModel</code> with Arrays.asList().
   */
  public void test_columns_parse_asArray() throws Exception {
    ComplexPanelInfo panel =
        parseJavaInfo(
            "import java.util.Arrays;",
            "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() {",
            "    {",
            "      ColumnConfig column = new ColumnConfig();",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(Arrays.asList(column)));",
            "      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(), new ColumnModel(Arrays.asList(column)))/ /add(grid)/}",
        "    Arrays.asList []",
        "    {new: com.extjs.gxt.ui.client.widget.grid.ColumnConfig} {local-unique: column} {/new ColumnConfig()/ /Arrays.asList(column)/}");
    //
    panel.refresh();
    assertNoErrors(panel);
    // check ColumnConfig_Info
    ColumnConfigInfo column = getJavaInfoByName("column");
    {
      Association association = column.getAssociation();
View Full Code Here

            "  }",
            "}");
    //System.out.println(m_lastEditor.getSource());
    frame.refresh();
    // check "innerPanel" coordinates
    ComplexPanelInfo innerPanel = (ComplexPanelInfo) frame.getChildrenWidgets().get(0);
    assertEquals(innerModelBounds, innerPanel.getModelBounds());
    assertEquals(innerParentBounds, innerPanel.getBounds());
    // check "button" coordinates
    {
      WidgetInfo button = innerPanel.getChildrenWidgets().get(0);
      assertEquals(buttonModelBounds, button.getModelBounds());
      assertEquals(buttonParentBounds, button.getBounds());
    }
  }
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 Grid
    WidgetInfo newGrid = createJavaInfo("com.extjs.gxt.ui.client.widget.grid.EditorGrid");
    // check "live image"
    {
      Image liveImage = newGrid.getImage();
      assertEquals(302, liveImage.getBounds().width);
      assertEquals(202, liveImage.getBounds().height);
    }
    // do create
    panel.command_CREATE2(newGrid, null);
    assertEditor(
        "import com.extjs.gxt.ui.client.widget.grid.EditorGrid;",
        "import com.extjs.gxt.ui.client.store.ListStore;",
        "import com.extjs.gxt.ui.client.widget.grid.ColumnModel;",
        "import java.util.Collections;",
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    TabPanelInfo panel = (TabPanelInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo button_1 = panel.getChildrenWidgets().get(0);
    ComplexPanelInfo flowPanel = (ComplexPanelInfo) panel.getChildrenWidgets().get(1);
    WidgetInfo button_2 = flowPanel.getChildrenWidgets().get(0);
    assertTrue(isVisible(button_1));
    assertFalse(isVisible(flowPanel));
    // send "selecting" broadcast
    String expectedSource = m_lastEditor.getSource();
    {
View Full Code Here

  /**
   * Copy/paste of {@link TabPanelInfo} with {@link WidgetInfo}s.
   */
  public void test_clipboard_Panel() throws Exception {
    final ComplexPanelInfo frame =
        parseJavaInfo(
            "public class Test extends FlowPanel {",
            "  public Test() {",
            "    {",
            "      TabPanel panel = new TabPanel();",
            "      {",
            "        Button buttonA = new Button('A');",
            "        panel.add(buttonA, 'Header A', false);",
            "      }",
            "      {",
            "        Button buttonB = new Button('B');",
            "        panel.add(buttonB, 'Header B', false);",
            "      }",
            "      add(panel);",
            "    }",
            "  }",
            "}");
    refresh();
    //
    {
      TabPanelInfo panel = getJavaInfoByName("panel");
      doCopyPaste(panel, new PasteProcedure<WidgetInfo>() {
        public void run(WidgetInfo copy) throws Exception {
          frame.command_CREATE2(copy, null);
        }
      });
    }
    assertEditor(
        "public class Test extends FlowPanel {",
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.