/*
* Processes the loading screen node and sets Loading Screen configurations
*/
private void processLoadingScreenNode(Node loadingScreenNode) throws Exception {
if (loadingScreenNode.getNodeType() != Node.ELEMENT_NODE) {
throw new PackageException("EXCEPTION_CONFIGXML_INVALID_LOADINGSCREEN_ELEMENT");
}
NamedNodeMap attrs = loadingScreenNode.getAttributes();
Node attr;
attr = attrs.getNamedItem("backgroundColor");
if (attr != null) {
_widgetConfig.setLoadingScreenColour(getTextValue(attr));
}
attr = attrs.getNamedItem("backgroundImage");
if (attr != null) {
_widgetConfig.setBackgroundImage(getTextValue(attr).replace('\\', '/').trim());
}
attr = attrs.getNamedItem("foregroundImage");
if (attr != null) {
_widgetConfig.setForegroundImage(getTextValue(attr).replace('\\', '/').trim());
}
attr = attrs.getNamedItem("onFirstLaunch");
if (attr != null && attr.getNodeValue().equalsIgnoreCase("true")) {
_widgetConfig.setFirstPageLoad(true);
}
attr = attrs.getNamedItem("onRemotePageLoad");
if (attr != null && attr.getNodeValue().equalsIgnoreCase("true")) {
_widgetConfig.setRemotePageLoad(true);
}
attr = attrs.getNamedItem("onLocalPageLoad");
if (attr != null && attr.getNodeValue().equalsIgnoreCase("true")) {
_widgetConfig.setLocalPageLoad(true);
}
Element loadingScreenElement = (Element) loadingScreenNode;
// Process nested <rim:transitionEffect> elements
NodeList transitionEffectList = loadingScreenElement.getElementsByTagName("rim:transitionEffect");
if (transitionEffectList.getLength() > 1) {
throw new PackageException("EXCEPTION_CONFIGXML_INVALID_LOADINGSCREEN_ELEMENT");
}
if (transitionEffectList.getLength() > 0) {
Node transitionEffectNode = transitionEffectList.item(0);
processTransitionEffectNode(transitionEffectNode);