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);
}
}
}
}
}
}
Aggregations