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

Examples of com.google.gdt.eclipse.designer.smart.model.menu.ToolStripInfo


            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    // check ToolStrip
    ToolStripInfo toolStrip = canvas.getChildren(ToolStripInfo.class).get(0);
    assertThat(toolStrip.isHorizontal()).isFalse();
    // check children
    assertThat(toolStrip.getChildrenReal().size()).isEqualTo(4);
    assertThat(toolStrip.getCanvases().length).isEqualTo(4);
    List<AbstractComponentInfo> children = toolStrip.getChildren(AbstractComponentInfo.class);
    assertThat(children.size()).isEqualTo(5);
    // check bounds
    {
      // label
      AbstractComponentInfo label = children.get(0);
      assertThat(label).isInstanceOf(CanvasInfo.class);
      Integer x = Expectations.get(13, new IntValue[]{new IntValue("flanker-desktop", 12)});
      Integer y = Expectations.get(0, new IntValue[]{new IntValue("flanker-desktop", 1)});
      assertThat(label.getModelBounds()).isEqualTo(new Rectangle(x, y, 198, 100));
    }
    {
      // resizer
      AbstractComponentInfo resizer = children.get(1);
      assertThat(resizer).isInstanceOf(ToolStripResizerInfo.class);
      Integer y = Expectations.get(100, new IntValue[]{new IntValue("flanker-desktop", 101)});
      assertThat(resizer.getModelBounds()).isEqualTo(
          new Rectangle(0, y, toolStrip.getModelBounds().width, ToolStripResizerInfo.DEFAULT_SIZE));
    }
    {
      // text item
      AbstractComponentInfo text = children.get(2);
      assertThat(text).isInstanceOf(FormItemInfo.class);
View Full Code Here


            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    // check ToolStrip
    ToolStripInfo toolStrip = canvas.getChildren(ToolStripInfo.class).get(0);
    assertThat(toolStrip.isHorizontal()).isTrue();
    List<AbstractComponentInfo> children = toolStrip.getChildren(AbstractComponentInfo.class);
    assertThat(children.size()).isEqualTo(4);
    // check bounds
    {
      // label
      AbstractComponentInfo label = children.get(0);
      assertThat(label).isInstanceOf(CanvasInfo.class);
      Integer expected = Expectations.get(0, new IntValue[]{new IntValue("flanker-desktop", 1)});
      assertThat(label.getModelBounds()).isEqualTo(new Rectangle(expected, expected, 100, 198));
    }
    {
      // resizer
      AbstractComponentInfo resizer = children.get(1);
      assertThat(resizer).isInstanceOf(ToolStripResizerInfo.class);
      Integer expected = Expectations.get(100, new IntValue[]{new IntValue("flanker-desktop", 101)});
      assertThat(resizer.getModelBounds()).isEqualTo(
          new Rectangle(expected,
              0,
              ToolStripResizerInfo.DEFAULT_SIZE,
              toolStrip.getModelBounds().height));
    }
    {
      // button
      AbstractComponentInfo button = children.get(2);
      assertThat(button).isInstanceOf(CanvasInfo.class);
View Full Code Here

  /**
   * Add <code>com.smartgwt.client.widgets.toolbar.ToolStripButton</code>.
   */
  public void test_addButton() throws Exception {
    ToolStripInfo toolStrip = createDefaultModule();
    // create new MenuButton
    AbstractComponentInfo newButton =
        createJavaInfo("com.smartgwt.client.widgets.toolbar.ToolStripButton");
    {
      FlowContainer flowContainer = new FlowContainerFactory(toolStrip, false).get().get(0);
      assertTrue(flowContainer.validateComponent(newButton));
      flowContainer.command_CREATE(newButton, toolStrip.getChildrenReal().get(1));
    }
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    Canvas canvas = new Canvas();",
View Full Code Here

  /**
   * Add <code>com.smartgwt.client.widgets.toolbar.ToolStripMenuButton</code>.
   */
  public void test_addMenuButton() throws Exception {
    ToolStripInfo toolStrip = createDefaultModule();
    // create new MenuButton
    AbstractComponentInfo newMenuButton =
        createJavaInfo("com.smartgwt.client.widgets.toolbar.ToolStripMenuButton");
    {
      FlowContainer flowContainer = new FlowContainerFactory(toolStrip, false).get().get(1);
      assertTrue(flowContainer.validateComponent(newMenuButton));
      flowContainer.command_CREATE(newMenuButton, toolStrip.getChildrenReal().get(1));
    }
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    Canvas canvas = new Canvas();",
View Full Code Here

  /**
   * Add <code>com.smartgwt.client.widgets.Canvas</code>.
   */
  public void test_addCanvas() throws Exception {
    ToolStripInfo toolStrip = createDefaultModule();
    // create new Slider
    AbstractComponentInfo newCanvas = createJavaInfo("com.smartgwt.client.widgets.Slider");
    {
      FlowContainer flowContainer = new FlowContainerFactory(toolStrip, false).get().get(2);
      assertTrue(flowContainer.validateComponent(newCanvas));
      flowContainer.command_CREATE(newCanvas, toolStrip.getChildrenReal().get(1));
    }
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    Canvas canvas = new Canvas();",
View Full Code Here

  /**
   * Add <code>com.smartgwt.client.widgets.form.fields.FormItem</code>.
   */
  public void test_addFormItem() throws Exception {
    ToolStripInfo toolStrip = createDefaultModule();
    // create new TextItem
    AbstractComponentInfo newFormItem =
        createJavaInfo("com.smartgwt.client.widgets.form.fields.TextItem");
    {
      FlowContainer flowContainer = new FlowContainerFactory(toolStrip, false).get().get(3);
      assertTrue(flowContainer.validateComponent(newFormItem));
      flowContainer.command_CREATE(newFormItem, toolStrip.getChildrenReal().get(1));
    }
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    Canvas canvas = new Canvas();",
View Full Code Here

  /**
   * Add <code>com.smartgwt.client.widgets.toolbar.ToolStripSpacer</code>.
   */
  public void test_addSpacer() throws Exception {
    ToolStripInfo toolStrip = createDefaultModule();
    // create new Spacer
    AbstractComponentInfo newSpacer =
        createJavaInfo("com.smartgwt.client.widgets.toolbar.ToolStripSpacer");
    {
      FlowContainer flowContainer = new FlowContainerFactory(toolStrip, false).get().get(4);
      assertTrue(flowContainer.validateComponent(newSpacer));
      flowContainer.command_CREATE(newSpacer, toolStrip.getChildrenReal().get(1));
    }
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    Canvas canvas = new Canvas();",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.smart.model.menu.ToolStripInfo

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.