}
// Access the resource file
String resourceName = "icons." + iconName;
MultiIcon bufferIcon = null;
if (resourceCollection != null)
{
bufferIcon = (MultiIcon) resourceCollection.getOptionalObject((resourcePrefix != null ? resourcePrefix : "") + resourceName);
}
if (bufferIcon == null)
{
bufferIcon = (MultiIcon) defaultResourceCollection.getOptionalObject(resourceName);
}
if (bufferIcon == null)
{
// We use the standard icon
String name = iconName;
if (name.equals("fatal"))
{
name = "error";
}
icon = UIManager.getIcon("OptionPane." + name + "Icon");
}
else
{
icon = bufferIcon.getIcon(FlexibleSize.LARGE);
}
// Since we have an icon we stop looking for another one
break;
}