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

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


    panel.refresh();
    assertNoErrors(panel);
  }

  public void test_CREATE() 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() {",
            "  }",
            "}");
    panel.refresh();
    // prepare new Grid
    WidgetInfo newGrid = createJavaInfo("com.extjs.gxt.ui.client.widget.grid.Grid");
    // 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 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);",
        "    }",
        "  }",
        "}");
    panel.refresh();
  }
View Full Code Here


  //
  // Columns: parsing
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_columns_parse_1() 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 = new ColumnConfig();",
            "        configs.add(column);",
            "      }",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(configs));",
            "      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(configs))/ /add(grid)/}",
        "    {new: com.extjs.gxt.ui.client.widget.grid.ColumnConfig} {local-unique: column} {/new ColumnConfig()/ /configs.add(column)/}");
    //
    panel.refresh();
    assertNoErrors(panel);
    // check ColumnConfig_Info
    ColumnConfigInfo column = getJavaInfoByName("column");
    {
      ColumnConfigAssociation association = (ColumnConfigAssociation) column.getAssociation();
View Full Code Here

  /**
   * <code>ColumnModel</code> in variable.
   */
  public void test_columns_parse_2() 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 = new ColumnConfig();",
            "        configs.add(column);",
            "      }",
            "      ColumnModel cm = new ColumnModel(configs);",
            "      Grid grid = new Grid(new ListStore(), cm);",
            "      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(), cm)/ /add(grid)/}",
        "    {new: com.extjs.gxt.ui.client.widget.grid.ColumnConfig} {local-unique: column} {/new ColumnConfig()/ /configs.add(column)/}");
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here

  /**
   * Two grids with <code>ColumnModel</code> in variable.
   */
  public void test_columns_parse_twoGrids() 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);",
            "      }",
            "      ColumnModel cm = new ColumnModel(configs);",
            "      Grid grid_1 = new Grid(new ListStore(), cm);",
            "      add(grid_1);",
            "    }",
            "    {",
            "      List<ColumnConfig> configs = new ArrayList<ColumnConfig>();",
            "      {",
            "        ColumnConfig column_2 = new ColumnConfig();",
            "        configs.add(column_2);",
            "      }",
            "      ColumnModel cm = new ColumnModel(configs);",
            "      Grid grid_2 = new Grid(new ListStore(), cm);",
            "      add(grid_2);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.google.gwt.user.client.ui.HorizontalPanel} {this} {/add(grid_1)/ /add(grid_2)/}",
        "  {new: com.extjs.gxt.ui.client.widget.grid.Grid} {local-unique: grid_1} {/new Grid(new ListStore(), cm)/ /add(grid_1)/}",
        "    {new: com.extjs.gxt.ui.client.widget.grid.ColumnConfig} {local-unique: column_1} {/new ColumnConfig()/ /configs.add(column_1)/}",
        "  {new: com.extjs.gxt.ui.client.widget.grid.Grid} {local-unique: grid_2} {/new Grid(new ListStore(), cm)/ /add(grid_2)/}",
        "    {new: com.extjs.gxt.ui.client.widget.grid.ColumnConfig} {local-unique: column_2} {/new ColumnConfig()/ /configs.add(column_2)/}");
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here

    panel.refresh();
    assertNoErrors(panel);
  }

  public void test_columns_parse_andRender() 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 = new ColumnConfig('id.1', 'First Column', 100);",
            "        configs.add(column);",
            "      }",
            "      {",
            "        ColumnConfig column = new ColumnConfig('id.2', 'Second Column', 200);",
            "        configs.add(column);",
            "      }",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(configs));",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    GridInfo grid = getJavaInfoByName("grid");
    List<?> columns =
        (List<?>) ScriptUtils.evaluate("getColumnModel().getColumns()", grid.getObject());
    assertThat(columns).hasSize(2);
    {
View Full Code Here

      assertEquals(200, ScriptUtils.evaluate("getWidth()", column));
    }
  }

  public void test_ColumnConfig_properties() 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 = new ColumnConfig();",
            "        configs.add(column);",
            "      }",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(configs));",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    //
    ColumnConfigInfo column = getJavaInfoByName("column");
    column.setWidth(200);
    assertEditor(
        "import java.util.List;",
View Full Code Here

   * {@link NullPointerException}.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.php?45078
   */
  public void test_ColumnConfig_setHidden() 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 = new ColumnConfig();",
            "        column.setHidden(true);",
            "        configs.add(column);",
            "      }",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(configs));",
            "      add(grid);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here

  //
  // Columns: operations
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_columns_DELETE() 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 = new ColumnConfig();",
            "        configs.add(column);",
            "      }",
            "      Grid grid = new Grid(new ListStore(), new ColumnModel(configs));",
            "      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(configs))/ /add(grid)/}",
        "    {new: com.extjs.gxt.ui.client.widget.grid.ColumnConfig} {local-unique: column} {/new ColumnConfig()/ /configs.add(column)/}");
    panel.refresh();
    GridInfo grid = getJavaInfoByName("grid");
    //
    List<ColumnConfigInfo> columns = grid.getColumns();
    assertThat(columns).hasSize(1);
    ColumnConfigInfo column = columns.get(0);
View Full Code Here

   * Test for {@link GridInfo#command_CREATE(ColumnConfigInfo, ColumnConfigInfo)}.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.asp?45668
   */
  public void test_columns_CREATE_nullColumnModel() 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(), (ColumnModel) null);",
            "      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_noColumnsList() 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);",
            "    }",
            "  }",
            "}");
    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

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.