Search in sources :

Example 1 with SimpleEventListenerList

use of org.eclipse.scout.rt.platform.util.event.SimpleEventListenerList in project scout.rt by eclipse.

the class AbstractDesktop method removeDataChangeListener.

@Override
public void removeDataChangeListener(DataChangeListener listener, Object... dataTypes) {
    if (dataTypes == null || dataTypes.length == 0) {
        for (Iterator<SimpleEventListenerList<DataChangeListener>> it = m_dataChangeListenerList.values().iterator(); it.hasNext(); ) {
            SimpleEventListenerList<DataChangeListener> list = it.next();
            list.remove(listener);
            if (list.isEmpty()) {
                it.remove();
            }
        }
    } else {
        for (Object dataType : dataTypes) {
            if (dataType != null) {
                SimpleEventListenerList<DataChangeListener> list = m_dataChangeListenerList.get(dataType);
                if (list != null) {
                    list.remove(listener);
                    if (list.isEmpty()) {
                        m_dataChangeListenerList.remove(dataType);
                    }
                }
            }
        }
    }
}
Also used : DataChangeListener(org.eclipse.scout.rt.client.ui.DataChangeListener) SimpleEventListenerList(org.eclipse.scout.rt.platform.util.event.SimpleEventListenerList) IExtensibleObject(org.eclipse.scout.rt.shared.extension.IExtensibleObject)

Aggregations

DataChangeListener (org.eclipse.scout.rt.client.ui.DataChangeListener)1 SimpleEventListenerList (org.eclipse.scout.rt.platform.util.event.SimpleEventListenerList)1 IExtensibleObject (org.eclipse.scout.rt.shared.extension.IExtensibleObject)1