[GWT] Design: Out of Process Hosted Mode (OOPHM)

일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
01 | Ext.ux.ToastWindowMgr = { |
02 | positions: [] |
03 | }; |
04 |
05 | Ext.ux.ToastWindow = Ext.extend(Ext.Window, { |
06 | initComponent: function (){ |
07 | Ext.apply( this , { |
08 | iconCls: this .iconCls || 'information' , |
09 | width: 200, |
10 | height: 100, |
11 | autoScroll: true , |
12 | autoDestroy: true , |
13 | plain: false |
14 | }); |
15 | this .task = new Ext.util.DelayedTask( this .hide, this ); |
16 | Ext.ux.ToastWindow.superclass.initComponent.call( this ); |
17 | }, |
18 | setMessage: function (msg){ |
19 | this .body.update(msg); |
20 | }, |
21 | setTitle: function (title, iconCls){ |
22 | Ext.ux.ToastWindow.superclass.setTitle.call( this , title, iconCls|| this .iconCls); |
23 | }, |
24 | onRender: function (ct, position) { |
25 | Ext.ux.ToastWindow.superclass.onRender.call( this , ct, position); |
26 | }, |
27 | afterShow: function (){ |
28 | Ext.ux.ToastWindow.superclass.afterShow.call( this ); |
29 | this .on( 'move' , function (){ |
30 | Ext.ux.ToastWindowMgr.positions.remove( this .pos); |
31 | this .task.cancel();} |
32 | , this ); |
33 | this .task.delay(2000); |
34 | }, |
35 | animShow: function (){ |
36 | this .pos = 0; |
37 | while (Ext.ux.ToastWindowMgr.positions.indexOf( this .pos)>-1) |
38 | this .pos++; |
39 | Ext.ux.ToastWindowMgr.positions.push( this .pos); |
40 | this .setSize(200,100); |
41 | this .el.alignTo(document, "br-br" , [ -20, -20-(( this .getSize().height+10)* this .pos) ]); |
42 | this .el.slideIn( 'b' , { |
43 | duration: 1, |
44 | callback: this .afterShow, |
45 | scope: this |
46 | }); |
47 | }, |
48 | animHide: function (){ |
49 | Ext.ux.ToastWindowMgr.positions.remove( this .pos); |
50 | this .el.ghost( "b" , { |
51 | duration: 1, |
52 | remove: true |
53 | }); |
54 | } |
55 | }); |
1 | ToastWindow tw = new ToastWindow( "토스트 윈도우" , "문서가 임시저장되었습니다." ); |
2 | tw.setIconCls( "icon-exclamation-header" ); |
3 | tw.show(); |
GIN (GWT INjection) allows you to use Guice in GWT client-side code.Guice?? 영어사전을 찾아봐도 나오지 않았습니다. 그래서 그냥 검색해본 결과는...
01 | public abstract class DataAsyncCallback<T, D> implements AsyncCallback<T> { |
02 | |
03 | private D data; |
04 |
05 | public DataAsyncCallback() {} |
06 |
07 | public DataAsyncCallback(D data) { |
08 | this .data = data; |
09 | } |
10 |
11 | public D getData() { |
12 | return data; |
13 | } |
14 |
15 | public void setData(D data) { |
16 | this .data = data; |
17 | } |
18 | |
19 | } |
1 | DataAsyncCallback callback = new DataAsyncCallback<String, List>() { |
2 | public void onSuccess(String result) { |
3 | List data = getData(); |
4 | ... |
5 | } |
6 | }; |
[원문] http://www.ongwt.com/post/2008/11/14/New-GWT-framework%3A-GWTEventService
The first public version of GWTEventService is released. GWTEventService is an event-based client-server communication framework. It uses GWT-RPC and the Comet / server-push technique. The client side offers a high-level API with opportunities to register listeners to the server like to a GUI component. The server side is completely independent of the client implementation and is highly configurable. GWTEventService can be used to resolve "old-style" polling calls in GWT applications with an event listen mechanism and a clean and extensible architecture.
The developer-release contains a small demo chat application to demonstrate the event listening technique with GWT. A short manual / tutorial can be found in the Wiki or in the developer-release of GWTEventService.
[프로젝트 홈] http://code.google.com/p/gwteventservice