Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSRule


        startStyleSheet(styleSheet);

        CSSRuleList rules = styleSheet.getCssRules();
        int length = rules.getLength();
        for (int i = 0; i < length; i++) {
            CSSRule rule = rules.item(i);
            visitRule(rule);
        }

        endStyleSheet(styleSheet);
    }
View Full Code Here


        startMediaRule(rule);

        CSSRuleList rules = rule.getCssRules();
        int length = rules.getLength();
        for (int i = 0; i < length; i++) {
            CSSRule childRule = rules.item(i);
            visitRule(childRule);
        }

        endMediaRule(rule);
    }
View Full Code Here

      InputSource is = new InputSource(new StringReader(css));
      CSSStyleSheet stylesheet = parser.parseStyleSheet(is);
      CSSRuleList list = stylesheet.getCssRules();
//      ArrayList assists = new ArrayList();
      for(int i=0;i<list.getLength();i++){
        CSSRule rule = list.item(i);
        if(rule instanceof CSSStyleRule){
          CSSStyleRule styleRule = (CSSStyleRule)rule;
          String selector = styleRule.getSelectorText();
          SelectorList selectors = parser.parseSelectors(new InputSource(new StringReader(selector)));
          for(int j=0;j<selectors.getLength();j++){
View Full Code Here

     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.css.CSSMediaRule#insertRule(String,int)}.
     */
    public int insertRule(String rule, int index) throws DOMException {
  CSSOMStyleSheet ss = (CSSOMStyleSheet)getParentStyleSheet();
  CSSRule r = CSSDocumentHandler.parseRule(ss, rule);
  if (r != null) {
      cssRules.insert(r, index);
  }
  return index;
    }
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.css.CSSStyleSheet#insertRule(String,int)}.
     */
    public int insertRule(String rule, int index) throws DOMException {
  CSSRule r = CSSDocumentHandler.parseRule(this, rule);
  if (r != null) {
      cssRules.insert(r, index);
      cssRuleAdded(r);
  }
  return index;
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.css.CSSStyleSheet#deleteRule(int)}.
     */
    public void deleteRule(int index) throws DOMException {
  CSSRule r = cssRules.delete(index);
  switch (r.getType()) {
  case CSSRule.STYLE_RULE:
      ((CSSOMStyleRule)r).removeCSSStyleRuleChangeListener(this);
      break;
  }
  if (styleSheetChangeSupport != null) {
View Full Code Here

            String pe,
                                    URL buri,
            CSSOMRuleList rl) {
  int llen = l.getLength();
  for (int i = 0; i < llen; i++) {
      CSSRule rule = l.item(i);
      switch (rule.getType()) {
      case CSSRule.STYLE_RULE:
    CSSOMStyleRule sr = (CSSOMStyleRule)rule;
    SelectorList sl = sr.getSelectors();
    int slen = sl.getLength();
    for (int j = 0; j < slen; j++) {
View Full Code Here

            Element e,
            String pe,
            CSSOMRuleList rl) {
  int llen = l.getLength();
  for (int i = 0; i < llen; i++) {
      CSSRule rule = l.item(i);
      switch (rule.getType()) {
      case CSSRule.STYLE_RULE:
    CSSOMStyleRule sr = (CSSOMStyleRule)rule;
    SelectorList sl = sr.getSelectors();
    int slen = sl.getLength();
    for (int j = 0; j < slen; j++) {
View Full Code Here

      InputSource is = new InputSource(new StringReader(css));
      CSSStyleSheet stylesheet = parser.parseStyleSheet(is);
      CSSRuleList list = stylesheet.getCssRules();
      //      ArrayList assists = new ArrayList();
      for (int i = 0; i < list.getLength(); i++) {
        CSSRule rule = list.item(i);
        if (rule instanceof CSSStyleRule) {
          CSSStyleRule styleRule = (CSSStyleRule) rule;
          String selector = styleRule.getSelectorText();
          SelectorList selectors = parser.parseSelectors(new InputSource(new StringReader(selector)));
          for (int j = 0; j < selectors.getLength(); j++) {
View Full Code Here

      InputSource is = new InputSource(new StringReader(editor.getDocumentProvider().getDocument(editor.getEditorInput()).get()));
      CSSStyleSheet stylesheet = parser.parseStyleSheet(is);
      this.selectors.clear();
      CSSRuleList list = stylesheet.getCssRules();
      for (int i = 0; i < list.getLength(); i++) {
        CSSRule rule = list.item(i);
        if (rule instanceof CSSStyleRule) {
          CSSStyleRule styleRule = (CSSStyleRule) rule;
          String selector = styleRule.getSelectorText();
          this.selectors.add(selector);
        }
View Full Code Here

TOP

Related Classes of org.w3c.dom.css.CSSRule

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.