litesoft
Diff Revisions
592
vs
593
for /trunk/GWT_Sandbox/FormEngine/src/com/temp/foundation/widgets/support/NonDomHandlerManager.java
|
@@ -1,6 +1,8 @@ |
1 |
1 |
|
package com.temp.foundation.widgets.support; |
2 |
2 |
|
|
3 |
3 |
|
import com.google.gwt.event.shared.*; |
|
4 |
+ |
import com.temp.foundation.widgets.support.events.*; |
|
5 |
+ |
import com.temp.shared.utils.*; |
4 |
6 |
|
|
5 |
7 |
|
import java.util.ArrayList; |
6 |
8 |
|
import java.util.List; |
|
@@ -19,10 +21,14 @@ |
19 |
21 |
|
|
20 |
22 |
|
@Override |
21 |
23 |
|
public void fireEvent(GwtEvent<?> event) { |
22 |
|
- |
EventBridge.overrideSource(event, source); |
|
24 |
+ |
if (!(event instanceof NonDomEvent)) { |
|
25 |
+ |
throw new IllegalStateException("NonDomHandlerManager can currently only dispatch Events than implement NonDomEvent"); |
|
26 |
+ |
} |
|
27 |
+ |
NonDomEvent<H> ndEvent = ObjectUtils.cast(event); |
|
28 |
+ |
ndEvent.setSource(source); |
23 |
29 |
|
for (H handler : handlers) { |
24 |
30 |
|
if (handler != null) { |
25 |
|
- |
EventBridge.dispatch(event, handler); |
|
31 |
+ |
ndEvent.dispatch(handler); |
26 |
32 |
|
} |
27 |
33 |
|
} |
28 |
34 |
|
} |