Examples of IObjectPresentation


Examples of org.eclipse.wb.internal.core.model.presentation.IObjectPresentation

    shell.refresh();
    assertThat(shell.getChildrenWidgets()).hasSize(2);
    WidgetInfo button = shell.getChildrenWidgets().get(0);
    WidgetInfo filler = shell.getChildrenWidgets().get(1);
    //
    IObjectPresentation presentation = shell.getPresentation();
    {
      List<ObjectInfo> presentationChildren = presentation.getChildrenTree();
      assertTrue(presentationChildren.contains(button));
      assertFalse(presentationChildren.contains(filler));
    }
    {
      List<ObjectInfo> presentationChildren = presentation.getChildrenGraphical();
      assertTrue(presentationChildren.contains(button));
      assertFalse(presentationChildren.contains(filler));
    }
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.presentation.IObjectPresentation

      assertEquals(
          "{com.google.gdt.eclipse.designer.model.widgets.ImageBundleContainerInfo}",
          container.toString());
      // presentation
      {
        IObjectPresentation presentation = container.getPresentation();
        assertEquals("(ImageBundle's)", presentation.getText());
        assertNotNull(presentation.getIcon());
      }
      // bundles
      {
        List<ImageBundleInfo> bundles = ImageBundleContainerInfo.getBundles(frame);
        assertThat(bundles).hasSize(1);
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.presentation.IObjectPresentation

    // 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);
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.presentation.IObjectPresentation

      Position position = (Position) containerChildren.get(0);
      assertEquals(
          "com.google.gwt.user.client.ui.Widget",
          position.getWidgetClass().getCanonicalName());
      // presentation
      IObjectPresentation presentation = position.getPresentation();
      assertEquals("bottomWidget", presentation.getText());
      assertNotNull(presentation.getIcon());
      // tree children
      List<ObjectInfo> positionChildren = position.getPresentation().getChildrenTree();
      assertThat(positionChildren).containsExactly(textBox);
    }
    // "top" position
    {
      Position position = (Position) containerChildren.get(1);
      assertEquals(
          "com.google.gwt.user.client.ui.Button",
          position.getWidgetClass().getCanonicalName());
      // presentation
      IObjectPresentation presentation = position.getPresentation();
      assertEquals("topbutton", presentation.getText());
      assertNotNull(presentation.getIcon());
      // tree children
      List<ObjectInfo> positionChildren = position.getPresentation().getChildrenTree();
      assertThat(positionChildren).containsExactly(button_1, button_2);
    }
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.presentation.IObjectPresentation

    //
    LayoutInfo layout = container.getLayout();
    assertInstanceOf(DefaultLayoutInfo.class, layout);
    // layouts are not displayed in tree
    {
      IObjectPresentation presentation = layout.getPresentation();
      assertFalse(presentation.isVisible());
    }
    // "default" layout has no LayoutData
    try {
      ReflectionUtils.invokeMethod(
          layout,
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.presentation.IObjectPresentation

    shell.refresh();
    assertThat(shell.getWidgets()).hasSize(2);
    WidgetInfo button = shell.getWidgets().get(0);
    WidgetInfo filler = shell.getWidgets().get(1);
    //
    IObjectPresentation presentation = shell.getPresentation();
    {
      List<ObjectInfo> presentationChildren = presentation.getChildrenTree();
      assertTrue(presentationChildren.contains(button));
      assertFalse(presentationChildren.contains(filler));
    }
    {
      List<ObjectInfo> presentationChildren = presentation.getChildrenGraphical();
      assertTrue(presentationChildren.contains(button));
      assertFalse(presentationChildren.contains(filler));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.