Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/SizeableFrameWithGlass.java

Diff revisions: vs.
  @@ -8,14 +8,12 @@
8 8 import com.google.gwt.user.client.ui.*;
9 9 import com.google.gwt.user.client.ui.impl.*;
10 10
11 - public class SizeableFrameWithGlass extends SizeableFrame
12 - {
11 + public class SizeableFrameWithGlass extends SizeableFrame {
13 12 private static final PopupImpl sImpl = (PopupImpl) GWT.create( PopupImpl.class );
14 13
15 14 private Element mGlassDiv;
16 15
17 - public SizeableFrameWithGlass()
18 - {
16 + public SizeableFrameWithGlass() {
19 17 DOM.setElementProperty( mFrame.getElement(), "scrolling", "no" );
20 18
21 19 mGlassDiv = DOM.createDiv();
  @@ -29,20 +27,16 @@
29 27 CommonElementHelper.setStyleClass( mGlassDiv, "litesoft-FrameGlassPanel" );
30 28 }
31 29
32 - public SizeableFrameWithGlass( String url )
33 - {
30 + public SizeableFrameWithGlass( String url ) {
34 31 this();
35 32 setUrl( url );
36 33 }
37 34
38 35 private ClickListener mClickListener = null;
39 36
40 - public void addClickListener( ClickListener pClickListener )
41 - {
42 - if ( pClickListener != null )
43 - {
44 - if ( mClickListener == null )
45 - {
37 + public void addClickListener( ClickListener pClickListener ) {
38 + if ( pClickListener != null ) {
39 + if ( mClickListener == null ) {
46 40 DOM.sinkEvents( mGlassDiv, Event.ONCLICK );
47 41 }
48 42 mClickListener = pClickListener;
  @@ -50,10 +44,8 @@
50 44 }
51 45
52 46 @Override
53 - public void onBrowserEvent( Event event )
54 - {
55 - if ( (Event.ONCLICK == DOM.eventGetType( event )) && (mClickListener != null) )
56 - {
47 + public void onBrowserEvent( Event event ) {
48 + if ( (Event.ONCLICK == DOM.eventGetType( event )) && (mClickListener != null) ) {
57 49 mClickListener.onClick( this );
58 50 return;
59 51 }
  @@ -61,19 +53,16 @@
61 53 }
62 54
63 55 @Override
64 - protected void onAttach()
65 - {
56 + protected void onAttach() {
66 57 super.onAttach();
67 58 sImpl.onShow( mGlassDiv );
68 59 DOM.setEventListener( mGlassDiv, this );
69 60 }
70 61
71 62 @Override
72 - protected void onDetach()
73 - {
63 + protected void onDetach() {
74 64 // todo: throws Exception in IE: sImpl.onHide( mGlassDiv );
75 - if ( mDeferredProcess != null )
76 - {
65 + if ( mDeferredProcess != null ) {
77 66 mDeferredProcess.cancel();
78 67 mDeferredProcess = null;
79 68 }
  @@ -82,50 +71,41 @@
82 71 }
83 72
84 73 @Override
85 - public void setWidth( String width )
86 - {
74 + public void setWidth( String width ) {
87 75 super.setWidth( width );
88 76 forceGlassSize();
89 77 }
90 78
91 79 @Override
92 - public void setHeight( String height )
93 - {
80 + public void setHeight( String height ) {
94 81 super.setHeight( height );
95 82 forceGlassSize();
96 83 }
97 84
98 - protected void forceGlassWidth()
99 - {
85 + protected void forceGlassWidth() {
100 86 CommonElementHelper.setWidth( mGlassDiv, mFrame.getOffsetWidth() );
101 87 }
102 88
103 - protected void forceGlassHeight()
104 - {
89 + protected void forceGlassHeight() {
105 90 CommonElementHelper.setHeight( mGlassDiv, mFrame.getOffsetHeight() );
106 91 }
107 92
108 - protected void forceGlassSize()
109 - {
110 - if ( mDeferredProcess == null )
111 - {
93 + protected void forceGlassSize() {
94 + if ( mDeferredProcess == null ) {
112 95 Scheduler.get().scheduleDeferred( mDeferredProcess = new MyDeferredProcess() );
113 96 }
114 97 }
115 98
116 99 private MyDeferredProcess mDeferredProcess = null;
117 100
118 - private class MyDeferredProcess extends Timer implements Command
119 - {
101 + private class MyDeferredProcess extends Timer implements Command {
120 102 @Override
121 - public void execute()
122 - {
103 + public void execute() {
123 104 schedule( 10 );
124 105 }
125 106
126 107 @Override
127 - public void run()
128 - {
108 + public void run() {
129 109 forceGlassWidth();
130 110 forceGlassHeight();
131 111 mDeferredProcess = null;