}
}
}
public static DefaultXulOverlay processOverlay( Element node ) {
DefaultXulOverlay overlay = null;
String id = node.attributeValue( "id" ); //$NON-NLS-1$
String resourceBundleUri = node.attributeValue( "resourcebundle" ); //$NON-NLS-1$
String priority = node.attributeValue( "priority" );
String xml = node.asXML();
if ( StringUtils.isNotEmpty( id ) && StringUtils.isNotEmpty( xml ) ) {
// check for overlay priority attribute. if not present, do not provide one
// so default will be used
if ( StringUtils.isNotEmpty( priority ) ) {
try {
overlay = new DefaultXulOverlay( id, null, xml, resourceBundleUri, Integer.parseInt( priority ) );
} catch ( NumberFormatException e ) {
// don't fail if attribute value is invalid. just use alt constructor without priority
overlay = new DefaultXulOverlay( id, null, xml, resourceBundleUri );
}
} else {
overlay = new DefaultXulOverlay( id, null, xml, resourceBundleUri );
}
}
return overlay;
}