Package org.pentaho.reporting.engine.classic.core.style.css

Examples of org.pentaho.reporting.engine.classic.core.style.css.ElementStyleDefinition


    assertNotNull(resource);

    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();
    final Resource loaded = mgr.createDirectly(resource, ElementStyleDefinition.class);
    final ElementStyleDefinition style = (ElementStyleDefinition) loaded.getResource();
    assertEquals(1, style.getRuleCount());
    final ElementStyleSheet rule = style.getRule(0);
    assertNotNull(rule);

    rule.setStyleProperty(TextStyleKeys.ITALIC, Boolean.TRUE);

    final ByteArrayOutputStream bout = new ByteArrayOutputStream();

    final StyleDefinitionWriter writer = new StyleDefinitionWriter();
    writer.write(bout, style);

    Resource parsed = mgr.createDirectly(bout.toByteArray(), ElementStyleDefinition.class);
    final ElementStyleDefinition parsedStyle = (ElementStyleDefinition) parsed.getResource();

    assertEquals(1, parsedStyle.getRuleCount());
    final ElementStyleSheet parsedRule = parsedStyle.getRule(0);
    assertNotNull(parsedRule);
    assertEquals(Boolean.TRUE, rule.getStyleProperty(TextStyleKeys.ITALIC));
  }
View Full Code Here


    ElementStyleRule rule = new ElementStyleRule();
    rule.addSelector((CSSSelector) factory.createElementSelector(null, "label"));
    rule.setStyleProperty(TextStyleKeys.FONT, targetName);

    ElementStyleDefinition def = new ElementStyleDefinition();
    def.addRule(rule);
    return def;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.style.css.ElementStyleDefinition

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.