/**
* Adds the scripting listeners to the given element.
*/
protected void addScriptingListenersOn(Element elt) {
// Attach the listeners
NodeEventTarget target = (NodeEventTarget)elt;
if (SVGConstants.SVG_NAMESPACE_URI.equals(elt.getNamespaceURI())) {
if (SVGConstants.SVG_SVG_TAG.equals(elt.getLocalName())) {
// <svg> listeners
if (elt.hasAttributeNS(null, "onabort")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "SVGAbort",
svgAbortListener, false, null);
}
if (elt.hasAttributeNS(null, "onerror")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "SVGError",
svgErrorListener, false, null);
}
if (elt.hasAttributeNS(null, "onresize")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "SVGResize",
svgResizeListener, false, null);
}
if (elt.hasAttributeNS(null, "onscroll")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "SVGScroll",
svgScrollListener, false, null);
}
if (elt.hasAttributeNS(null, "onunload")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "SVGUnload",
svgUnloadListener, false, null);
}
if (elt.hasAttributeNS(null, "onzoom")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "SVGZoom",
svgZoomListener, false, null);
}
} else {
String name = elt.getLocalName();
if (name.equals(SVGConstants.SVG_SET_TAG) ||
name.startsWith("animate")) {
// animation listeners
if (elt.hasAttributeNS(null, "onbegin")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "beginEvent",
beginListener, false, null);
}
if (elt.hasAttributeNS(null, "onend")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "endEvent",
endListener, false, null);
}
if (elt.hasAttributeNS(null, "onrepeat")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "repeatEvent",
repeatListener, false, null);
}
return;
}
}
}
// UI listeners
if (elt.hasAttributeNS(null, "onfocusin")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "DOMFocusIn",
focusinListener, false, null);
}
if (elt.hasAttributeNS(null, "onfocusout")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "DOMFocusOut",
focusoutListener, false, null);
}
if (elt.hasAttributeNS(null, "onactivate")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "DOMActivate",
activateListener, false, null);
}
if (elt.hasAttributeNS(null, "onclick")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "click",
clickListener, false, null);
}
if (elt.hasAttributeNS(null, "onmousedown")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "mousedown",
mousedownListener, false, null);
}
if (elt.hasAttributeNS(null, "onmouseup")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "mouseup",
mouseupListener, false, null);
}
if (elt.hasAttributeNS(null, "onmouseover")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "mouseover",
mouseoverListener, false, null);
}
if (elt.hasAttributeNS(null, "onmouseout")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "mouseout",
mouseoutListener, false, null);
}
if (elt.hasAttributeNS(null, "onmousemove")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "mousemove",
mousemoveListener, false, null);
}
if (elt.hasAttributeNS(null, "onkeypress")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "keypress",
keypressListener, false, null);
}
if (elt.hasAttributeNS(null, "onkeydown")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "keydown",
keydownListener, false, null);
}
if (elt.hasAttributeNS(null, "onkeyup")) {
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "keyup",
keyupListener, false, null);
}
}