Package org.pentaho.reporting.libraries.css.model

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


      throws CSSException
  {
    initParseContext(source);
    if (this.styleSheet == null)
    {
      this.styleSheet = new StyleSheet();
      this.styleSheet.setSource(getSource());
    }
  }
View Full Code Here


      final Resource res = manager.create(key, source, StyleSheet.class);
      if (res == null)
      {
        return;
      }
      final StyleSheet styleSheet = (StyleSheet) res.getResource();
      this.styleSheet.addStyleSheet(styleSheet);
    }
    catch (ResourceException e)
    {
      // ignore ..
View Full Code Here

        final InputSource source = new InputSource();
        source.setCharacterStream(new StringReader(value));

        handler.initParseContext(source);
        handler.setStyleRule(new CSSStyleRule(new StyleSheet(), null));
        parser.setDocumentHandler(handler);
        final LexicalUnit lu = parser.parsePropertyValue(source);
        handler.property(key.getName(), lu, false);
        final CSSStyleRule rule = (CSSStyleRule) handler.getStyleRule();
View Full Code Here

        {
          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

                                  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

        // there is no default stylesheet for that namespace.
        continue;
      }

      final ResourceKey baseKey = layoutProcess.getContextKey();
      final StyleSheet styleSheet = parseStyleSheet(rawKey, baseKey);
      if (styleSheet == null)
      {
        continue;
      }
//      Log.debug("Loaded stylesheet from " + rawKey + " for namespace " + nsDef.getURI());
View Full Code Here

      else
      {
        derivedKey = resourceManager.deriveKey(baseKey, String.valueOf(href));
      }

      final StyleSheet styleSheet = parseStyleSheet(derivedKey, null);
      if (styleSheet == null)
      {
        return;
      }
      addStyleRules(styleSheet, styleRules);
View Full Code Here

    {
      final byte[] bytes = styleText.getBytes("UTF-8");
      final ResourceKey rawKey = resourceManager.createKey(bytes);

      final ResourceKey baseKey = context.getContextKey();
      final StyleSheet styleSheet = parseStyleSheet(rawKey, baseKey);
      if (styleSheet == null)
      {
        return;
      }
      addStyleRules(styleSheet, styleRules);
View Full Code Here

        final String key = (String) it.next();
        final String value = config.getConfigProperty(key);

        // Load the style information
        final Resource resource = manager.createDirectly(value, StyleSheet.class);
        final StyleSheet initialStyleSheet = (StyleSheet) resource.getResource();

        // Add to the master list
        final int rc = initialStyleSheet.getRuleCount();
        for (int i = 0; i < rc; i++)
        {
          final StyleRule rule = initialStyleSheet.getRule(i);
          if (rule instanceof CSSDeclarationRule)
          {
            final CSSDeclarationRule drule = (CSSDeclarationRule) rule;
            copyStyleInformation(initialStyle, drule, null);
          }
View Full Code Here

    LibCssBoot.getInstance().start();
  }

  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();
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.css.model.StyleSheet

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.