{
targetRule = (CSSDeclarationRule) node.getStyle().clone();
}
catch (CloneNotSupportedException e)
{
targetRule = new CSSStyleRule(null, null);
}
}
if (styleAttributeValue instanceof String)
{
// ugly, we have to parse that thing. Cant think of nothing
// worse than that.
final String styleText = (String) styleAttributeValue;
try
{
final ReportContext reportContext = runtime.getReportContext();
final ReportStructureRoot root = reportContext.getReportStructureRoot();
final ResourceKey baseResource = root.getBaseResource();
final ResourceManager resourceManager = root.getResourceManager();
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)
{
// ignore ..
e.printStackTrace();
}
}
else if (styleAttributeValue instanceof CSSStyleRule)
{
final CSSStyleRule styleRule =
(CSSStyleRule) styleAttributeValue;
mergeDeclarationRule(targetRule, styleRule);
}
// ok, not lets fill in the stuff from the style expressions ..