n--; listeners = null; listenersNS.remove(namespaceURI);
/** * Adds a listener. */ public void addListener(String namespaceURI, Object group, EventListener listener) { for (Entry e = head; e != null; e = e.next) { if ((namespaceURI != null && namespaceURI.equals(e.namespaceURI) || namespaceURI == null && e.namespaceURI == null) && e.listener == listener) { // Listener is already in the list, so do nothing. return; } } head = new Entry(listener, namespaceURI, group, head); counts.inc(namespaceURI); n++; listeners = null; listenersNS.remove(namespaceURI); }
/** * 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); } }
/** * 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); } } }