Created
August 24, 2015 16:04
-
-
Save sbeitzel/8013792bf8c3bf20fdcd to your computer and use it in GitHub Desktop.
Why do I have to write this code? ListDataEvent has the type. Why are there three different methods to call on the listener? The *listener* should unpack the event!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void notifyListeners(ListDataEvent lde) { | |
synchronized (_listeners) { | |
for (ListDataListener ldl : _listeners) { | |
switch (lde.getType()) { | |
case ListDataEvent.CONTENTS_CHANGED: | |
ldl.contentsChanged(lde); | |
break; | |
case ListDataEvent.INTERVAL_ADDED: | |
ldl.intervalAdded(lde); | |
break; | |
case ListDataEvent.INTERVAL_REMOVED: | |
ldl.intervalRemoved(lde); | |
break; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment