String styleSheetName = skinAdditionNode.getStyleSheetName();
String resourceBundleName = skinAdditionNode.getResourceBundleName();
String translationSourceExpression =
skinAdditionNode.getTranslationSourceExpression();
Skin skin = skinFactory.getSkin(fContext, skinId);
if (skin != null
&& ((styleSheetName != null)
|| (resourceBundleName != null)
|| (translationSourceExpression != null)))
{
// If the styleSheetName is in the META-INF/trinidad-skins.xml file, then
// we prepend META-INF to the styleSheetName if it doesn't begin with '/'.
// This way we can find the file when we go to parse it later.
if (isMetaInfFile && (styleSheetName != null))
styleSheetName = _prependMetaInf(styleSheetName);
SkinAddition addition = null;
if (resourceBundleName != null)
{
// create SkinAddition with resourceBundleName
addition = new SkinAddition(styleSheetName, resourceBundleName);
}
else
{
ValueExpression translationSourceVE = null;
if (translationSourceExpression != null)
{
translationSourceVE =
_createTranslationSourceValueExpression(translationSourceExpression);
}
if (translationSourceVE != null)
{
// Create a SkinAddition with translationSourceVE
addition = new SkinAddition(styleSheetName, translationSourceVE);
}
else
{
// Create a SkinAddition with stylesheetName only
addition = new SkinAddition(styleSheetName);
}
}
skin.addSkinAddition(addition);
}
}
}