Package com.google.gdt.eclipse.designer.smart.model

Examples of com.google.gdt.eclipse.designer.smart.model.CanvasInfo


  /**
   * {@link DataSourceFieldInfo} added before {@link DataSourceInfo} association.
   */
  public void test_addField() throws Exception {
    CanvasInfo calendar =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Calendar calendar = new Calendar();",
            "    DataSource dataSource = new DataSource();",
            "    calendar.setDataSource(dataSource);",
            "    calendar.draw();",
            "  }",
            "}"});
    calendar.refresh();
    //
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(calendar).getChildren(DataSourceInfo.class).get(0);
    // create new DataSourceField
    DataSourceFieldInfo dataSourceField =
View Full Code Here


        "  }",
        "}");
  }

  public void test_addField_pseudo() throws Exception {
    CanvasInfo canvas =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Canvas canvas = new Canvas();",
            "    DataSource dataSource = new DataSource();",
            "    FilterBuilder filterBuilder = new FilterBuilder();",
            "    filterBuilder.setDataSource(dataSource);",
            "    canvas.addChild(filterBuilder);",
            "    Calendar calendar = new Calendar();",
            "    calendar.setDataSource(dataSource);",
            "    canvas.addChild(calendar);",
            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    //
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(canvas).getChildren(DataSourceInfo.class).get(0);
    assertThat(canvas.getChildren(FilterBuilderInfo.class).size()).isEqualTo(1);
    assertThat(canvas.getChildren(CalendarInfo.class).size()).isEqualTo(1);
    // create new DataSourceField
    DataSourceFieldInfo dataSourceField =
        createJavaInfo("com.smartgwt.client.data.fields.DataSourceBooleanField");
    {
      FlowContainer flowContainer = new FlowContainerFactory(dataSource, false).get().get(0);
View Full Code Here

  //
  // Tests DataSource_Info#calculateStatementTarget(JavaInfo, Property, List<ASTNode>)
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_assignmentTarget_1() throws Exception {
    CanvasInfo calendar =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Calendar calendar = new Calendar();",
            "    DataSource dataSource = new DataSource();",
            "    dataSource.setID('testDS');",
            "    calendar.draw();",
            "  }",
            "}"});
    calendar.refresh();
    //
    GenericProperty property = (GenericProperty) calendar.getPropertyByTitle("dataSource");
    ObjectPropertyEditor editor = (ObjectPropertyEditor) property.getEditor();
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(calendar).getChildren(DataSourceInfo.class).get(0);
    // check special target
    assertNull(dataSource.calculateStatementTarget(calendar));
View Full Code Here

        "  }",
        "}");
  }

  public void test_assignmentTarget_2() throws Exception {
    CanvasInfo calendar =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    DataSource dataSource = new DataSource();",
            "    dataSource.setID('testDS');",
            "    Calendar calendar = new Calendar();",
            "    calendar.draw();",
            "  }",
            "}"});
    calendar.refresh();
    //
    GenericProperty property = (GenericProperty) calendar.getPropertyByTitle("dataSource");
    ObjectPropertyEditor editor = (ObjectPropertyEditor) property.getEditor();
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(calendar).getChildren(DataSourceInfo.class).get(0);
    // check special target
    StatementTarget target = dataSource.calculateStatementTarget(calendar);
View Full Code Here

        "  }",
        "}");
  }

  public void test_assignmentTarget_field_1() throws Exception {
    CanvasInfo calendar =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "/**",
            "  *@wbp.nonvisual location=0,0",
            "  */",
            "  private DataSource dataSource = new DataSource();",
            "  public void onModuleLoad() {",
            "    Calendar calendar = new Calendar();",
            "    calendar.draw();",
            "  }",
            "}"});
    calendar.refresh();
    //
    GenericProperty property = (GenericProperty) calendar.getPropertyByTitle("dataSource");
    ObjectPropertyEditor editor = (ObjectPropertyEditor) property.getEditor();
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(calendar).getChildren(DataSourceInfo.class).get(0);
    // check special target
    assertNull(dataSource.calculateStatementTarget(calendar));
