Package elemental.html

Examples of elemental.html.Element


   * Returns the tree node whose element is or contains the given element, or
   * null if the given element cannot be matched to a tree node.
   */
  public TreeNodeElement<D> getNodeFromElement(Element element) {
    Css css = getModel().resources.treeCss();
    Element treeNodeBody = CssUtils.getAncestorOrSelfWithClassName(element, css.treeNodeBody());
    return treeNodeBody != null ? getView().getTreeNodeFromTreeNodeBody(treeNodeBody, css) : null;
  }
View Full Code Here


    }

    /** Appends the element to the body of the DOM */
    @Override
    void appendElementToContainer(Element element) {
      Element gwt = Elements.getElementById(AppContext.GWT_ROOT);
      gwt.appendChild(element);
    }
View Full Code Here

      gwt.appendChild(element);
    }

    @Override
    double getTop(ClientRect elementRect, int offsetY) {
      Element gwt = Elements.getElementById(AppContext.GWT_ROOT);
      ClientRect anchorRect = RelativeClientRect.relativeToRect(
          gwt.getBoundingClientRect(), anchor.getBoundingClientRect());

      switch (getVerticalAlignment()) {
        case TOP:
          return anchorRect.getTop() - elementRect.getHeight() - offsetY;
        case MIDDLE:
View Full Code Here

      }
    }

    @Override
    double getLeft(ClientRect elementRect, int offsetX) {
      Element gwt = Elements.getElementById(AppContext.GWT_ROOT);
      ClientRect anchorRect = RelativeClientRect.relativeToRect(
          gwt.getBoundingClientRect(), anchor.getBoundingClientRect());

      switch (getHorizontalAlignment()) {
        case LEFT:
          if (getPosition() == Position.OVERLAP) {
            return anchorRect.getLeft() + offsetX;
View Full Code Here

    }

    /** Appends the element to the specified ancestor of the anchor. */
    @Override
    void appendElementToContainer(Element element) {
      Element container = getOffsetAnchestorForAnchor();
      container.appendChild(element);
    }
View Full Code Here

          return 0;
      }
    }

    private Element getOffsetAnchestorForAnchor() {
      Element e = offsetAncestor == ANCHOR_OFFSET_PARENT ? anchor.getOffsetParent()
          : offsetAncestor;
      return e == null ? Elements.getBody() : e;
    }
View Full Code Here

    private void ensureOffsetCalculated() {
      if (anchorOffsetTop >= 0 && anchorOffsetLeft >= 0) {
        return;
      }

      Element ancestor = getOffsetAnchestorForAnchor();
      anchorOffsetTop = anchorOffsetLeft = 0;
      for (Element e = anchor; e != ancestor; e = e.getOffsetParent()) {
        Preconditions.checkNotNull(e, "Offset parent specified is not in ancestory chain");
        anchorOffsetTop += e.getOffsetTop();
        anchorOffsetLeft += e.getOffsetLeft();
View Full Code Here

    this.renderer = renderer;
    this.positionController = positionController;
  }

  public void show() {
    Element element = getView().getElement();
    if (!hasRendered) {
      renderer.render(getView().getContainer(), this);
      hasRendered = true;
    }
View Full Code Here

    updatePosition();
    CssUtils.setDisplayVisibility2(element, true);
  }

  public void hide() {
    Element element = getView().getElement();
    CssUtils.setDisplayVisibility2(element, false);
  }
View Full Code Here

    updateArrow(getXOffset(positioner.getHorizontalAlignment()), y);
    positionController.updateElementPosition(x, y);
  }

  private void updateArrow(int x, int y) {
    Element arrow = getView().getArrow();
    CSSStyleDeclaration style = arrow.getStyle();

    HorizontalAlign alignment = positionController.getPositioner().getHorizontalAlignment();
    style.setLeft("auto");
    style.setRight("auto");
    if (alignment == HorizontalAlign.LEFT) {
View Full Code Here

TOP

Related Classes of elemental.html.Element

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.