public void removeItsNatNormalEventListener( ItsNatNormalEventListenerWrapperImpl listenerWrapper) { EventTarget target = listenerWrapper.getCurrentTarget(); ItsNatNormalEventListenerListSameTarget targetList = (ItsNatNormalEventListenerListSameTarget) eventListenersByTarget.get(target); if (targetList == null) return; targetList.removeItsNatNormalEventListener(listenerWrapper); if (targetList.isEmpty()) eventListenersByTarget.remove(target); }
public ItsNatNormalEventListenerWrapperImpl removeItsNatNormalEventListener( EventTarget target, String type, EventListener listener, boolean useCapture) { ItsNatNormalEventListenerListSameTarget targetList = (ItsNatNormalEventListenerListSameTarget) eventListenersByTarget.get(target); if (targetList == null) return null; ItsNatNormalEventListenerWrapperImpl listenerWrapper = targetList.removeItsNatNormalEventListener(type, useCapture, listener); if (targetList.isEmpty()) eventListenersByTarget.remove(target); return listenerWrapper; }
public void addItsNatNormalEventListener(ItsNatNormalEventListenerWrapperImpl listenerWrapper) { EventTarget target = listenerWrapper.getCurrentTarget(); ItsNatNormalEventListenerListSameTarget targetList = (ItsNatNormalEventListenerListSameTarget) eventListenersByTarget.get(target); if (targetList == null) { targetList = new ItsNatNormalEventListenerListSameTarget(); eventListenersByTarget.put(target, targetList); } targetList.addItsNatNormalEventListener( listenerWrapper.getType(), listenerWrapper.getUseCapture(), listenerWrapper.getEventListener(), listenerWrapper); }
public boolean containsItsNatNormalEventListener( EventTarget target, String type, EventListener listener, boolean useCapture) { ItsNatNormalEventListenerListSameTarget targetList = (ItsNatNormalEventListenerListSameTarget) eventListenersByTarget.get(target); if (targetList == null) return false; return targetList.containsItsNatNormalEventListener(type, useCapture, listener); }
public EventListener[] getEventListenersArrayCopy( EventTarget target, String type, boolean useCapture) { if (!parentRegistry.isValidEventTarget(target, type, false)) return null; // Nos ahorramos la búsqueda ItsNatNormalEventListenerListSameTarget targetList = (ItsNatNormalEventListenerListSameTarget) eventListenersByTarget.get(target); if (targetList == null) return null; return targetList.getEventListenersArrayCopy(type, useCapture); }
public int removeAllItsNatNormalEventListeners(EventTarget target, boolean updateClient) { ItsNatNormalEventListenerListSameTarget targetList = (ItsNatNormalEventListenerListSameTarget) eventListenersByTarget.get(target); if (targetList == null) return 0; LinkedList<Pair> listeners = targetList.getAllItsNatNormalEventListenersCopy(); if (listeners == null) return 0; // "listeners" es una copia por lo que es desechable e inmutable for (Pair pair : listeners) { ItsNatNormalEventListenerWrapperImpl listener = pair.getListenerWrapper(); parentRegistry.removeItsNatNormalEventListener(listener, updateClient, false); } targetList .removeAllItsNatNormalEventListeners(); // No hace falta pero por si acaso y para que quede // claro eventListenersByTarget.remove(target); return listeners.size(); // El número de listeners removidos }
public ItsNatNormalEventListenerListSameTarget getItsNatNormalEventListenersByTarget( EventTarget target) { return (ItsNatNormalEventListenerListSameTarget) eventListenersByTarget.get(target); }