/** * Constructs a new <code>BridgeException</code> with the specified parameters. * * @param ctx the bridge context to use for determining the element's * source position * @param e the element on which the error occurred * @param message the error message */ public BridgeException(BridgeContext ctx, Element e, String message) { this.e = e; this.message = message; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> with the specified parameters. * * @param ctx the bridge context to use for determining the element's * source position * @param e the element on which the error occurred * @param message the error message */ public BridgeException(BridgeContext ctx, Element e, String message) { this.e = e; this.message = message; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> with the specified parameters. * * @param ctx the bridge context to use for determining the element's * source position * @param e the element on which the error occurred * @param message the error message */ public BridgeException(BridgeContext ctx, Element e, String message) { this.e = e; this.message = message; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> with the specified parameters. * * @param ctx the bridge context to use for determining the element's * source position * @param e the element on which the error occurred * @param code the error code * @param params the parameters to use for the error message */ public BridgeException(BridgeContext ctx, Element e, String code, Object[] params) { this.e = e; this.code = code; this.params = params; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> with the specified parameters. * * @param ctx the bridge context to use for determining the element's * source position * @param e the element on which the error occurred * @param code the error code * @param params the parameters to use for the error message */ public BridgeException(BridgeContext ctx, Element e, String code, Object[] params) { this.e = e; this.code = code; this.params = params; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> with the specified parameters. * * @param ctx the bridge context to use for determining the element's * source position * @param e the element on which the error occurred * @param code the error code * @param params the parameters to use for the error message */ public BridgeException(BridgeContext ctx, Element e, String code, Object[] params) { this.e = e; this.code = code; this.params = params; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> with the specified parameters. * * @param ctx the bridge context to use for determining the element's * source position * @param e the element on which the error occurred * @param ex the exception which was the root-cause for this exception * @param code the error code * @param params the parameters to use for the error message */ public BridgeException(BridgeContext ctx, Element e, Exception ex, String code, Object[] params) { // todo ex can be chained in jdk >= 1.4 this.e = e; message = ex.getMessage(); this.code = code; this.params = params; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> with the specified parameters. * * @param ctx the bridge context to use for determining the element's * source position * @param e the element on which the error occurred * @param ex the exception which was the root-cause for this exception * @param code the error code * @param params the parameters to use for the error message */ public BridgeException(BridgeContext ctx, Element e, Exception ex, String code, Object[] params) { // todo ex can be chained in jdk >= 1.4 this.e = e; message = ex.getMessage(); this.code = code; this.params = params; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> with the specified parameters. * * @param ctx the bridge context to use for determining the element's * source position * @param e the element on which the error occurred * @param ex the exception which was the root-cause for this exception * @param code the error code * @param params the parameters to use for the error message */ public BridgeException(BridgeContext ctx, Element e, Exception ex, String code, Object[] params) { // todo ex can be chained in jdk >= 1.4 this.e = e; message = ex.getMessage(); this.code = code; this.params = params; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * This function creates a new BridgeContext, it mostly * exists so subclasses can provide an instance of * themselves when a sub BridgeContext is needed. */ public BridgeContext createBridgeContext(SVGOMDocument doc) { if (doc.isSVG12()) { return new SVG12BridgeContext(getUserAgent(), getDocumentLoader()); } return new BridgeContext(getUserAgent(), getDocumentLoader()); }
/** * This function creates a new BridgeContext, it mostly * exists so subclasses can provide an instance of * themselves when a sub BridgeContext is needed. */ public BridgeContext createBridgeContext(SVGOMDocument doc) { if (doc.isSVG12()) { return new SVG12BridgeContext(getUserAgent(), getDocumentLoader()); } return new BridgeContext(getUserAgent(), getDocumentLoader()); }
/** * This function creates a new BridgeContext, it mostly * exists so subclasses can provide an instance of * themselves when a sub BridgeContext is needed. */ public BridgeContext createBridgeContext(SVGOMDocument doc) { if (doc.isSVG12()) { return new SVG12BridgeContext(getUserAgent(), getDocumentLoader()); } return new BridgeContext(getUserAgent(), getDocumentLoader()); }
/** * Runs the script. */ public void handleEvent(Event evt) { Element elt = (Element)evt.getCurrentTarget(); // Evaluate the script String script = elt.getAttributeNS(null, attribute); if (script.length() == 0) return; DocumentLoader dl = bridgeContext.getDocumentLoader(); SVGDocument d = (SVGDocument)elt.getOwnerDocument(); int line = dl.getLineNumber(elt); final String desc = Messages.formatMessage (EVENT_SCRIPT_DESCRIPTION, new Object [] {d.getURL(), attribute, new Integer(line)}); // Find the scripting language Element e = elt; while (e != null && (!SVGConstants.SVG_NAMESPACE_URI.equals (e.getNamespaceURI()) || !SVGConstants.SVG_SVG_TAG.equals(e.getLocalName()))) { e = SVGUtilities.getParentElement(e); } if (e == null) return; String lang = e.getAttributeNS (null, SVGConstants.SVG_CONTENT_SCRIPT_TYPE_ATTRIBUTE); runEventHandler(script, evt, lang, desc); } }
/** * Runs the script. */ public void handleEvent(Event evt) { Element elt = (Element)evt.getCurrentTarget(); // Evaluate the script String script = elt.getAttributeNS(null, attribute); if (script.length() == 0) return; DocumentLoader dl = bridgeContext.getDocumentLoader(); SVGDocument d = (SVGDocument)elt.getOwnerDocument(); int line = dl.getLineNumber(elt); final String desc = Messages.formatMessage (EVENT_SCRIPT_DESCRIPTION, new Object [] {d.getURL(), attribute, line}); // Find the scripting language Element e = elt; while (e != null && (!SVGConstants.SVG_NAMESPACE_URI.equals (e.getNamespaceURI()) || !SVGConstants.SVG_SVG_TAG.equals(e.getLocalName()))) { e = SVGUtilities.getParentElement(e); } if (e == null) return; String lang = e.getAttributeNS (null, SVGConstants.SVG_CONTENT_SCRIPT_TYPE_ATTRIBUTE); runEventHandler(script, evt, lang, desc); } }
/** * Runs the script. */ public void handleEvent(Event evt) { Element elt = (Element)evt.getCurrentTarget(); // Evaluate the script String script = elt.getAttributeNS(null, attribute); if (script.length() == 0) return; DocumentLoader dl = bridgeContext.getDocumentLoader(); SVGDocument d = (SVGDocument)elt.getOwnerDocument(); int line = dl.getLineNumber(elt); final String desc = Messages.formatMessage (EVENT_SCRIPT_DESCRIPTION, new Object [] {d.getURL(), attribute, line}); // Find the scripting language Element e = elt; while (e != null && (!SVGConstants.SVG_NAMESPACE_URI.equals (e.getNamespaceURI()) || !SVGConstants.SVG_SVG_TAG.equals(e.getLocalName()))) { e = SVGUtilities.getParentElement(e); } if (e == null) return; String lang = e.getAttributeNS (null, SVGConstants.SVG_CONTENT_SCRIPT_TYPE_ATTRIBUTE); runEventHandler(script, evt, lang, desc); } }
return; DocumentLoader dl = bridgeContext.getDocumentLoader(); AbstractDocument d = (AbstractDocument) handlerElement.getOwnerDocument();
return; DocumentLoader dl = bridgeContext.getDocumentLoader(); AbstractDocument d = (AbstractDocument) handlerElement.getOwnerDocument();
/** * Constructs a new <code>BridgeException</code> based on the specified * <code>LiveAttributeException</code>. * * @param ctx the bridge context to use for determining the element's * source position * @param ex the {@link LiveAttributeException} */ public BridgeException(BridgeContext ctx, LiveAttributeException ex) { switch (ex.getCode()) { case LiveAttributeException.ERR_ATTRIBUTE_MISSING: this.code = ErrorConstants.ERR_ATTRIBUTE_MISSING; break; case LiveAttributeException.ERR_ATTRIBUTE_MALFORMED: this.code = ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED; break; case LiveAttributeException.ERR_ATTRIBUTE_NEGATIVE: this.code = ErrorConstants.ERR_LENGTH_NEGATIVE; break; default: throw new IllegalStateException ("Unknown LiveAttributeException error code " + ex.getCode()); } this.e = ex.getElement(); this.params = new Object[] { ex.getAttributeName(), ex.getValue() }; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> based on the specified * <code>LiveAttributeException</code>. * * @param ctx the bridge context to use for determining the element's * source position * @param ex the {@link LiveAttributeException} */ public BridgeException(BridgeContext ctx, LiveAttributeException ex) { switch (ex.getCode()) { case LiveAttributeException.ERR_ATTRIBUTE_MISSING: this.code = ErrorConstants.ERR_ATTRIBUTE_MISSING; break; case LiveAttributeException.ERR_ATTRIBUTE_MALFORMED: this.code = ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED; break; case LiveAttributeException.ERR_ATTRIBUTE_NEGATIVE: this.code = ErrorConstants.ERR_LENGTH_NEGATIVE; break; default: throw new IllegalStateException ("Unknown LiveAttributeException error code " + ex.getCode()); } this.e = ex.getElement(); this.params = new Object[] { ex.getAttributeName(), ex.getValue() }; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> based on the specified * <code>LiveAttributeException</code>. * * @param ctx the bridge context to use for determining the element's * source position * @param ex the {@link LiveAttributeException} */ public BridgeException(BridgeContext ctx, LiveAttributeException ex) { switch (ex.getCode()) { case LiveAttributeException.ERR_ATTRIBUTE_MISSING: this.code = ErrorConstants.ERR_ATTRIBUTE_MISSING; break; case LiveAttributeException.ERR_ATTRIBUTE_MALFORMED: this.code = ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED; break; case LiveAttributeException.ERR_ATTRIBUTE_NEGATIVE: this.code = ErrorConstants.ERR_LENGTH_NEGATIVE; break; default: throw new IllegalStateException ("Unknown LiveAttributeException error code " + ex.getCode()); } this.e = ex.getElement(); this.params = new Object[] { ex.getAttributeName(), ex.getValue() }; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }