1 | Object[] listeners = listenerList.getListenerList();↵ | | 1 | Object[] listeners = listenerList.getListenerList();↵
|
|
| | | 2 |
↵
|
2 | // Process the listeners last to first, notifying↵ | | 3 | // Process the listeners last to first, notifying
↵
|
3 | // those that are interested in this event↵ | | 4 | // those that are interested in this event
↵
|
4 | for (int i = listeners.length - 2; i >= 0; i -= 2) {↵ | | 5 | for (int i = listeners.length - 2; i >= 0; i -= 2) {
↵
|
5 | if (listeners[i] == IResultListener.class) {↵ | | 6 | if (listeners[i] == ITagListener.class) {
↵
|
6 | ((IResultListener) listeners[i + 1]).finished(e);↵ | | 7 | ((ITagListener) listeners[i + 1]).tagChanged(e);
↵
|
7 | }↵ | | 8 | }
↵
|
8 | }↵ | | 9 | }↵
|
| | | 10 |
↵
|
9 | }↵ | | 11 | }↵
|
|
| | | 12 |
↵
|
10 | /**↵ | | 13 | /**
↵
|
11 | * Propagates an event to all registered listeners↵ | | 14 | * @param id
↵
|
12 | */↵ | | 15 | */
↵
|
13 | protected void fireClearSearch(String searchTerm) {↵ | | 16 | protected void fireTagAddedEvent(String id) {↵
|
| | | 17 |
↵
|
14 | IResultEvent e = new ResultEvent(this, searchTerm);↵ | | 18 | ITagEvent e = new TagEvent(this, id);
↵
|
15 | // Guaranteed to return a non-null array↵ | | 19 | // Guaranteed to return a non-null array
↵
|
16 | Object[] listeners = listenerList.getListenerList();↵ | | 20 | Object[] listeners = listenerList.getListenerList();↵
|
|
| | | 21 |
↵
|
17 | // Process the listeners last to first, notifying↵ | | 22 | // Process the listeners last to first, notifying
↵
|
18 | // those that are interested in this event↵ | | 23 | // those that are interested in this event
↵
|
19 | for (int i = listeners.length - 2; i >= 0; i -= 2) {↵ | | 24 | for (int i = listeners.length - 2; i >= 0; i -= 2) {
↵
|
20 | if (listeners[i] == IResultListener.class) {↵ | | 25 | if (listeners[i] == ITagListener.class) {
↵
|
21 | ((IResultListener) listeners[i + 1]).clearSearch(e);↵ | | 26 | ((ITagListener) listeners[i + 1]).tagAdded(e);
↵
|
22 | }↵ | | 27 | }
↵
|
23 | }↵ | | 28 | }
↵
|
24 | } | | 29 | }
|