|
@@ -1,66 +1,66 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.eventbus.client; |
3 |
|
- |
|
4 |
|
- |
public class NativeClientEventBusSupport { |
5 |
|
- |
public static native void export() /*-{ |
6 |
|
- |
|
7 |
|
- |
$wnd.initializeEventBus = function ( pEncodedClientId ) |
8 |
|
- |
{ |
9 |
|
- |
try |
10 |
|
- |
{ |
11 |
|
- |
@org.litesoft.GWT.eventbus.client.AbstractClientEventBusApp::initializeEventBus(Ljava/lang/String;)( pEncodedClientId ); |
12 |
|
- |
} |
13 |
|
- |
catch ( e ) |
14 |
|
- |
{ |
15 |
|
- |
alert( "NativeClientEventBusSupport.initializeEventBus\n\n" + e ); |
16 |
|
- |
} |
17 |
|
- |
} |
18 |
|
- |
$wnd.pollEventBus = function () |
19 |
|
- |
{ |
20 |
|
- |
try |
21 |
|
- |
{ |
22 |
|
- |
// pCeb.@org.litesoft.GWT.eventbus.client.nonpublic.ClientEventBus::pollNow()(); |
23 |
|
- |
@org.litesoft.GWT.eventbus.client.AbstractClientEventBusApp::pollEventBus()(); |
24 |
|
- |
} |
25 |
|
- |
catch ( e ) |
26 |
|
- |
{ |
27 |
|
- |
alert( "NativeClientEventBusSupport.pollEventBus\n\n" + e ); |
28 |
|
- |
} |
29 |
|
- |
}; |
30 |
|
- |
$wnd.streamClosed = function () |
31 |
|
- |
{ |
32 |
|
- |
try |
33 |
|
- |
{ |
34 |
|
- |
@org.litesoft.GWT.eventbus.client.AbstractClientEventBusApp::streamClosed()(); |
35 |
|
- |
} |
36 |
|
- |
catch ( e ) |
37 |
|
- |
{ |
38 |
|
- |
alert( "NativeClientEventBusSupport.streamClosed\n\n" + e ); |
39 |
|
- |
} |
40 |
|
- |
}; |
41 |
|
- |
|
42 |
|
- |
// $wnd.clientID = "" + pCeb.@org.litesoft.GWT.eventbus.client.EventBus::getClientIdNumber()(); |
43 |
|
- |
$wnd.getClientID = function () // Flash's ExternalInterface requires a function name |
44 |
|
- |
{ |
45 |
|
- |
try |
46 |
|
- |
{ |
47 |
|
- |
// return $wnd.clientID; |
48 |
|
- |
return @org.litesoft.GWT.eventbus.client.AbstractClientEventBusApp::getClientIdNumber()(); |
49 |
|
- |
} |
50 |
|
- |
catch ( e ) |
51 |
|
- |
{ |
52 |
|
- |
alert( "NativeClientEventBusSupport.getClientID\n\n" + e ); |
53 |
|
- |
} |
54 |
|
- |
} |
55 |
|
- |
}-*/; |
56 |
|
- |
|
57 |
|
- |
/** |
58 |
|
- |
* Just being a bit parnoid about avoiding memory leaks in IE... |
59 |
|
- |
*/ |
60 |
|
- |
public static native void dispose() /*-{ |
61 |
|
- |
$wnd.initializeEventBus = null; |
62 |
|
- |
$wnd.pollEventBus = null; |
63 |
|
- |
$wnd.streamClosed = null; |
64 |
|
- |
$wnd.getClientID = null; |
65 |
|
- |
}-*/; |
66 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.eventbus.client; |
|
3 |
+ |
|
|
4 |
+ |
public class NativeClientEventBusSupport { |
|
5 |
+ |
public static native void export() /*-{ |
|
6 |
+ |
|
|
7 |
+ |
$wnd.initializeEventBus = function ( pEncodedClientId ) |
|
8 |
+ |
{ |
|
9 |
+ |
try |
|
10 |
+ |
{ |
|
11 |
+ |
@org.litesoft.GWT.eventbus.client.AbstractClientEventBusApp::initializeEventBus(Ljava/lang/String;)( pEncodedClientId ); |
|
12 |
+ |
} |
|
13 |
+ |
catch ( e ) |
|
14 |
+ |
{ |
|
15 |
+ |
alert( "NativeClientEventBusSupport.initializeEventBus\n\n" + e ); |
|
16 |
+ |
} |
|
17 |
+ |
} |
|
18 |
+ |
$wnd.pollEventBus = function () |
|
19 |
+ |
{ |
|
20 |
+ |
try |
|
21 |
+ |
{ |
|
22 |
+ |
// pCeb.@org.litesoft.GWT.eventbus.client.nonpublic.ClientEventBus::pollNow()(); |
|
23 |
+ |
@org.litesoft.GWT.eventbus.client.AbstractClientEventBusApp::pollEventBus()(); |
|
24 |
+ |
} |
|
25 |
+ |
catch ( e ) |
|
26 |
+ |
{ |
|
27 |
+ |
alert( "NativeClientEventBusSupport.pollEventBus\n\n" + e ); |
|
28 |
+ |
} |
|
29 |
+ |
}; |
|
30 |
+ |
$wnd.streamClosed = function () |
|
31 |
+ |
{ |
|
32 |
+ |
try |
|
33 |
+ |
{ |
|
34 |
+ |
@org.litesoft.GWT.eventbus.client.AbstractClientEventBusApp::streamClosed()(); |
|
35 |
+ |
} |
|
36 |
+ |
catch ( e ) |
|
37 |
+ |
{ |
|
38 |
+ |
alert( "NativeClientEventBusSupport.streamClosed\n\n" + e ); |
|
39 |
+ |
} |
|
40 |
+ |
}; |
|
41 |
+ |
|
|
42 |
+ |
// $wnd.clientID = "" + pCeb.@org.litesoft.GWT.eventbus.client.EventBus::getClientIdNumber()(); |
|
43 |
+ |
$wnd.getClientID = function () // Flash's ExternalInterface requires a function name |
|
44 |
+ |
{ |
|
45 |
+ |
try |
|
46 |
+ |
{ |
|
47 |
+ |
// return $wnd.clientID; |
|
48 |
+ |
return @org.litesoft.GWT.eventbus.client.AbstractClientEventBusApp::getClientIdNumber()(); |
|
49 |
+ |
} |
|
50 |
+ |
catch ( e ) |
|
51 |
+ |
{ |
|
52 |
+ |
alert( "NativeClientEventBusSupport.getClientID\n\n" + e ); |
|
53 |
+ |
} |
|
54 |
+ |
} |
|
55 |
+ |
}-*/; |
|
56 |
+ |
|
|
57 |
+ |
/** |
|
58 |
+ |
* Just being a bit parnoid about avoiding memory leaks in IE... |
|
59 |
+ |
*/ |
|
60 |
+ |
public static native void dispose() /*-{ |
|
61 |
+ |
$wnd.initializeEventBus = null; |
|
62 |
+ |
$wnd.pollEventBus = null; |
|
63 |
+ |
$wnd.streamClosed = null; |
|
64 |
+ |
$wnd.getClientID = null; |
|
65 |
+ |
}-*/; |
|
66 |
+ |
} |