String url,
String message) {
Class cls = AbstractJSVGComponent.class;
URL blURL = cls.getResource("resources/BrokenLink.svg");
if (blURL == null)
throw new BridgeException
(bridgeContext, e, ErrorConstants.ERR_URI_IMAGE_BROKEN,
new Object[] { url, message });
DocumentLoader loader = bridgeContext.getDocumentLoader();
SVGDocument doc = null;
try {
doc = (SVGDocument)loader.loadDocument(blURL.toString());
if (doc == null) return doc;
DOMImplementation impl;
impl = SVGDOMImplementation.getDOMImplementation();
doc = (SVGDocument)DOMUtilities.deepCloneDocument(doc, impl);
String title;
Element infoE, titleE, descE;
infoE = doc.getElementById("__More_About");
if (infoE == null) return doc;
titleE = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
SVGConstants.SVG_TITLE_TAG);
title = Messages.formatMessage(BROKEN_LINK_TITLE, null);
titleE.appendChild(doc.createTextNode(title));
descE = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
SVGConstants.SVG_DESC_TAG);
descE.appendChild(doc.createTextNode(message));
infoE.insertBefore(descE, infoE.getFirstChild());
infoE.insertBefore(titleE, descE);
} catch (Exception ex) {
throw new BridgeException
(bridgeContext, e, ex, ErrorConstants.ERR_URI_IMAGE_BROKEN,
new Object[] {url, message });
}
return doc;
}