Examples of CSSStyleRule


Examples of org.pentaho.reporting.libraries.css.model.CSSStyleRule

  }

  public void testParseSingleStyle() throws Exception
  {
    StyleSheet s = new StyleSheet();
    CSSStyleRule rule = new CSSStyleRule(s, null);
    rule.setPropertyValueAsString(BoxStyleKeys.HEIGHT, "10%");
    assertEquals("10%", rule.getPropertyCSSValue(BoxStyleKeys.HEIGHT).toString());
    rule.setPropertyValueAsString(BoxStyleKeys.HEIGHT, "10pt");
    assertEquals("10pt", rule.getPropertyCSSValue(BoxStyleKeys.HEIGHT).toString());
    rule.setPropertyValueAsString(BoxStyleKeys.HEIGHT, "10px");
    assertEquals("10px", rule.getPropertyCSSValue(BoxStyleKeys.HEIGHT).toString());
  }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleRule

      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++){
            Selector sel = selectors.item(j);
            if(sel instanceof ConditionalSelector){
              Condition cond = ((ConditionalSelector)sel).getCondition();
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleRule

  if (userAgentStyleSheet != null) {
      addMatchingRules(userAgentStyleSheet.getCssRules(), e, pe,
                             null, uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserAgentProperty(decl.item(j), decl, rd);
    }
      }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleRule

 
  if (userStyleSheet != null) {
      addMatchingRules(userStyleSheet.getCssRules(), e, pe, null, uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserProperty(decl.item(j), decl, rd);
    }
      }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleRule

  if (userAgentStyleSheet != null) {
      addMatchingRules(userAgentStyleSheet.getCssRules(), e, pe,
                             uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserAgentProperty(decl.item(j), decl, rd);
    }
      }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleRule

 
  if (userStyleSheet != null) {
      addMatchingRules(userStyleSheet.getCssRules(), e, pe, uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserProperty(decl.item(j), decl, rd);
    }
      }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleRule

                                 pe,
                                 authorRules);
            }
            authorRules = sortRules(authorRules, e, pe);
            for (int i = 0; i < authorRules.getLength(); i++) {
                CSSStyleRule rule = (CSSStyleRule)authorRules.item(i);
                CSSStyleDeclaration decl = rule.getStyle();
                int len = decl.getLength();
                for (int j = 0; j < len; j++) {
                    setAuthorProperty(decl.item(j), decl, rd);
                }
            }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleRule

      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++) {
            Selector sel = selectors.item(j);
            if (sel instanceof ConditionalSelector) {
              Condition cond = ((ConditionalSelector) sel).getCondition();
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleRule

      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);
        }
      }
      getTreeViewer().refresh();
    }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleRule

        final List<CSSStyleRule> rules = new ArrayList<>();
        final CSSRuleList ruleList = styleSheet.getCssRules();
        for (int i = 0; i < ruleList.getLength(); i++) {
            final CSSRule rule = ruleList.item(i);
            if (rule instanceof CSSStyleRule) {
                final CSSStyleRule styleRule = (CSSStyleRule) rule;
                rules.add(styleRule);
            }
        }
        return rules;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.