View Full Code Here

        "  }",
        "}");
  }

  public void test_assignmentTarget_field_2() throws Exception {
    CanvasInfo calendar =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "/**",
            "  *@wbp.nonvisual location=0,0",
            "  */",
            "  private DataSource dataSource = new DataSource();",
            "  private Calendar calendar = new Calendar();",
            "  public void onModuleLoad() {",
            "    calendar.draw();",
            "  }",
            "}"});
    calendar.refresh();
    GenericProperty property = (GenericProperty) calendar.getPropertyByTitle("dataSource");
    ObjectPropertyEditor editor = (ObjectPropertyEditor) property.getEditor();
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(calendar).getChildren(DataSourceInfo.class).get(0);
    // check special target
    assertNull(dataSource.calculateStatementTarget(calendar));
View Full Code Here

        "  }",
        "}");
  }

  public void test_assignmentTarget_field_3() throws Exception {
    CanvasInfo calendar =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "/**",
            "  *@wbp.nonvisual location=0,0",
            "  */",
            "  private DataSource dataSource = new DataSource();",
            "  private Calendar calendar = new Calendar();",
            "  public void onModuleLoad() {",
            "    dataSource.setID('testDS');",
            "    calendar.draw();",
            "  }",
            "}"});
    calendar.refresh();
    GenericProperty property = (GenericProperty) calendar.getPropertyByTitle("dataSource");
    ObjectPropertyEditor editor = (ObjectPropertyEditor) property.getEditor();
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(calendar).getChildren(DataSourceInfo.class).get(0);
    // check special target
    StatementTarget target = dataSource.calculateStatementTarget(calendar);
View Full Code Here

        "  }",
        "}");
  }

  public void test_assignmentTarget_lazy_1() throws Exception {
    CanvasInfo calendar =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  private DataSource dataSource;",
            "  public void onModuleLoad() {",
            "    Calendar calendar = new Calendar();",
            "    calendar.draw();",
            "  }",
            "/**",
            "*@wbp.nonvisual location=0,0",
            "*/",
            "  private DataSource getDataSource() {",
            "    if (dataSource == null) {",
            "      dataSource = new DataSource();",
            "      dataSource.setID('testDS');",
            "    }",
            "    return dataSource;",
            "  }",
            "}"});
    calendar.refresh();
    GenericProperty property = (GenericProperty) calendar.getPropertyByTitle("dataSource");
    ObjectPropertyEditor editor = (ObjectPropertyEditor) property.getEditor();
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(calendar).getChildren(DataSourceInfo.class).get(0);
    // check special target
    assertNull(dataSource.calculateStatementTarget(calendar));
View Full Code Here

        "  }",
        "}");
  }

  public void test_assignmentTarget_lazy_2() throws Exception {
    CanvasInfo calendar =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  private DataSource dataSource;",
            "  private Calendar calendar = new Calendar();",
            "  public void onModuleLoad() {",
            "    calendar.draw();",
            "  }",
            "/**",
            "*@wbp.nonvisual location=0,0",
            "*/",
            "  private DataSource getDataSource() {",
            "    if (dataSource == null) {",
            "      dataSource = new DataSource();",
            "      dataSource.setID('testDS');",
            "    }",
            "    return dataSource;",
            "  }",
            "}"});
    calendar.refresh();
    GenericProperty property = (GenericProperty) calendar.getPropertyByTitle("dataSource");
    ObjectPropertyEditor editor = (ObjectPropertyEditor) property.getEditor();
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(calendar).getChildren(DataSourceInfo.class).get(0);
    // check special target
    assertNull(dataSource.calculateStatementTarget(calendar));
View Full Code Here

        "  }",
        "}");
  }

  public void test_assignmentTarget_lazy_3() throws Exception {
    CanvasInfo calendar =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  private DataSource dataSource;",
            "  private Calendar calendar = new Calendar();",
            "  public void onModuleLoad() {",
            "    getDataSource().setDataURL('url');",
            "    calendar.draw();",
            "  }",
            "/**",
            "*@wbp.nonvisual location=0,0",
            "*/",
            "  private DataSource getDataSource() {",
            "    if (dataSource == null) {",
            "      dataSource = new DataSource();",
            "      dataSource.setID('testDS');",
            "    }",
            "    return dataSource;",
            "  }",
            "}"});
    calendar.refresh();
    GenericProperty property = (GenericProperty) calendar.getPropertyByTitle("dataSource");
    ObjectPropertyEditor editor = (ObjectPropertyEditor) property.getEditor();
    DataSourceInfo dataSource =
        NonVisualBeanContainerInfo.get(calendar).getChildren(DataSourceInfo.class).get(0);
    // check special target
    StatementTarget target = dataSource.calculateStatementTarget(calendar);
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.smart.model.CanvasInfo

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.