Package com.google.gwt.user.client

Examples of com.google.gwt.user.client.Element


      // initially set display to none to avoid broken image
      if (helper.getElement(parent, name) == null) {
        style = (PictureStyle) style.clone();
        style.setDisplay("none");
      }
      final Element image = helper.createOrUpdateElement(parent, name, "img", style);
      DOM.setStyleAttribute(image, "position", "absolute");
      DOM.setStyleAttribute(image, "border", "0px");
      DOM.setStyleAttribute(image, "padding", "0px");
      DOM.setStyleAttribute(image, "margin", "0px");
      DOM.setStyleAttribute(image, "position", "absolute");
View Full Code Here


   * @param group
   *            The group object.
   */
  public void hide(Object group) {
    if (isAttached()) {
      Element element = helper.getGroup(group);
      if (element != null) {
        DOM.setStyleAttribute(element, "visibility", "hidden");
      }
    }
  }
View Full Code Here

   * @param group
   *            The group object.
   */
  public void unhide(Object group) {
    if (isAttached()) {
      Element element = helper.getGroup(group);
      if (element != null) {
        DOM.setStyleAttribute(element, "visibility", "inherit");
      }
    }
  }
View Full Code Here

   *            true if a unique id may be generated. If false, the name will be used as id and should therefore be
   *            unique
   * @return the created or updated element or null if creation failed or name was null
   */
  public Element createOrUpdateElement(Object parent, String name, String type, Style style, boolean generateId) {
    Element element;
    // check existence
    if (name != null) {
      if (!generateId) {
        element = DOM.getElementById(name);
      } else {
View Full Code Here

   * @param targetParent
   *            The target parent group for the element.
   * @return true when move was successful
   */
  public boolean moveElement(String name, Object sourceParent, Object targetParent) {
    Element sourceGroup = null;
    Element targetGroup = null;
    Element element = null;
    if (sourceParent != null) {
      sourceGroup = getGroup(sourceParent);
      element = getElement(sourceParent, name);
    }
    if (targetParent != null) {
      targetGroup = getGroup(targetParent);
    }
    if (sourceGroup == null || targetGroup == null) {
      return false;
    }
    if (DOM.isOrHasChild(sourceGroup, element)) {
      DOM.removeChild(sourceGroup, element);
      String newId = DOM.assembleId(targetGroup.getId(), name);
      elementToName.remove(element.getId());
      elementToName.put(newId, name);
      DOM.setElementAttribute(element, "id", newId);
      DOM.appendChild(targetGroup, element);
      return true;
    }
View Full Code Here

        return createHtmlGroup(parent, object, transformation, style);
    }
  }

  private Element createSvgGroup(Object parent, Object object, Matrix transformation, Style style) {
    Element group = null;
    // check existence
    if (object != null) {
      group = getGroup(object);
    }
    // create if necessary
View Full Code Here

    }
    return group;
  }

  private Element createVmlGroup(Object parent, Object object, Matrix transformation) {
    Element group = null;
    // check existence
    if (object != null) {
      group = getGroup(object);
    }
    // create if necessary
    if (group == null) {
      group = createGroup(DOM.NS_VML, parent, object, "group");
    }

    if (group != null) {
      // Get the parent element:
      Element parentElement;
      if (parent == null) {
        parentElement = getRootElement();
      } else {
        parentElement = getGroup(parent);
      }
View Full Code Here

    }
    return group;
  }

  private Element createHtmlGroup(Object parent, Object object, Matrix transformation, Style style) {
    Element group = null;
    // check existence
    if (object != null) {
      group = getGroup(object);
    }
    // create if necessary
View Full Code Here

   */
  public void setCursor(Object object, String cursor) {
    if (object == null) {
      DOM.setStyleAttribute(getRootElement(), "cursor", cursor);
    } else {
      Element element = getGroup(object);
      if (element != null) {
        DOM.setStyleAttribute(element, "cursor", cursor);
      }
    }
  }
View Full Code Here

   *            the name of the child element on which the cursor should be set
   * @param cursor
   *            The string representation of the cursor to use.
   */
  public void setCursor(Object parent, String name, String cursor) {
    Element element = getElement(parent, name);
    if (element != null) {
      DOM.setStyleAttribute(element, "cursor", cursor);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.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.