Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.Node


    public static ArrayList<Element> getElements(Element scrolledElement2) {
        NodeList<Node> childNodes = scrolledElement2.getChildNodes();
        ArrayList<Element> l = new ArrayList<Element>();
        for (int i = 0; i < childNodes.getLength(); i++) {
            Node item = childNodes.getItem(i);
            if (item.getNodeType() == Node.ELEMENT_NODE) {
                l.add((Element) item);
            }
        }
        return l;
    }
View Full Code Here


            for (Widget widget : getChildren()) {
                orphan(widget);
            }

            while (getElement().getChildCount() > 0) {
                Node el = getElement().getChild(0);
                expandWrapper.appendChild(el);
            }
            getElement().appendChild(expandWrapper);

            // Attach all widgets again
View Full Code Here

                getWidget().addStyleName(VEmbedded.CLASSNAME + "-image");
                Element el = null;
                boolean created = false;
                NodeList<Node> nodes = getWidget().getElement().getChildNodes();
                if (nodes != null && nodes.getLength() == 1) {
                    Node n = nodes.getItem(0);
                    if (n.getNodeType() == Node.ELEMENT_NODE) {
                        Element e = (Element) n;
                        if (e.getTagName().equals("IMG")) {
                            el = e;
                        }
                    }
View Full Code Here

        Profiler.enter("LayoutManager.cleanMeasuredSizes");

        // #12688: IE8 was leaking memory when adding&removing components.
        // Uses IE specific logic to figure if an element has been removed from
        // DOM or not. For removed elements the measured size is discarded.
        Node rootNode = Document.get().getBody();

        Iterator<Element> i = measuredSizes.keySet().iterator();
        while (i.hasNext()) {
            Element e = i.next();
            if (!rootNode.isOrHasChild(e)) {
                i.remove();
            }
        }

        Profiler.leave("LayoutManager.cleanMeasuredSizes");
View Full Code Here

    public static void detachAttach(Element element) {
        if (element == null) {
            return;
        }

        Node nextSibling = element.getNextSibling();
        Node parent = element.getParentNode();
        if (parent == null) {
            return;
        }

        parent.removeChild(element);
        if (nextSibling == null) {
            parent.appendChild(element);
        } else {
            parent.insertBefore(element, nextSibling);
        }

    }
View Full Code Here

     * @param subElement
     * @return
     */
    public static int getChildElementIndex(Element childElement) {
        int idx = 0;
        Node n = childElement;
        while ((n = n.getPreviousSibling()) != null) {
            idx++;
        }

        return idx;
    }
View Full Code Here

  public void set(final XmppID jid,final String name,final List<String> groups)
  {
    XmppQuery iq = session.getFactory().createQuery();
    iq.setType(XmppQuery.TYPE_SET);
    iq.setID(id());
    Node query = iq.setQuery("jabber:iq:roster");
    Element item = query.appendChild(iq.getDoc().createElement("item"));
    item.setAttribute("jid", jid.toStringNoResource());
    if(name != null&&!name.isEmpty())
      item.setAttribute("name", name);
    if(groups != null)
    {
View Full Code Here

      return;
   
    Element iqElement = (Element)packet.getNode();
    if(iqElement.getElementsByTagName("ijab").getItem(0) != null)
    {
      Node iNode = iqElement.getElementsByTagName("ijab").getItem(0);
      NodeList nodeList = iNode.getChildNodes();
      for(int index = 0;index<nodeList.getLength();index++)
      {
        Node node = nodeList.getItem(index);
        String name = node.getNodeName();
        if(name.equals("showOnlineOnly"))
        {
          iJabPrefs.instance().showOnlineOnly = TextUtils.str2bool(node.getNodeValue());
        }
      }
    }
    iJabPrefs.instance().prefsChanged();
   
View Full Code Here

public class DOMHelper
{
  static public Element textTag(final XmlDocument doc,final String name,final String content)
  {
    Element group = doc.createElement(name);
    Node textNode = doc.createTextNode(content);
    group.appendChild(textNode);
    return group;
  }
View Full Code Here

              if(queryElement != null)
              {
                NodeList<Node> childs = queryElement.getChildNodes();
                for(int i = 0;i<childs.getLength();i++)
                {
                  Node node = (Node) childs.getItem(i);
                  if(node.getNodeName().equals("instructions"))
                    continue;
                  if(node.getNodeName().equals("key"))
                    html += "<tr><td colspan=2><input type=hidden value=\""+node.getFirstChild().getNodeValue()+"\"></td></tr>";
                  else
                  {
                    if(node.getFirstChild() != null)
                      html += "<tr><td>"+node.getNodeName()+"&nbsp;</td><td><input type=\"text\" name=\""+node.getNodeName()+"\" value=\""+node.getFirstChild().getNodeValue()+"\"></td></tr>";
                    else
                      html += "<tr><td>"+node.getNodeName()+"&nbsp;</td><td><input type=\"text\" name=\""+node.getNodeName()+"\"></td></tr>";
                  }
                }
              }
              html += "</table>";
            }
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.Node

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.