if (heightValue != null)
propertyMap.put("height", heightValue);
if (widthValue != null)
propertyMap.put("width", widthValue);
icon = new TextIcon(text, text, null,
propertyMap.isEmpty() ? null : new UnmodifiableStyle(propertyMap));
}
else if (uri != null)
{
// A URIImageIcon url starts with '/' or 'http:',
// whereas a ContextImageIcons uri does not.
boolean startsWithASlash = uri.startsWith("/");
Style inlineStyle = propertyMap.isEmpty() ? null : new UnmodifiableStyle(propertyMap);
if (!startsWithASlash && !CSSUtils.isAbsoluteURI(uri))
{
icon =
new ContextImageIcon(uri, uri, width, height, null, inlineStyle);