|
@@ -1,73 +1,73 @@ |
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.ui.*; |
20 |
|
- |
|
21 |
|
- |
/** |
22 |
|
- |
* A pluggable event handler which processes delegated events from |
23 |
|
- |
* {@link com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt.user.client.Event) |
24 |
|
- |
* Widget.onBrowserEvent(Event)}. Controllers are typically created via a |
25 |
|
- |
* factory method in the widget. Controllers can be added to and removed from |
26 |
|
- |
* the widget at any time by calling {@link #plugIn(Widget)} and |
27 |
|
- |
* {@link #unplug(Widget)}. |
28 |
|
- |
* <p/> |
29 |
|
- |
* Controllers can be used to: |
30 |
|
- |
* <ul> |
31 |
|
- |
* <li>encapsulate browser behavioral differences (controller implementation |
32 |
|
- |
* class can be instantiated via GWT.create())</li> |
33 |
|
- |
* <li>install hooks for unsupported events (e.g. onselectstart)</li> |
34 |
|
- |
* <li>handle dependencies</li> |
35 |
|
- |
* <li>cancel events</li> |
36 |
|
- |
* <li>track state of input operations (e.g. mouse state for drag operation)</li> |
37 |
|
- |
* </ul> |
38 |
|
- |
* <p/> |
39 |
|
- |
* Usage notes: |
40 |
|
- |
* <ul> |
41 |
|
- |
* <li>controllers should only be notified of events which are declared by |
42 |
|
- |
* {@link asquare.gwt.tk.client.ui.behavior.EventDelegate#getEventBits() getEventBits()}</li> |
43 |
|
- |
* <li>controller notification order indeterminate</li> |
44 |
|
- |
* <li>controllers instantiated via deferred binding must have a default |
45 |
|
- |
* constructor</li> |
46 |
|
- |
* <li>stateless controllers can be shared</li> |
47 |
|
- |
* </ul> |
48 |
|
- |
*/ |
49 |
|
- |
public interface Controller extends EventDelegate { |
50 |
|
- |
/** |
51 |
|
- |
* Get the id of this controller. Used for looking up a controller in a |
52 |
|
- |
* collection. Controllers with a single implementation will return the |
53 |
|
- |
* class of the controller. Controllers with multiple implementations will |
54 |
|
- |
* return the class of the interface or base class. |
55 |
|
- |
*/ |
56 |
|
- |
public Class getId(); |
57 |
|
- |
|
58 |
|
- |
/** |
59 |
|
- |
* Called when the widget is attached to the DOM. Use to initialize widget, |
60 |
|
- |
* install special hooks and attach listeners. |
61 |
|
- |
* |
62 |
|
- |
* @param widget the view to control |
63 |
|
- |
*/ |
64 |
|
- |
void plugIn( Widget widget ); |
65 |
|
- |
|
66 |
|
- |
/** |
67 |
|
- |
* Called when the widget is detached from the DOM. Use to remove listeners |
68 |
|
- |
* and null out any references set on the DOM. |
69 |
|
- |
* |
70 |
|
- |
* @param widget |
71 |
|
- |
*/ |
72 |
|
- |
void unplug( Widget widget ); |
73 |
|
- |
} |
|
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.ui.*; |
|
20 |
+ |
|
|
21 |
+ |
/** |
|
22 |
+ |
* A pluggable event handler which processes delegated events from |
|
23 |
+ |
* {@link com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt.user.client.Event) |
|
24 |
+ |
* Widget.onBrowserEvent(Event)}. Controllers are typically created via a |
|
25 |
+ |
* factory method in the widget. Controllers can be added to and removed from |
|
26 |
+ |
* the widget at any time by calling {@link #plugIn(Widget)} and |
|
27 |
+ |
* {@link #unplug(Widget)}. |
|
28 |
+ |
* <p/> |
|
29 |
+ |
* Controllers can be used to: |
|
30 |
+ |
* <ul> |
|
31 |
+ |
* <li>encapsulate browser behavioral differences (controller implementation |
|
32 |
+ |
* class can be instantiated via GWT.create())</li> |
|
33 |
+ |
* <li>install hooks for unsupported events (e.g. onselectstart)</li> |
|
34 |
+ |
* <li>handle dependencies</li> |
|
35 |
+ |
* <li>cancel events</li> |
|
36 |
+ |
* <li>track state of input operations (e.g. mouse state for drag operation)</li> |
|
37 |
+ |
* </ul> |
|
38 |
+ |
* <p/> |
|
39 |
+ |
* Usage notes: |
|
40 |
+ |
* <ul> |
|
41 |
+ |
* <li>controllers should only be notified of events which are declared by |
|
42 |
+ |
* {@link asquare.gwt.tk.client.ui.behavior.EventDelegate#getEventBits() getEventBits()}</li> |
|
43 |
+ |
* <li>controller notification order indeterminate</li> |
|
44 |
+ |
* <li>controllers instantiated via deferred binding must have a default |
|
45 |
+ |
* constructor</li> |
|
46 |
+ |
* <li>stateless controllers can be shared</li> |
|
47 |
+ |
* </ul> |
|
48 |
+ |
*/ |
|
49 |
+ |
public interface Controller extends EventDelegate { |
|
50 |
+ |
/** |
|
51 |
+ |
* Get the id of this controller. Used for looking up a controller in a |
|
52 |
+ |
* collection. Controllers with a single implementation will return the |
|
53 |
+ |
* class of the controller. Controllers with multiple implementations will |
|
54 |
+ |
* return the class of the interface or base class. |
|
55 |
+ |
*/ |
|
56 |
+ |
public Class getId(); |
|
57 |
+ |
|
|
58 |
+ |
/** |
|
59 |
+ |
* Called when the widget is attached to the DOM. Use to initialize widget, |
|
60 |
+ |
* install special hooks and attach listeners. |
|
61 |
+ |
* |
|
62 |
+ |
* @param widget the view to control |
|
63 |
+ |
*/ |
|
64 |
+ |
void plugIn( Widget widget ); |
|
65 |
+ |
|
|
66 |
+ |
/** |
|
67 |
+ |
* Called when the widget is detached from the DOM. Use to remove listeners |
|
68 |
+ |
* and null out any references set on the DOM. |
|
69 |
+ |
* |
|
70 |
+ |
* @param widget |
|
71 |
+ |
*/ |
|
72 |
+ |
void unplug( Widget widget ); |
|
73 |
+ |
} |