|
@@ -1,71 +1,71 @@ |
1 |
|
- |
// This Source Code is Copyright & Licenced as indicated below |
2 |
|
- |
package org.litesoft.GWT.client.widgets.nonpublic.external; |
3 |
|
- |
/* |
4 |
|
- |
* Copyright 2006 Mat Gessel <mat.gessel@gmail.com> |
5 |
|
- |
* |
6 |
|
- |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
7 |
|
- |
* use this file except in compliance with the License. You may obtain a copy of |
8 |
|
- |
* the License at |
9 |
|
- |
* |
10 |
|
- |
* http://www.apache.org/licenses/LICENSE-2.0 |
11 |
|
- |
* |
12 |
|
- |
* Unless required by applicable law or agreed to in writing, software |
13 |
|
- |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
14 |
|
- |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
15 |
|
- |
* License for the specific language governing permissions and limitations under |
16 |
|
- |
* the License. |
17 |
|
- |
*/ |
18 |
|
- |
|
19 |
|
- |
import com.google.gwt.user.client.EventListener; |
20 |
|
- |
import com.google.gwt.user.client.ui.*; |
21 |
|
- |
|
22 |
|
- |
import java.util.*; |
23 |
|
- |
|
24 |
|
- |
/** |
25 |
|
- |
* An interface implemented by widgets which support event handling via |
26 |
|
- |
* controllers. |
27 |
|
- |
*/ |
28 |
|
- |
public interface ControllerSupport extends EventListener { |
29 |
|
- |
/** |
30 |
|
- |
* Sets the controllers which will process events on this widget. Clears out |
31 |
|
- |
* the current controllers, if any. When the widget is added to the DOM, |
32 |
|
- |
* received events will be delegated to each controller which declares the |
33 |
|
- |
* event's type via |
34 |
|
- |
* {@link asquare.gwt.tk.client.ui.behavior.EventDelegate#getEventBits() getEventBits()}. |
35 |
|
- |
* |
36 |
|
- |
* @param controllers a list of 0 or more controllers, or <code>null</code> |
37 |
|
- |
*/ |
38 |
|
- |
void setControllers( List controllers ); |
39 |
|
- |
|
40 |
|
- |
/** |
41 |
|
- |
* Gets a controller with the specified id. The id is often an interface or |
42 |
|
- |
* base class, as controllers can have multiple implementations. Used to |
43 |
|
- |
* modify the behavior of existing widgets. |
44 |
|
- |
* |
45 |
|
- |
* @param id a Class identifying the type of controller to get |
46 |
|
- |
* |
47 |
|
- |
* @return the first controller matching the id, or <code>null</code> |
48 |
|
- |
*/ |
49 |
|
- |
Controller getController( Class id ); |
50 |
|
- |
|
51 |
|
- |
/** |
52 |
|
- |
* Adds a controller to process events on this widget. Multiple controllers |
53 |
|
- |
* may be added. |
54 |
|
- |
* |
55 |
|
- |
* @param controller a controller to add |
56 |
|
- |
* |
57 |
|
- |
* @return the widget this call was made on (for convenience) |
58 |
|
- |
*/ |
59 |
|
- |
Widget addController( Controller controller ); |
60 |
|
- |
|
61 |
|
- |
/** |
62 |
|
- |
* Removes a controller |
63 |
|
- |
* |
64 |
|
- |
* @param controller a controller to remove |
65 |
|
- |
* |
66 |
|
- |
* @return the widget this call was made on (for convenience) |
67 |
|
- |
* |
68 |
|
- |
* @throws IllegalArgumentException if <code>controller</code> is not present |
69 |
|
- |
*/ |
70 |
|
- |
Widget removeController( Controller controller ); |
71 |
|
- |
} |
|
1 |
+ |
// This Source Code is Copyright & Licenced as indicated below |
|
2 |
+ |
package org.litesoft.GWT.client.widgets.nonpublic.external; |
|
3 |
+ |
/* |
|
4 |
+ |
* Copyright 2006 Mat Gessel <mat.gessel@gmail.com> |
|
5 |
+ |
* |
|
6 |
+ |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
|
7 |
+ |
* use this file except in compliance with the License. You may obtain a copy of |
|
8 |
+ |
* the License at |
|
9 |
+ |
* |
|
10 |
+ |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
11 |
+ |
* |
|
12 |
+ |
* Unless required by applicable law or agreed to in writing, software |
|
13 |
+ |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
|
14 |
+ |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
|
15 |
+ |
* License for the specific language governing permissions and limitations under |
|
16 |
+ |
* the License. |
|
17 |
+ |
*/ |
|
18 |
+ |
|
|
19 |
+ |
import com.google.gwt.user.client.EventListener; |
|
20 |
+ |
import com.google.gwt.user.client.ui.*; |
|
21 |
+ |
|
|
22 |
+ |
import java.util.*; |
|
23 |
+ |
|
|
24 |
+ |
/** |
|
25 |
+ |
* An interface implemented by widgets which support event handling via |
|
26 |
+ |
* controllers. |
|
27 |
+ |
*/ |
|
28 |
+ |
public interface ControllerSupport extends EventListener { |
|
29 |
+ |
/** |
|
30 |
+ |
* Sets the controllers which will process events on this widget. Clears out |
|
31 |
+ |
* the current controllers, if any. When the widget is added to the DOM, |
|
32 |
+ |
* received events will be delegated to each controller which declares the |
|
33 |
+ |
* event's type via |
|
34 |
+ |
* {@link asquare.gwt.tk.client.ui.behavior.EventDelegate#getEventBits() getEventBits()}. |
|
35 |
+ |
* |
|
36 |
+ |
* @param controllers a list of 0 or more controllers, or <code>null</code> |
|
37 |
+ |
*/ |
|
38 |
+ |
void setControllers( List controllers ); |
|
39 |
+ |
|
|
40 |
+ |
/** |
|
41 |
+ |
* Gets a controller with the specified id. The id is often an interface or |
|
42 |
+ |
* base class, as controllers can have multiple implementations. Used to |
|
43 |
+ |
* modify the behavior of existing widgets. |
|
44 |
+ |
* |
|
45 |
+ |
* @param id a Class identifying the type of controller to get |
|
46 |
+ |
* |
|
47 |
+ |
* @return the first controller matching the id, or <code>null</code> |
|
48 |
+ |
*/ |
|
49 |
+ |
Controller getController( Class id ); |
|
50 |
+ |
|
|
51 |
+ |
/** |
|
52 |
+ |
* Adds a controller to process events on this widget. Multiple controllers |
|
53 |
+ |
* may be added. |
|
54 |
+ |
* |
|
55 |
+ |
* @param controller a controller to add |
|
56 |
+ |
* |
|
57 |
+ |
* @return the widget this call was made on (for convenience) |
|
58 |
+ |
*/ |
|
59 |
+ |
Widget addController( Controller controller ); |
|
60 |
+ |
|
|
61 |
+ |
/** |
|
62 |
+ |
* Removes a controller |
|
63 |
+ |
* |
|
64 |
+ |
* @param controller a controller to remove |
|
65 |
+ |
* |
|
66 |
+ |
* @return the widget this call was made on (for convenience) |
|
67 |
+ |
* |
|
68 |
+ |
* @throws IllegalArgumentException if <code>controller</code> is not present |
|
69 |
+ |
*/ |
|
70 |
+ |
Widget removeController( Controller controller ); |
|
71 |
+ |
} |