1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Implements the action framework."""
17
18
20 """Implements the action framework. This class contains subinterfaces for
21 action handling and listing, and for action handler registrations and
22 unregistration.
23
24 @author: Vaadin Ltd.
25 @author: Richard Lincoln
26 @version: 1.1.2
27 """
28
30 """Constructs a new action with the given caption string and icon.
31
32 @param caption:
33 the caption for the new action.
34 @param icon:
35 the icon for the new action.
36 """
37
38 self._caption = caption
39
40
41 self._icon = icon
42
43
45 return ((self._caption == other.getCaption())
46 and (self._icon == other.getIcon()))
47
48
50 """Returns the action's caption.
51
52 @return: the action's caption as a string.
53 """
54 return self._caption
55
56
58 """Returns the action's icon.
59
60 @return: the action's Icon.
61 """
62 return self._icon
63
64
66 """Sets the caption.
67
68 @param caption:
69 the caption to set.
70 """
71 self._caption = caption
72
73
75 """Sets the icon.
76
77 @param icon:
78 the icon to set.
79 """
80 self._icon = icon
81
82
84 """Interface implemented by all components where actions can be registered.
85 This means that the components lets others to register as action handlers
86 to it. When the component receives an action targeting its contents it
87 should loop all action handlers registered to it and let them handle the
88 action.
89
90 @author: Vaadin Ltd.
91 @author: Richard Lincoln
92 @version: 1.1.2
93 """
94
96 """Registers a new action handler for this container
97
98 @param actionHandler:
99 the new handler to be added.
100 """
101 raise NotImplementedError
102
103
105 """Removes a previously registered action handler for the contents of
106 this container.
107
108 @param actionHandler:
109 the handler to be removed.
110 """
111 raise NotImplementedError
112
113
115 """An Action that implements this interface can be added to an Notifier
116 (or NotifierProxy) via the C{addAction()}-method, which in many cases is
117 easier than implementing the IHandler interface.
118 """
119
121 raise NotImplementedError
122
123
125 """Containers implementing this support an easier way of adding single
126 Actions than the more involved IHandler. The added actions must be
127 Listeners, thus handling the action themselves.
128 """
129
131 raise NotImplementedError
132
133
135 raise NotImplementedError
136
137
139
141 raise NotImplementedError
142
143
145 raise NotImplementedError
146
147
149 """Interface implemented by classes who wish to handle actions.
150
151 @author: Vaadin Ltd.
152 @author: Richard Lincoln
153 @version: 1.1.2
154 """
155
157 """Gets the list of actions applicable to this handler.
158
159 @param target:
160 the target handler to list actions for. For item
161 containers this is the item id.
162 @param sender:
163 the party that would be sending the actions. Most of this
164 is the action container.
165 @return: the list of Action
166 """
167 raise NotImplementedError
168
169
171 """Handles an action for the given target. The handler method may just
172 discard the action if it's not suitable.
173
174 @param a:
175 the action to be handled.
176 @param sender:
177 the sender of the action. This is most often the action
178 container.
179 @param target:
180 the target of the action. For item containers this is the
181 item id.
182 """
183 raise NotImplementedError
184