Examples of CSSDeclarationRule


Examples of org.jfree.layouting.input.style.CSSDeclarationRule

        final byte[] bytes = styleText.getBytes("UTF-8");
        final ResourceKey key = resourceManager.createKey(bytes);
        final Resource resource = resourceManager.create
            (key, baseResource, StyleRule.class);

        final CSSDeclarationRule parsedRule =
            (CSSDeclarationRule) resource.getResource();
        mergeDeclarationRule(targetRule, parsedRule);
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jfree.layouting.input.style.CSSDeclarationRule

                                               final ReportTarget target,
                                               final ExpressionRuntime runtime)
      throws DataSourceException
  {
    final AttributeMap attributes = collectAttributes(node, runtime);
    CSSDeclarationRule rule = null;


    final String[] attrNamespaces = attributes.getNameSpaces();
    for (int i = 0; i < attrNamespaces.length; i++)
    {
      final String namespace = attrNamespaces[i];
      final Map attributeMap = attributes.getAttributes(namespace);
      if (attributeMap == null || attributeMap.isEmpty())
      {
        continue;
      }

      final NamespaceDefinition nsDef = target.getNamespaceByUri(namespace);
      final Iterator attributeIt = attributeMap.entrySet().iterator();
      while (attributeIt.hasNext())
      {
        final Map.Entry entry = (Map.Entry) attributeIt.next();
        final String key = (String) entry.getKey();
        if (isStyleAttribute(nsDef, node.getType(), key))
        {
          final Object styleAttributeValue = entry.getValue();
          rule = processStyleAttribute(styleAttributeValue, node, runtime, rule);
        }
      }
    }

    // Just in case there was no style-attribute but there are style-expressions
    if (rule == null)
    {
      rule = processStyleAttribute(null, node, runtime, rule);
    }

    if (rule != null && rule.isEmpty() == false)
    {
      final AttributeMap retval = new AttributeMap(attributes);
      retval.setAttribute(Namespaces.LIBLAYOUT_NAMESPACE, "style", rule);
      retval.makeReadOnly();
      return retval;
View Full Code Here

Examples of org.jfree.layouting.input.style.CSSDeclarationRule

                        (layoutProcess.getDocumentContext());
        final ResourceManager manager = layoutProcess.getResourceManager();
        final ResourceKey key = manager.createKey(bytes);
        final Resource resource = manager.create(key, baseKey, StyleRule.class);

        final CSSDeclarationRule rule =
                (CSSDeclarationRule) resource.getResource();
        if (rule != null)
        {
          copyStyleInformation(node.getLayoutContext(), rule, node);
        }
      }
      catch (Exception e)
      {
        DebugLog.log("Unable to handle style attribute value.", e);
      }
    }
    else if (styleValue instanceof CSSDeclarationRule)
    {
      final CSSDeclarationRule rule = (CSSDeclarationRule) styleValue;
      copyStyleInformation(node.getLayoutContext(), rule, node);
    }
  }
View Full Code Here

Examples of org.jfree.layouting.input.style.CSSDeclarationRule

      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);
        }
      }
    }
    catch (Exception e)
View Full Code Here

Examples of org.jfree.layouting.input.style.CSSDeclarationRule

        handler.initParseContext(source);
        handler.setStyleRule(baseRule);
        parser.setDocumentHandler(handler);
        parser.parseStyleDeclaration(source);
        final CSSDeclarationRule rule = handler.getStyleRule();
        CSSParserContext.getContext().destroy();
        return rule;
      }
    }
    catch (Exception e)
View Full Code Here

Examples of org.jfree.layouting.input.style.CSSDeclarationRule

        dependencies.add(data.getKey(), data.getVersion(manager));
      }

      CSSParserContext.getContext().destroy();

      final CSSDeclarationRule styleRule = handler.getStyleRule();
      if (styleRule == null)
      {
        throw new ResourceCreationException("Damn, the style rule is null");
      }
      return new CompoundResource
View Full Code Here

Examples of org.jfree.layouting.input.style.CSSDeclarationRule

                        (layoutProcess.getDocumentContext());
        final ResourceManager manager = layoutProcess.getResourceManager();
        final ResourceKey key = manager.createKey(bytes);
        final Resource resource = manager.create(key, baseKey, StyleRule.class);

        final CSSDeclarationRule rule =
                (CSSDeclarationRule) resource.getResource();
        if (rule != null)
        {
          copyStyleInformation(node.getLayoutContext(), rule, node);
        }
      }
      catch (Exception e)
      {
        Log.debug("Unable to handle style attribute value.", e);
      }
    }
    else if (styleValue instanceof CSSDeclarationRule)
    {
      final CSSDeclarationRule rule = (CSSDeclarationRule) styleValue;
      copyStyleInformation(node.getLayoutContext(), rule, node);
    }
  }
View Full Code Here

Examples of org.jfree.layouting.input.style.CSSDeclarationRule

      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);
        }
      }
    }
    catch (Exception e)
View Full Code Here

Examples of org.jfree.layouting.input.style.CSSDeclarationRule

        handler.initParseContext(source);
        handler.setStyleRule(baseRule);
        parser.setDocumentHandler(handler);
        parser.parseStyleDeclaration(source);
        final CSSDeclarationRule rule = handler.getStyleRule();
        CSSParserContext.getContext().destroy();
        return rule;
      }
    }
    catch (Exception e)
View Full Code Here

Examples of org.jfree.layouting.input.style.CSSDeclarationRule

        dependencies.add(data.getKey(), data.getVersion(manager));
      }

      CSSParserContext.getContext().destroy();

      final CSSDeclarationRule styleRule = handler.getStyleRule();
      if (styleRule == null)
      {
        throw new ResourceCreationException("Damn, the style rule is null");
      }
      return new CompoundResource
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.