Examples of CSSStyleRule


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

        {
          handler.setStyleRule(baseRule);
        }
        else
        {
          handler.setStyleRule(new CSSStyleRule(new StyleSheet(), null));
        }
        parser.setDocumentHandler(handler);
        parser.parseStyleDeclaration(source);
        final CSSDeclarationRule rule = handler.getStyleRule();
        CSSParserContext.getContext().destroy();
View Full Code Here

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

                                  final String value,
                                  final ResourceKey baseURL,
                                  final ResourceManager resourceManager,
                                  final StyleKeyRegistry styleKeyRegistry)
  {
    final CSSStyleRule cssStyleRule = new CSSStyleRule(new StyleSheet(), null);
    return parseStyles(namespaces, name, value, baseURL, cssStyleRule, resourceManager, styleKeyRegistry);
  }
View Full Code Here

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

        handler.initParseContext(source);
        handler.setStyleRule(baseRule);
        parser.setDocumentHandler(handler);
        final LexicalUnit lu = parser.parsePropertyValue(source);
        handler.property(name, lu, false);
        final CSSStyleRule rule = (CSSStyleRule) handler.getStyleRule();

        CSSParserContext.getContext().destroy();
        return rule;
      }
    }
View Full Code Here

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

    // sort ...
    Arrays.sort(activeStyleRules, new CSSStyleRuleComparator());
    SelectorWeight oldSelectorWeight = null;
    for (int i = 0; i < activeStyleRules.length; i++)
    {
      final CSSStyleRule activeStyleRule = activeStyleRules[i];
      final CSSSelector selector = activeStyleRule.getSelector();
      final SelectorWeight activeWeight = selector.getWeight();

      if (oldSelectorWeight != null)
      {
        if (oldSelectorWeight.compareTo(activeWeight) > 0)
View Full Code Here

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

        counterRules.toArray(new CSSCounterRule[counterRules.size()]);

    styleRules.clear();
    for (int i = 0; i < activeStyleRules.length; i++)
    {
      final CSSStyleRule activeStyleRule = activeStyleRules[i];
      if (isPseudoElementRule(activeStyleRule) == false)
      {
        continue;
      }
      styleRules.add(activeStyleRule);
View Full Code Here

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

    for (int i = 0; i < rc; i++)
    {
      final StyleRule rule = styleSheet.getRule(i);
      if (rule instanceof CSSStyleRule)
      {
        final CSSStyleRule drule = (CSSStyleRule) rule;
        activeStyleRules.add(drule);
      }
    }
  }
View Full Code Here

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

  public boolean isMatchingPseudoElement(final LayoutElement element, final String pseudo)
  {
    for (int i = 0; i < activePseudoStyleRules.length; i++)
    {
      final CSSStyleRule activeStyleRule = activePseudoStyleRules[i];

      final CSSSelector selector = activeStyleRule.getSelector();
      final ConditionalSelector cs = (ConditionalSelector) selector;
      final Condition condition = cs.getCondition();

      final AttributeCondition ac = (AttributeCondition) condition;
      if (ObjectUtilities.equal(ac.getValue(), pseudo) == false)
View Full Code Here

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

  public CSSStyleRule[] getMatchingRules(final LayoutElement element)
  {
    final ArrayList retvals = new ArrayList();
    for (int i = 0; i < activeStyleRules.length; i++)
    {
      final CSSStyleRule activeStyleRule = activeStyleRules[i];
      final CSSSelector selector = activeStyleRule.getSelector();
      if (selector == null)
      {
        continue;
      }
View Full Code Here

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

   * @throws ClassCastException if the arguments' types prevent them from being
   *                            compared by this Comparator.
   */
  public int compare(final Object o1, final Object o2)
  {
    final CSSStyleRule r1 = (CSSStyleRule) o1;
    final CSSStyleRule r2 = (CSSStyleRule) o2;

    final CSSSelector selector1 = r1.getSelector();
    final CSSSelector selector2 = r2.getSelector();

    final SelectorWeight weight1 = selector1.getWeight();
    final SelectorWeight weight2 = selector2.getWeight();

    return weight1.compareTo(weight2);
View Full Code Here

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

  }

  public void testParseColorFunction()
  {
    StyleSheet s = new StyleSheet();
    CSSStyleRule rule = new CSSStyleRule(s, null);
    rule.setPropertyValueAsString(BorderStyleKeys.BACKGROUND_COLOR, "rgb(0,255,0)");
    final CSSFunctionValue value = (CSSFunctionValue) rule.getPropertyCSSValue(BorderStyleKeys.BACKGROUND_COLOR);
    assertEquals("rgb", value.getFunctionName());
    final CSSValue[] cssValues = value.getParameters();
    assertEquals("Parameter-count", 3, cssValues.length);
    assertEquals("Parameter1", "0", cssValues[0].toString());
    assertEquals("Parameter2", "255", cssValues[1].toString());
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.