Package com.connect_group.thymesheet.css.selectors.dom

Examples of com.connect_group.thymesheet.css.selectors.dom.DOMNodeSelector


    }
  }
 
  protected void handleRule(Document document, String selectorText, Map<String,String> styles) throws NodeSelectorException {

    DOMNodeSelector selector = new DOMNodeSelector(document);
    Set<Node> matches = selector.querySelectorAll(selectorText);
    for(Node matchedNode : matches) {
      if(matchedNode instanceof Element) {
        Element element = (Element)matchedNode;
            for (Map.Entry<String,String> rule : styles.entrySet()) {
              element.setAttribute(rule.getKey(), rule.getValue());
View Full Code Here


  }
 
  List<Set<Node>> getMatchedElements(Document document) throws NodeSelectorException {
    List<Set<Node>> elements = new ArrayList<Set<Node>>(this.size());
   
    DOMNodeSelector selector = new DOMNodeSelector(document);
    for (ElementRule rule : this) {
      Set<Node> matches = selector.querySelectorAll(rule.getSelector());
      elements.add(matches);
    }
    return elements;
  }
View Full Code Here

 
  public HtmlElements matching(String criteria) throws NodeSelectorException {
    HtmlElements matchedElements = new HtmlElements();
   
    for(HtmlElement tag : this) {
      DOMNodeSelector selector = new DOMNodeSelector(tag.getElement());
      Set<Node> nodes = selector.querySelectorAll(criteria);
      for(Node node : nodes) {
        matchedElements.add(new HtmlElement((Element)node));
      }
    }
   
View Full Code Here

TOP

Related Classes of com.connect_group.thymesheet.css.selectors.dom.DOMNodeSelector

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.