String id,
String prefix,
boolean isName
)
{
CSSStyle style = (CSSStyle)map.get(id);
if (style == _MISS)
return null;
if (style != null)
return style;
// Next, try getting the Style from the StyleSheetDocument
StyleSheetDocument document = __getStyleSheetDocument();
if (document == null)
return null;
StyleNode styleNode = null;
if (isName)
{
styleNode = document.getStyleByName(context, id);
}
else
{
styleNode = document.getStyleBySelector(context, prefix + id);
}
if (styleNode == null)
{
map.put(id, _MISS);
return null;
}
// Convert the styleNode into a Style
style = new CSSStyle();
// Add in the properties for the style
Iterable<PropertyNode> propertyNodeList = styleNode.getProperties();
for (PropertyNode property : propertyNodeList)
{
String name = property.getName();
String value = property.getValue();
style.setProperty(name, value);
}
map.put(id, style);
return style;
}