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

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


    // create GWT TextBox
    WidgetInfo newTextBox = createJavaInfo("com.google.gwt.user.client.ui.TextBox");
    canvas.command_absolute_CREATE(newTextBox, null);
    // check
    assertThat(canvas.getWidgets()).excludes(newTextBox);
    WidgetCanvasInfo widgetCanvas = canvas.getChildren(WidgetCanvasInfo.class).get(0);
    // check presentation
    {
      IObjectPresentation presentation = widgetCanvas.getPresentation();
      IObjectPresentation widgetPresentation = newTextBox.getPresentation();
      assertThat(presentation.getText().startsWith(widgetPresentation.getText())).isTrue();
      assertThat(presentation.getIcon()).isSameAs(widgetPresentation.getIcon());
    }
    assertThat(widgetCanvas.getWidget()).isSameAs(newTextBox);
    assertEditor(
        "import com.google.gwt.user.client.ui.TextBox;",
        "// filler filler filler",
        "public class Test extends Canvas {",
        "  public Test() {",
        "    {",
        "      WidgetCanvas widgetCanvas = new WidgetCanvas(new TextBox());",
        "      addChild(widgetCanvas);",
        "    }",
        "  }",
        "}");
    // check presentation
    IObjectPresentation presentation = widgetCanvas.getPresentation();
    assertThat(presentation.getChildrenGraphical()).excludes(newTextBox);
    assertThat(presentation.getChildrenTree()).excludes(newTextBox);
    // check properties
    {
      Property[] canvasProperties = widgetCanvas.getProperties();
      Property[] textProperties = newTextBox.getProperties();
      assertThat(canvasProperties).contains((Object[]) textProperties);
    }
    Property canvasProperty = widgetCanvas.getPropertyByTitle("Canvas");
    assertThat(canvasProperty).isInstanceOf(ComplexProperty.class);
  }
View Full Code Here

TOP

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

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.