{
// First check to see if we already have an Icon registered.
// it might be a ReferenceIcon. If so, resolve the reference and
// register the true icon (if resolve is true)
Icon icon = super.getIcon(iconName, false);
if (icon != null)
{
if (icon == _NULL_ICON)
return null;
if (resolve)
{
// if icon is a ReferenceIcon, I need to get the actual icon, and
// re-register it.
if (icon instanceof ReferenceIcon)
{
// go find the actual icon
Icon resolvedIcon = _resolveReferenceIcon((ReferenceIcon)icon,
null);
// register icon so we don't have to resolve reference next time.
registerIcon(iconName, resolvedIcon);
return resolvedIcon;
}
}
return icon;
}
// If we don't have the icon locally, check the base skin.
Skin baseSkin = getBaseSkin();
// get baseSkin's icon. Don't resolve to a real icon. If it is a
// ReferenceIcon, return the ReferenceIcon.
icon = baseSkin.getIcon(iconName, false);
// we found the icon on the base Skin, but it is a ReferenceIcon.
// find the actual icon
if (resolve)
{
if (icon instanceof ReferenceIcon)
{
Icon resolvedIcon = _resolveReferenceIcon((ReferenceIcon)icon,
null);
// register icon so we don't have to resolve reference next time.
registerIcon(iconName, resolvedIcon);
return resolvedIcon;