01: package org.acm.seguin.pmd.swingui.event;
02:
03: import java.util.EventObject;
04: import java.util.Iterator;
05: import java.util.List;
06:
07: public class SearchDirectoryEvent extends EventObject {
08: private String m_searchDirectory;
09:
10: /**
11: *****************************************************************************
12: *
13: * @param source
14: * @param searchDirectory
15: */
16: private SearchDirectoryEvent(Object source, String searchDirectory) {
17: super (source);
18:
19: m_searchDirectory = searchDirectory;
20: }
21:
22: /**
23: *****************************************************************************
24: *
25: * @return
26: */
27: public String getSearchDirectory() {
28: return m_searchDirectory;
29: }
30:
31: /**
32: *****************************************************************************
33: *
34: * @param source
35: */
36: public static final void notifySetSearchDirectory(Object source,
37: String searchDirectory) {
38: SearchDirectoryEvent event = new SearchDirectoryEvent(source,
39: searchDirectory);
40: List listenerList = ListenerList
41: .getListeners(SearchDirectoryEventListener.class);
42: Iterator listeners = listenerList.iterator();
43:
44: while (listeners.hasNext()) {
45: SearchDirectoryEventListener listener;
46:
47: listener = (SearchDirectoryEventListener) listeners.next();
48: listener.setSearchDirectory(event);
49: }
50: }
51: }
|