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

Examples of com.google.gdt.eclipse.designer.gwtext.model.widgets.ContainerInfo


      }
    });
    // when association of container is going to be executed during "parse"
    addBroadcastListener(new JavaInfoSetAssociationBefore() {
      public void invoke(JavaInfo javaInfo, Association association) throws Exception {
        ContainerInfo container = getContainer();
        if (isActive() && GlobalState.isParsing() && javaInfo == container) {
          ensureCenterWidget();
        }
      }
    });
View Full Code Here


   * Adds listeners to the {@link BroadcastSupport}.
   */
  private void addBroadcastListeners() {
    addBroadcastListener(new ObjectInfoTreeComplete() {
      public void invoke() throws Exception {
        ContainerInfo container = getContainer();
        // ensure that all widgets have LayoutData, at least virtual
        if (isActiveOnContainer(container)) {
          for (WidgetInfo widget : container.getChildrenWidgets()) {
            ensureLayoutData(widget);
          }
        }
      }
    });
    addBroadcastListener(new ObjectInfoChildAddBefore() {
      public void invoke(ObjectInfo parent, ObjectInfo child, ObjectInfo[] nextChild)
          throws Exception {
        // add new LayoutData - remove existing one
        if (parent instanceof WidgetInfo
            && child instanceof LayoutDataInfo
            && isActiveOnContainer(parent.getParent())) {
          WidgetInfo widget = (WidgetInfo) parent;
          LayoutDataInfo existingLayoutData = getLayoutData(widget);
          if (existingLayoutData != null) {
            widget.removeChild(existingLayoutData);
          }
        }
      }
    });
    addBroadcastListener(new ObjectInfoChildAddAfter() {
      public void invoke(ObjectInfo parent, ObjectInfo child) throws Exception {
        ContainerInfo container = getContainer();
        // add this layout
        if (child == m_this) {
          // implicit layouts are bound to its parent
          if (getCreationSupport() instanceof IImplicitCreationSupport) {
            targetBroadcastListener(parent);
          }
          // create virtual LayoutData's
          for (WidgetInfo widget : container.getChildrenWidgets()) {
            ensureLayoutData(widget);
          }
        }
      }
    });
View Full Code Here

   * @return <code>true</code> if this {@link LayoutInfo} is active on its {@link ContainerInfo}.
   *         For example implicit {@link LayoutInfo}'s replaced by "real" {@link LayoutInfo} are
   *         inactive.
   */
  public final boolean isActive() {
    ContainerInfo container = getContainer();
    return isActiveOnContainer(container);
  }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Adds new {@link WidgetInfo} using <code>Container.add(Widget,LayoutData)</code>.
   */
  public void command_CREATE(WidgetInfo component, WidgetInfo nextComponent) throws Exception {
    ContainerInfo container = getContainer();
    AssociationObject association = getAssociation_();
    JavaInfoUtils.add(component, association, container, nextComponent);
  }
View Full Code Here

  /**
   * Moves {@link WidgetInfo} in/to this container using
   * <code>Container.add(Widget,LayoutData)</code>.
   */
  public void command_MOVE(WidgetInfo component, WidgetInfo nextComponent) throws Exception {
    ContainerInfo container = getContainer();
    AssociationObject association = getAssociation_();
    JavaInfoUtils.move(component, association, container, nextComponent);
  }
View Full Code Here

  // IEditPartConfigurator
  //
  ////////////////////////////////////////////////////////////////////////////
  public void configure(EditPart context, EditPart editPart) {
    if (editPart.getModel() instanceof ContainerInfo) {
      ContainerInfo container = (ContainerInfo) editPart.getModel();
      if (container.hasLayout()) {
        new LayoutTracker(container, editPart);
      }
    }
  }
View Full Code Here

   *          the {@link Point} of new location of widget. May be <code>null</code>.
   * @param size
   *          the {@link Dimension} of new size of widget. May be <code>null</code>.
   */
  public void command_BOUNDS(WidgetInfo widget, Point location, Dimension size) throws Exception {
    ContainerInfo container = getContainer();
    Assert.isTrue(container.getChildren().contains(widget), "%s is not child of %s.", widget, this);
    if (location != null) {
      AbsoluteLayoutDataInfo absoluteData = getAbsoluteData(widget);
      absoluteData.materialize();
      absoluteData.getPropertyByTitle("x").setValue(location.x);
      absoluteData.getPropertyByTitle("y").setValue(location.y);
    }
    if (size != null) {
      widget.getSizeSupport().setSize(size);
    }
    // check creation flow
    if (location != null && useCreationFlow()) {
      // force set new translated bounds
      Insets insets = container.getClientAreaInsets();
      Point location_ = location.getCopy();
      location_.translate(insets);
      AbsoluteLayoutCreationFlowSupport.checkBounds(widget, location_, size);
      // apply creation flow
      AbsoluteLayoutCreationFlowSupport.apply(
          container,
          container.getChildrenWidgets(),
          widget,
          location,
          size);
    }
  }
View Full Code Here

  public int getContainerGapValue(IAbstractComponentInfo component, int direction) {
    return AbsolutePolicyUtils.DEFAULT_CONTAINER_GAP;
  }

  public Dimension getContainerSize() {
    ContainerInfo container = m_layout.getContainer();
    Dimension size = container.getModelBounds().getSize();
    Insets insets = container.getClientAreaInsets();
    return new Dimension(size.width - insets.getWidth(), size.height - insets.getHeight());
  }
View Full Code Here

    //
    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(container)/}",
        "  {new: com.gwtext.client.widgets.Panel} {local-unique: container} {/new Panel()/ /rootPanel.add(container)/}",
        "    {implicit-layout: default} {implicit-layout} {}");
    ContainerInfo container = (ContainerInfo) frame.getChildrenWidgets().get(0);
    assertTrue(container.hasLayout());
  }
View Full Code Here

  /**
   * Test for {@link ContainerInfo#getLayout()}.
   */
  public void test_getLayoutException() throws Exception {
    ContainerInfo frame =
        parseJavaInfo(
            "import com.gwtext.client.widgets.Panel;",
            "public class Test extends Panel {",
            "  public Test() {",
            "  }",
            "}");
    // remove Layout (using ObjectInfo, to prevent implicit layout creation)
    frame.removeChild(frame.getLayout());
    try {
      frame.getLayout();
      fail();
    } catch (IllegalStateException e) {
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.gwtext.model.widgets.ContainerInfo

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.