Package org.eclipse.wb.core.model

Examples of org.eclipse.wb.core.model.AbstractComponentInfo


    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);
      Integer width = Expectations.get(225, new IntValue[]{new IntValue("flanker-desktop", 221)});
      assertThat(text.getModelBounds()).isEqualTo(new Rectangle(-3, 111, width, 22));
    }
    {
      // button
      AbstractComponentInfo button = children.get(3);
      assertThat(button).isInstanceOf(CanvasInfo.class);
      Integer x = Expectations.get(77, new IntValue[]{new IntValue("flanker-desktop", 76)});
      Integer y = Expectations.get(136, new IntValue[]{new IntValue("flanker-desktop", 137)});
      Integer width = Expectations.get(71, new IntValue[]{new IntValue("flanker-desktop", 70)});
      assertThat(button.getModelBounds()).isEqualTo(
          new Rectangle(x, y, width, CanvasTest.BUTTON_HEIGHT));
    }
    {
      // fill
      AbstractComponentInfo fill = children.get(4);
      assertThat(fill).isInstanceOf(ToolStripCanvasInfo.class);
      Integer x = Expectations.get(14, new IntValue[]{new IntValue("flanker-desktop", 12)});
      assertThat(fill.getModelBounds()).isEqualTo(new Rectangle(x, 159, 198, 40));
    }
  }
View Full Code Here


    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);
      Integer x = Expectations.get(114, new IntValue[]{new IntValue("flanker-desktop", 115)});
      Integer y = Expectations.get(88, new IntValue[]{new IntValue("flanker-desktop", 89)});
      Integer width = Expectations.get(71, new IntValue[]{new IntValue("flanker-desktop", 70)});
      assertThat(button.getModelBounds()).isEqualTo(
          new Rectangle(x, y, width, CanvasTest.BUTTON_HEIGHT));
    }
    {
      // fill
      AbstractComponentInfo fill = children.get(3);
      assertThat(fill).isInstanceOf(ToolStripCanvasInfo.class);
      Integer x = Expectations.get(186, new IntValue[]{new IntValue("flanker-desktop", 185)});
      Integer width = Expectations.get(13, new IntValue[]{new IntValue("flanker-desktop", 14)});
      assertThat(fill.getModelBounds()).isEqualTo(new Rectangle(x, 1, width, 198));
    }
  }
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));
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));
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));
    }
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));
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));
View Full Code Here

  /**
   * Calculate bounds for {@link ToolStripResizerInfo}s.
   */
  private void calculate_resizers_bounds() throws Exception {
    Rectangle modelBounds = getModelBounds();
    AbstractComponentInfo priorChild = null;
    for (AbstractComponentInfo childInfo : getChildren(AbstractComponentInfo.class)) {
      if (childInfo instanceof ToolStripResizerInfo) {
        if (priorChild == null) {
          continue;
        }
        // calculate
        Rectangle priorBounds = priorChild.getModelBounds();
        if (isHorizontal()) {
          childInfo.setModelBounds(new Rectangle(priorBounds.x + priorBounds.width,
              0,
              ToolStripResizerInfo.DEFAULT_SIZE,
              modelBounds.height));
View Full Code Here

TOP

Related Classes of org.eclipse.wb.core.model.AbstractComponentInfo

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.