1 | void addPreActionListener(Class action, ActionListener listener) {↵ | | 1 | void addPreActionListener(Class action, ActionListener listener) {↵
|
2 | if (action != null) {↵ | | 2 | if (action != null) {↵
|
3 | HashSet set = (HashSet) preActionListeners.get(action.getName());↵ | | 3 | HashSet set = (HashSet) preActionListeners.get(action.getName());↵
|
4 | if (set == null) {↵ | | 4 | if (set == null) {↵
|
5 | set = new HashSet();↵ | | 5 | set = new HashSet();↵
|
6 | }↵ | | 6 | }↵
|
7 | set.add(listener);↵ | | 7 | set.add(listener);↵
|
8 | preActionListeners.put(action.getName(), set);↵ | | 8 | preActionListeners.put(action.getName(), set);↵
|
9 | }↵ | | 9 | }↵
|
10 | }↵ | | 10 | }↵
|
|
11 | /**↵ | | 11 | /**↵
|
12 | * Allows an ActionListener to be removed from receiving notifications of a↵ | | 12 | * Allows an ActionListener to be removed from receiving notifications of a↵
|
13 | * command being executed prior to the actual execution of the command.↵ | | 13 | * command being executed prior to the actual execution of the command.↵
|
14 | * ↵ | | 14 | * ↵
|
15 | * @param action↵ | | 15 | * @param action↵
|
16 | * the Class of the command for which the listener will↵ | | 16 | * the Class of the command for which the listener will↵
|
17 | * notifications for. Class must extend↵ | | 17 | * notifications for. Class must extend↵
|
18 | * org.apache.jmeter.report.gui.action.Command.↵ | | 18 | * org.apache.jmeter.gui.action.Command.↵
|
19 | * @param listener↵ | | 19 | * @param listener↵
|
20 | * the ActionListener to receive the notifications↵ | | 20 | * the ActionListener to receive the notifications↵
|
21 | */↵ | | 21 | */↵
|
22 | public void removePreActionListener(Class action, ActionListener listener) {↵ | | 22 | public void removePreActionListener(Class action, ActionListener listener) {↵
|
23 | if (action != null) {↵ | | 23 | if (action != null) {↵
|
24 | HashSet set = (HashSet) preActionListeners.get(action.getName());↵ | | 24 | HashSet set = (HashSet) preActionListeners.get(action.getName());↵
|
25 | if (set != null) {↵ | | 25 | if (set != null) {↵
|
26 | set.remove(listener);↵ | | 26 | set.remove(listener);↵
|
27 | preActionListeners.put(action.getName(), set);↵ | | 27 | preActionListeners.put(action.getName(), set);↵
|
28 | }↵ | | 28 | }↵
|
29 | }↵ | | 29 | }↵
|
30 | | | 30 |
|