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

Examples of com.google.gdt.eclipse.designer.smart.model.form.FormItemInfo


        "  public Test() {",
        "  }",
        "}");
    form.refresh();
    // create field
    FormItemInfo newField = createJavaInfo("com.smartgwt.client.widgets.form.fields.TextItem");
    form.command_CREATE(newField, null);
    //
    assertEditor(
        "public class Test extends DynamicForm {",
        "  public Test() {",
View Full Code Here


            "  }",
            "}");
    form.refresh();
    //
    List<FormItemInfo> fields = form.getItems();
    FormItemInfo textField = fields.get(0);
    FormItemInfo dateField = fields.get(1);
    // move field
    form.command_MOVE(dateField, textField);
    //
    assertEditor(
        "public class Test extends DynamicForm {",
View Full Code Here

        "    setFields(new FormItem[] { new TextItem('newTextItem')});",
        "  }",
        "}");
    form.refresh();
    // set location
    FormItemInfo formItem = form.getItems().get(0);
    Point location = new Point(30, 20);
    form.command_BOUNDS(formItem, location, null);
    form.refresh();
    assertThat(formItem.getBounds().getLocation()).isEqualTo(location);
    assertEditor(
        "public class Test extends DynamicForm {",
        "  public Test() {",
        "    setItemLayout(FormLayoutType.ABSOLUTE);",
        "    TextItem textItem = new TextItem('newTextItem');",
        "    textItem.setLeft(30);",
        "    textItem.setTop(20);",
        "    setFields(new FormItem[] { textItem});",
        "  }",
        "}");
    // set size
    form.command_BOUNDS(formItem, null, new Dimension(60, 50));
    form.refresh();
    assertThat(formItem.getBounds().getSize()).isEqualTo(new Dimension(60, 50));
    assertEditor(
        "public class Test extends DynamicForm {",
        "  public Test() {",
        "    setItemLayout(FormLayoutType.ABSOLUTE);",
        "    TextItem textItem = new TextItem('newTextItem');",
        "    textItem.setWidth(60);",
        "    textItem.setHeight(50);",
        "    textItem.setLeft(30);",
        "    textItem.setTop(20);",
        "    setFields(new FormItem[] { textItem});",
        "  }",
        "}");
    // change location
    form.command_BOUNDS(formItem, new Point(10, 10), null);
    form.refresh();
    assertThat(formItem.getBounds().getLocation()).isEqualTo(new Point(10, 10));
    assertEditor(
        "public class Test extends DynamicForm {",
        "  public Test() {",
        "    setItemLayout(FormLayoutType.ABSOLUTE);",
        "    TextItem textItem = new TextItem('newTextItem');",
View Full Code Here

          }
        }
      });
    }
    // prepare component
    FormItemInfo formItem = createClone();
    // add component on Canvas
    parentCanvas.command_CREATE(formItem, null);
    // remove "live" mark from RootPanel,
    // because only one instance of RootPanel exists, so we update it also for "main" hierarchy
    panel.getPropertyByTitle("title").setValue(null);
View Full Code Here

  @Override
  protected void cleanupLiveComponent(AbstractComponentInfo liveComponentInfo) throws Exception {
    super.cleanupLiveComponent(liveComponentInfo);
    // reset "live" state of UIObjectManipulations
    {
      FormItemInfo formItem = (FormItemInfo) liveComponentInfo;
      DynamicFormInfo form = formItem.getForm();
      if (form != null) {
        m_utils.setLiveWidget(null);
      }
    }
    m_utils.setLiveManager(false);
View Full Code Here

    m_utils.setLiveManager(false);
  }

  @Override
  protected ILiveCacheEntry createComponentCacheEntry(AbstractComponentInfo component) {
    FormItemInfo formItem = (FormItemInfo) component;
    // do create cache entry
    GwtLiveCacheEntry entry = new GwtLiveCacheEntry();
    entry.setImage(getWidgetImage(formItem));
    entry.shouldSetSize(false);
    return entry;
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected Command getCreateCommand(CreateRequest request) {
    Object newObject = request.getNewObject();
    if (newObject instanceof FormItemInfo) {
      final FormItemInfo item = (FormItemInfo) newObject;
      return new EditCommand(m_form) {
        @Override
        protected void executeEdit() throws Exception {
          placementsSupport.commitAdd();
          Rectangle widgetModelBounds = item.getModelBounds();
          m_form.command_CREATE(item, null);
          m_form.command_BOUNDS(item, widgetModelBounds.getLocation(), widgetModelBounds.getSize());
        }
      };
    }
View Full Code Here

  @Override
  protected void doPasteComponent(Point pasteLocation, PastedComponentInfo pastedWidget)
      throws Exception {
    IAbstractComponentInfo component = pastedWidget.getComponent();
    if (component instanceof FormItemInfo) {
      FormItemInfo item = (FormItemInfo) component;
      // create
      m_form.command_CREATE(item, null);
      Rectangle widgetBounds = pastedWidget.getBounds();
      m_form.command_BOUNDS(
          item,
View Full Code Here

            "    form.draw();",
            "  }",
            "}");
    form.refresh();
    //
    FormItemInfo formItem = form.getItems().get(0);
    Integer width = Expectations.get(150, new IntValue[]{new IntValue("flanker-desktop", 146)});
    assertThat(formItem.getModelBounds()).isEqualTo(new Rectangle(28, 0, width, 22));
  }
View Full Code Here

            "    setFields(new FormItem[] { field });",
            "  }",
            "}");
    form.refresh();
    //
    FormItemInfo formItem = form.getItems().get(0);
    Integer left = Expectations.get(28, new IntValue[]{new IntValue("flanker-desktop", 100)});
    Integer width = Expectations.get(150, new IntValue[]{new IntValue("flanker-desktop", 146)});
    assertThat(formItem.getModelBounds()).isEqualTo(new Rectangle(left, 0, width, 22));
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.smart.model.form.FormItemInfo

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.