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