@Override
public <T extends EventObject> void addListener(EventId<T> type, Listener<T> listener) {
if (listener != null) {
EventCollection<T> eventCollection = get(type);
if (listener.isEager() && eventCollection.lastEvent != null) {
EventExecutionMode mode = listener.getMode();
if (mode == EventExecutionMode.ASYNC_IN_SWING || mode == EventExecutionMode.NORMAL_IN_SWING) {
inSwing(listener, eventCollection.lastEvent, true);
} else {
async(listener, eventCollection.lastEvent);
}