Package com.google.gdt.eclipse.designer.gxt.model.widgets

Examples of com.google.gdt.eclipse.designer.gxt.model.widgets.ComponentInfo


    }, false);
  }

  public boolean validateMove(Object object) {
    if (isValidObjectType(object)) {
      ComponentInfo item = (ComponentInfo) object;
      // don't move item on its child menu
      return !item.isParentOf(m_menu);
    }
    return false;
  }
View Full Code Here


  //
  // Operations
  //
  ////////////////////////////////////////////////////////////////////////////
  public void commandCreate(Object newObject, Object nextObject) throws Exception {
    ComponentInfo newItem;
    ComponentInfo nextItem = (ComponentInfo) nextObject;
    if (newObject instanceof MenuInfo) {
      newItem =
          (ComponentInfo) JavaInfoUtils.createJavaInfo(
              m_menu.getEditor(),
              "com.extjs.gxt.ui.client.widget.menu.MenuItem",
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<ComponentInfo> commandPaste(Object mementoObject, Object nextObject) throws Exception {
    List<ComponentInfo> pastedObjects = Lists.newArrayList();
    List<JavaInfoMemento> mementos = (List<JavaInfoMemento>) mementoObject;
    for (JavaInfoMemento memento : mementos) {
      ComponentInfo newItem = (ComponentInfo) memento.create(m_menu);
      commandCreate(newItem, nextObject);
      memento.apply();
      pastedObjects.add(newItem);
    }
    return pastedObjects;
View Full Code Here

    }
    return pastedObjects;
  }

  public void commandMove(Object object, Object nextObject) throws Exception {
    ComponentInfo item = (ComponentInfo) object;
    ComponentInfo nextItem = (ComponentInfo) nextObject;
    JavaInfoUtils.move(item, getNewItemAssociation(), m_menu, nextItem);
    // schedule selection
    MenuUtils.setSelectingItem(item);
  }
View Full Code Here

      return getDescription().getIcon();
    }

    public Rectangle getBounds() {
      // prepare information about parent
      ComponentInfo parentControl = (ComponentInfo) getParent();
      Insets parentInsets = parentControl.getClientAreaInsets();
      Rectangle parentArea = parentControl.getBounds().getCropped(parentInsets);
      // prepare size of "popup"
      int width;
      int height;
      {
        Image image = getImage();
View Full Code Here

            "      add(button);",
            "    }",
            "  }",
            "}");
    fieldSet.refresh();
    ComponentInfo button = getJavaInfoByName("button");
    //
    Insets insets = fieldSet.getClientAreaInsets();
    Rectangle buttonParentBounds = button.getBounds();
    Rectangle buttonModelBounds = button.getModelBounds();
    assertEquals(buttonParentBounds.x, buttonModelBounds.x + insets.left);
    assertEquals(buttonParentBounds.y, buttonModelBounds.y + insets.top);
  }
View Full Code Here

            "  }",
            "}");
    container.refresh();
    CenterLayoutInfo layout = (CenterLayoutInfo) container.getLayout();
    //
    ComponentInfo newButton = createButton();
    layout.command_CREATE(newButton, null);
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
        "    setLayout(new CenterLayout());",
View Full Code Here

    CenterLayoutInfo layout = (CenterLayoutInfo) container.getLayout();
    SimpleContainer simpleContainer = new SimpleContainerFactory(layout, true).get().get(0);
    // empty initially
    assertTrue(simpleContainer.isEmpty());
    // add new Button
    ComponentInfo newButton = createButton();
    assertTrue(simpleContainer.validateComponent(newButton));
    simpleContainer.command_CREATE(newButton);
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
View Full Code Here

    //
    MultiFieldInfo group = getJavaInfoByName("group");
    FlowContainer flowContainer = new FlowContainerFactory(group, true).get().get(0);
    // don't accept generic Component
    {
      ComponentInfo newComponent = createJavaInfo("com.extjs.gxt.ui.client.widget.button.Button");
      assertFalse(flowContainer.validateComponent(newComponent));
    }
    // accept Radio
    ComponentInfo newComponent = createJavaInfo("com.extjs.gxt.ui.client.widget.form.Radio");
    assertTrue(flowContainer.validateComponent(newComponent));
    flowContainer.command_CREATE(newComponent, null);
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
View Full Code Here

            "  }",
            "}");
    container.refresh();
    ColumnLayoutInfo layout = (ColumnLayoutInfo) container.getLayout();
    //
    ComponentInfo newButton = createButton();
    layout.command_CREATE(newButton, null);
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
        "    setLayout(new ColumnLayout());",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.gxt.model.widgets.ComponentInfo

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.