1 package siouxsie.mvc.impl;
2
3 import java.beans.PropertyChangeListener;
4 import java.beans.PropertyChangeSupport;
5 import java.util.Map;
6
7 import siouxsie.mvc.ActionTriggerDescription;
8 import siouxsie.mvc.IActionTrigger;
9
10 /**
11 * Trigger the controller. Can be used in view.
12 * @author Arnaud Cogoluegnes
13 * @version $Id$
14 */
15 @SuppressWarnings("unchecked")
16 public class ActionTrigger implements IActionTrigger {
17
18 private PropertyChangeSupport model = new PropertyChangeSupport(this);
19
20
21 private ActionTriggerDescription _actionTriggerDescription;
22
23
24
25
26
27 public void triggerActionLaunch(String actionName, String nameSpace,
28 Map<?,?> parameters) {
29
30 ActionTriggerDescription old = this._actionTriggerDescription;
31
32 _actionTriggerDescription = new ActionTriggerDescription(
33 actionName,nameSpace,parameters
34 );
35
36
37
38 model.firePropertyChange(
39 IActionTrigger.PROPERTY_ACTION_TRIGGER_DESCRIPTION,
40 old,this._actionTriggerDescription
41 );
42
43
44
45 }
46
47
48
49
50
51 public void addPropertyChangeListener(PropertyChangeListener listener) {
52 model.addPropertyChangeListener(listener);
53 }
54
55
56
57
58
59 public void removePropertyChangeListener(PropertyChangeListener listener) {
60 model.removePropertyChangeListener(listener);
61 }
62
63
64
65
66
67 public ActionTriggerDescription getActionTriggerDescription() {
68 return _actionTriggerDescription;
69 }
70
71 }