Package com.google.gwt.dom.client

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


        Item element = context.getContextItem();
        if (!(element instanceof HTMLNodeWrapper && ((HTMLNodeWrapper)element).getUnderlyingNode() instanceof Element)) {
            return null;
        }

        Element parent = (Element)((HTMLNodeWrapper)element).getUnderlyingNode();
        final PendingUpdateList pul = context.getController().getPendingUpdateList();
        SequenceIterator iter = content.iterate(context);
        while (true) {
            Item att = iter.next();
            if (att == null) {
View Full Code Here


        Item element = context.getContextItem();
        if (!(element instanceof HTMLNodeWrapper && ((HTMLNodeWrapper)element).getUnderlyingNode() instanceof Element)) {
            return null;
        }

        Element parent = (Element)((HTMLNodeWrapper)element).getUnderlyingNode();
        final PendingUpdateList pul = context.getController().getPendingUpdateList();
        SequenceIterator iter = content.iterate(context);
        while (true) {
            Item att = iter.next();
            if (att == null) {
View Full Code Here

        String prefix = namePool.getPrefix(nameCode);
        String uri = namePool.getURI(nameCode);
       
        // TODO: For XML Writer it should write prefixes in a
        // way compliant with the XSLT2.0 specification - using xsl:output attributes
        Element element = null;
        if (uri != null && !uri.isEmpty()) {
          if(mode == WriteMode.XML && !prefix.equals("")) {
            element =  createElementNS(document, uri, prefix+":"+localName);
           
          } else {
            // no svg specific prefix now used, for compliance with HTML5
            element = createElementNS(document, uri, localName);
          }
        }
       
        // if there's no namespace - or no namespace support
        if (element == null) {
            element = document.createElement(localName);
        }
        // special case for html element: write to the document node
        Controller controller = pipe.getController();
        if (controller != null && controller.getApiCommand() == APIcommand.UPDATE_HTML
            && (localName.equals("html") || localName.equals("head") || localName.equals("body"))) {
          if (localName.equals("html")){
            element = (Element)document.getFirstChild();
          } else {
            element = (Element)document.getElementsByTagName(localName.toUpperCase()).getItem(0);
            NodeList<Node> nodes = element.getChildNodes();
            for (int n = 0; n < nodes.getLength(); n++) {
              Node node = nodes.getItem(n);
              node.removeFromParent();
            }
          }
View Full Code Here

    public void namespace (NamespaceBinding nsBinding, int properties) throws XPathException {
       if(mode == WriteMode.XML) {
          String prefix = nsBinding.getPrefix();
        String uri = nsBinding.getURI();
        Element element = (Element)currentNode;
            if (!(uri.equals(NamespaceConstant.XML))) {
                addNamespace(element, prefix, uri);
            }
       }
      
View Full Code Here

    public void attribute(int nameCode, CharSequence value)
    throws XPathException {
        String localName = namePool.getLocalName(nameCode);
        String uri = namePool.getURI(nameCode);
        String val = value.toString();
        Element element = (Element)currentNode;

        // must be HTML write mode
        if (mode != WriteMode.XML && NamespaceConstant.HTML_PROP.equals(uri)) {
            element.setPropertyString(localName, val);
        } else if (mode != WriteMode.XML && NamespaceConstant.HTML_STYLE_PROP.equals(uri)) {
          // if localName starts with '_-' then remove the underscore e.g _-webkit-transition
          if(localName.length() > 1 && localName.charAt(0) == '_' && localName.charAt(1) == '-') {
            localName = localName.substring(1);
          }
          localName = HTMLWriter.getCamelCaseName(localName);
            element.getStyle().setProperty(localName, val);
        } else if (uri != null && !uri.isEmpty()){
            String fullname = namePool.getDisplayName(nameCode);
            setAttribute(document, element, fullname, uri, val, mode);
        } else {
          localName = tableAttributeFix(localName, mode);
            element.setAttribute(localName, val);
            setAttributeProps(element, localName, val);
        }
    }
View Full Code Here

  
    private HTMLAttributeNode[] getAltAttributes() {
        if (attributeList != null) {
          return attributeList;
        }
        Element elem = (Element)node;
     
      // Browser implementations of attributes property are potentially buggy - but preferred to
      // parsing the string. But IE6 and IE7 both list all possible attributes whether they
      // exist or not - so use outerHTML in these cases.
        int ieVersion = Configuration.getIeVersion();
View Full Code Here

            } catch (XPathException e) {
              String reportURI = (absSourceURI != null)? absSourceURI : styleURI;
              throw new XPathException("Failed to load XSLT stylesheet " + reportURI + ": " + e.getMessage());
            }
            config.getDocumentPool().add(styleDoc, absStyleURI);     // where document('') can find it
            Element body = getBodyElement();
           
            localController.setInitialMode(initialMode);
            localController.setInitialTemplate(initialTemplate);
            localController.setApiCommand(APIcommand.UPDATE_HTML);
            localController.setTargetNode(Document.get());          // target node is the document node
View Full Code Here

          logger.log(Level.SEVERE, err.getMessage());
        }
    }
   
    public static Element getBodyElement() {
      Element body = Document.get().getElementsByTagName("BODY").getItem(0);
      if (body == null) {
        body = Document.get().getElementsByTagName("body").getItem(0);
      }
      return body;
    }
View Full Code Here

    private void registerEventHandlers(Controller controller) throws XPathException {
      // add an event listener to capture registered event modes
      if (registeredEventModes != null) {
        return;
      }
        Element docElement = (com.google.gwt.user.client.Element)(Object)Document.get();
        registeredEventModes = controller.getRuleManager().getModesInNamespace(NamespaceConstant.IXSL);
        // Restriction: only one event listener per element
        if (registeredEventModes.size() > 0 && !registeredForEvents) {
          registeredForEvents = true;
          registerNonDOMevents(controller);
View Full Code Here

      } else {
        $containement = $(containmentAsString);
      }
    }

    Element ce = $containement.get(0);
    if (ce == null) {
      return;
    }

    containment = impl.calculateContainment(this, $containement.offset(), ce,
View Full Code Here

TOP

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