/** * Registers an event listener that will not be stopped by the usual * XBL stopping. */ public void addImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashMap<String, EventListenerList> listeners; if (useCapture) { if (capturingImplementationListeners == null) { capturingImplementationListeners = new HashMap<String, EventListenerList>(); } listeners = capturingImplementationListeners; } else { if (bubblingImplementationListeners == null) { bubblingImplementationListeners = new HashMap<String, EventListenerList>(); } listeners = bubblingImplementationListeners; } EventListenerList list = listeners.get(type); if (list == null) { list = new EventListenerList(); listeners.put(type, list); } list.addListener(namespaceURI, null, listener); }
/** * Returns an array of EventListeners that match the given namespace URI. */ public Entry[] getEventListeners(String namespaceURI) { if (namespaceURI == null) { return getEventListeners(); } Entry[] ls = (Entry[]) listenersNS.get(namespaceURI); if (ls != null) { return ls; } int count = counts.get(namespaceURI); if (count == 0) { return null; } ls = new Entry[count]; listenersNS.put(namespaceURI, ls); int i = 0; for (Entry e = head; i < count; e = e.next) { if (namespaceURI.equals(e.namespaceURI)) { ls[i++] = e; } } return ls; }
/** * Unregisters an implementation event listener. */ public void removeImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashMap<String, EventListenerList> listeners = useCapture ? capturingImplementationListeners : bubblingImplementationListeners; if (listeners == null) { return; } EventListenerList list = listeners.get(type); if (list == null) { return; } list.removeListener(namespaceURI, listener); if (list.size() == 0) { listeners.remove(type); } }
/** * Returns whether this node target has an event listener for the * given event namespace URI and type. */ public boolean hasEventListenerNS(String namespaceURI, String type) { if (capturingListeners != null) { EventListenerList ell = capturingListeners.get(type); if (ell != null) { if (ell.hasEventListener(namespaceURI)) { return true; } } } if (bubblingListeners != null) { EventListenerList ell = capturingListeners.get(type); if (ell != null) { return ell.hasEventListener(namespaceURI); } } return false; }
/** * Returns whether this node target has an event listener for the * given event namespace URI and type. */ public boolean hasEventListenerNS(String namespaceURI, String type) { if (capturingListeners != null) { EventListenerList ell = capturingListeners.get(type); if (ell != null) { if (ell.hasEventListener(namespaceURI)) { return true; } } } if (bubblingListeners != null) { EventListenerList ell = capturingListeners.get(type); if (ell != null) { return ell.hasEventListener(namespaceURI); } } return false; }
/** * Unregisters an implementation event listener. */ public void removeImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashMap<String, EventListenerList> listeners = useCapture ? capturingImplementationListeners : bubblingImplementationListeners; if (listeners == null) { return; } EventListenerList list = listeners.get(type); if (list == null) { return; } list.removeListener(namespaceURI, listener); if (list.size() == 0) { listeners.remove(type); } }
/** * Registers an event listener for the given namespaced event type * in the specified group. */ public void addEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture, Object group) { HashMap<String, EventListenerList> listeners; if (useCapture) { if (capturingListeners == null) { capturingListeners = new HashMap(); } listeners = capturingListeners; } else { if (bubblingListeners == null) { bubblingListeners = new HashMap(); } listeners = bubblingListeners; } EventListenerList list = listeners.get(type); if (list == null) { list = new EventListenerList(); listeners.put(type, list); } list.addListener(namespaceURI, group, listener); }
/** * Returns an array of EventListeners that match the given namespace URI. */ public Entry[] getEventListeners(String namespaceURI) { if (namespaceURI == null) { return getEventListeners(); } Entry[] ls = (Entry[]) listenersNS.get(namespaceURI); if (ls != null) { return ls; } int count = counts.get(namespaceURI); if (count == 0) { return null; } ls = new Entry[count]; listenersNS.put(namespaceURI, ls); int i = 0; for (Entry e = head; i < count; e = e.next) { if (namespaceURI.equals(e.namespaceURI)) { ls[i++] = e; } } return ls; }
/** * Returns whether this node target has an event listener for the * given event namespace URI and type. */ public boolean hasEventListenerNS(String namespaceURI, String type) { if (capturingListeners != null) { EventListenerList ell = (EventListenerList) capturingListeners.get(type); if (ell != null) { if (ell.hasEventListener(namespaceURI)) { return true; } } } if (bubblingListeners != null) { EventListenerList ell = (EventListenerList) capturingListeners.get(type); if (ell != null) { return ell.hasEventListener(namespaceURI); } } return false; }
/** * Deregisters an event listener. */ public void removeEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashMap<String, EventListenerList> listeners; if (useCapture) { listeners = capturingListeners; } else { listeners = bubblingListeners; } if (listeners == null) { return; } EventListenerList list = listeners.get(type); if (list != null) { list.removeListener(namespaceURI, listener); if (list.size() == 0) { listeners.remove(type); } } }
/** * Registers an event listener that will not be stopped by the usual * XBL stopping. */ public void addImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashMap<String, EventListenerList> listeners; if (useCapture) { if (capturingImplementationListeners == null) { capturingImplementationListeners = new HashMap<String, EventListenerList>(); } listeners = capturingImplementationListeners; } else { if (bubblingImplementationListeners == null) { bubblingImplementationListeners = new HashMap<String, EventListenerList>(); } listeners = bubblingImplementationListeners; } EventListenerList list = listeners.get(type); if (list == null) { list = new EventListenerList(); listeners.put(type, list); } list.addListener(namespaceURI, null, listener); }
/** * Returns an array of EventListeners that match the given namespace URI. */ public Entry[] getEventListeners(String namespaceURI) { if (namespaceURI == null) { return getEventListeners(); } Entry[] ls = (Entry[]) listenersNS.get(namespaceURI); if (ls != null) { return ls; } int count = counts.get(namespaceURI); if (count == 0) { return null; } ls = new Entry[count]; listenersNS.put(namespaceURI, ls); int i = 0; for (Entry e = head; i < count; e = e.next) { if (namespaceURI.equals(e.namespaceURI)) { ls[i++] = e; } } return ls; }
/** * Deregisters an event listener. */ public void removeEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashMap<String, EventListenerList> listeners; if (useCapture) { listeners = capturingListeners; } else { listeners = bubblingListeners; } if (listeners == null) { return; } EventListenerList list = listeners.get(type); if (list != null) { list.removeListener(namespaceURI, listener); if (list.size() == 0) { listeners.remove(type); } } }
/** * Registers an event listener for the given namespaced event type * in the specified group. */ public void addEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture, Object group) { HashMap<String, EventListenerList> listeners; if (useCapture) { if (capturingListeners == null) { capturingListeners = new HashMap(); } listeners = capturingListeners; } else { if (bubblingListeners == null) { bubblingListeners = new HashMap(); } listeners = bubblingListeners; } EventListenerList list = listeners.get(type); if (list == null) { list = new EventListenerList(); listeners.put(type, list); } list.addListener(namespaceURI, group, listener); }
EventListenerList.Entry[] listeners = list.getEventListeners(); fireEventListeners(node, e, listeners, stoppedGroups, toBeStoppedGroups);
/** * Unregisters an implementation event listener. */ public void removeImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashTable listeners = useCapture ? capturingImplementationListeners : bubblingImplementationListeners; if (listeners == null) { return; } EventListenerList list = (EventListenerList) listeners.get(type); if (list == null) { return; } list.removeListener(namespaceURI, listener); if (list.size() == 0) { listeners.remove(type); } }
/** * Registers an event listener for the given namespaced event type * in the specified group. */ public void addEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture, Object group) { HashTable listeners; if (useCapture) { if (capturingListeners == null) { capturingListeners = new HashTable(); } listeners = capturingListeners; } else { if (bubblingListeners == null) { bubblingListeners = new HashTable(); } listeners = bubblingListeners; } EventListenerList list = (EventListenerList) listeners.get(type); if (list == null) { list = new EventListenerList(); listeners.put(type, list); } list.addListener(namespaceURI, group, listener); }
EventListenerList.Entry[] listeners = list.getEventListeners(); fireEventListeners(node, e, listeners, stoppedGroups, toBeStoppedGroups);
/** * Deregisters an event listener. */ public void removeEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashTable listeners; if (useCapture) { listeners = capturingListeners; } else { listeners = bubblingListeners; } if (listeners == null) { return; } EventListenerList list = (EventListenerList) listeners.get(type); if (list != null) { list.removeListener(namespaceURI, listener); if (list.size() == 0) { listeners.remove(type); } } }
/** * Registers an event listener that will not be stopped by the usual * XBL stopping. */ public void addImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashTable listeners; if (useCapture) { if (capturingImplementationListeners == null) { capturingImplementationListeners = new HashTable(); } listeners = capturingImplementationListeners; } else { if (bubblingImplementationListeners == null) { bubblingImplementationListeners = new HashTable(); } listeners = bubblingImplementationListeners; } EventListenerList list = (EventListenerList) listeners.get(type); if (list == null) { list = new EventListenerList(); listeners.put(type, list); } list.addListener(namespaceURI, null, listener); }