use of org.pentaho.ui.xul.impl.DefaultXulOverlay in project pentaho-platform by pentaho.
the class PerspectiveUtil method processOverlays.
private static ArrayList<XulOverlay> processOverlays(Element node) {
if (node == null) {
return null;
}
ArrayList<XulOverlay> overlays = new ArrayList<XulOverlay>();
@SuppressWarnings("unchecked") List<Node> overlayElements = (List<Node>) node.selectNodes("overlay");
for (Node overlayNode : overlayElements) {
DefaultXulOverlay overlay;
// reuse static method to honor overlay priorities as well
overlay = SystemPathXmlPluginProvider.processOverlay((Element) overlayNode);
if (overlay != null) {
overlays.add(overlay);
}
}
return overlays;
}
use of org.pentaho.ui.xul.impl.DefaultXulOverlay in project pentaho-platform by pentaho.
the class SystemPathXmlPluginProvider method processOverlays.
protected void processOverlays(PlatformPlugin plugin, Document doc, IPentahoSession session) {
// look for content types
// $NON-NLS-1$
List<?> nodes = doc.selectNodes("//overlays/overlay");
for (Object obj : nodes) {
Element node = (Element) obj;
DefaultXulOverlay overlay = processOverlay(node);
if (overlay != null) {
plugin.addOverlay(overlay);
}
}
}
use of org.pentaho.ui.xul.impl.DefaultXulOverlay in project pentaho-platform by pentaho.
the class SystemPathXmlPluginProvider method processOverlay.
public static DefaultXulOverlay processOverlay(Element node) {
DefaultXulOverlay overlay = null;
// $NON-NLS-1$
String id = node.attributeValue("id");
// $NON-NLS-1$
String resourceBundleUri = node.attributeValue("resourcebundle");
String priority = node.attributeValue("priority");
String xml = node.asXML();
if (StringUtils.isNotEmpty(id) && StringUtils.isNotEmpty(xml)) {
// 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;
}
Aggregations