String text = null;
boolean isNullIcon = false;
boolean createStyleNode = false;
// append all the styles that are not content, width or height into
// inline style
CSSStyle inlineStyle = null;
for(PropertyNode propertyNode : noTrPropertyNodeList)
{
String propertyName = propertyNode.getName();
String propertyValue = propertyNode.getValue();
if (propertyName.equals("width"))
{
// save original width value
// strip off px from the string and return an Integer
if (_INTEGER_PATTERN.matcher(propertyValue).matches())
{
widthValue = propertyValue;
width = _convertPxDimensionStringToInteger(widthValue);
}
else
{
widthValue = null;
// use inlineStyle for non-integer width values;
if (inlineStyle == null)
{
inlineStyle = new CSSStyle();
}
inlineStyle.setProperty(propertyName, propertyValue);
}
}
else if (propertyName.equals("height"))
{
// save original height value
// strip off px from the string and return an Integer
if (_INTEGER_PATTERN.matcher(propertyValue).matches())
{
heightValue = propertyValue;
height = _convertPxDimensionStringToInteger(heightValue);
}
else
{
// use inlineStyle for non-integer height values;
heightValue = null;
if (inlineStyle == null)
{
inlineStyle = new CSSStyle();
}
inlineStyle.setProperty(propertyName, propertyValue);
}
}
else if (propertyName.equals("content"))
{
// is it a text or uri
if (_isURLValue(propertyValue))
{
uri = _getURIString(propertyValue);
}
else if (propertyValue.startsWith("inhibit"))
{
isNullIcon = true;
}
else
{
text = trimQuotes(propertyValue);
}
}
else
{
// create an inlineStyle with all the extraneous style properties
if (inlineStyle == null)
inlineStyle = new CSSStyle();
inlineStyle.setProperty(propertyName, propertyValue);
}
}
// now I need to create the icon.
// do not create an icon if isNullIcon is true.
Icon icon = null;
if (!isNullIcon)
{
if (text != null)
{
// don't allow styleClass from the css parsing file. We can handle
// this when we have style includes
// put back the width/height properties if there were some
if ((heightValue != null || widthValue != null) && inlineStyle == null)
inlineStyle = new CSSStyle();
if (heightValue != null)
inlineStyle.setProperty("height", heightValue);
if (widthValue != null)
inlineStyle.setProperty("width", widthValue);
icon = new TextIcon(text, text, null, inlineStyle);
}
else if (uri != null)
{