public void dispatchEvent(DataChangeEvent event) { if (eventsEnabled) { // dispatch events only for connected datas for (DataChangeListener listener : listeners) { if (listener == null) { logger.error("One of the DataChangeListeners listeners was null."); } else { logger.debug("Notifying DataChangeListener " + listener.toString()); } try { listener.dataChanged(event); } catch (RuntimeException e) { // we will not let GUI problems to stop important DataBean manipulation operations // and possibly lead to DataBean model corruption logger.error("DataChangeEvent dispatch failed", e); } } } }
public void fireDataChange() { for (DataChangeListener dcl : listenerDataChanged) { dcl.dataChanged(this); } }