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