litesoft
Diff Revisions
947
vs
948
for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/ResizeHelper.java
|
@@ -9,47 +9,35 @@ |
9 |
9 |
|
* Allows resizing to be delayed until resize activity stops for the |
10 |
10 |
|
* specified period. |
11 |
11 |
|
*/ |
12 |
|
- |
public abstract class ResizeHelper |
13 |
|
- |
{ |
|
12 |
+ |
public abstract class ResizeHelper { |
14 |
13 |
|
private int mMsDelay; |
15 |
14 |
|
|
16 |
15 |
|
private Timer mTimer = null; |
17 |
16 |
|
|
18 |
|
- |
public ResizeHelper() |
19 |
|
- |
{ |
|
17 |
+ |
public ResizeHelper() { |
20 |
18 |
|
this( 333 ); |
21 |
19 |
|
} |
22 |
20 |
|
|
23 |
|
- |
public ResizeHelper( int pMsDelay ) |
24 |
|
- |
{ |
|
21 |
+ |
public ResizeHelper( int pMsDelay ) { |
25 |
22 |
|
setMsDelay( pMsDelay ); |
26 |
23 |
|
} |
27 |
24 |
|
|
28 |
|
- |
public int getMsDelay() |
29 |
|
- |
{ |
|
25 |
+ |
public int getMsDelay() { |
30 |
26 |
|
return mMsDelay; |
31 |
27 |
|
} |
32 |
28 |
|
|
33 |
|
- |
public void setMsDelay( int pMsDelay ) |
34 |
|
- |
{ |
|
29 |
+ |
public void setMsDelay( int pMsDelay ) { |
35 |
30 |
|
mMsDelay = Integers.assertNonNegative( "pMsDelay", pMsDelay ); |
36 |
31 |
|
} |
37 |
32 |
|
|
38 |
|
- |
public void onResized() |
39 |
|
- |
{ |
40 |
|
- |
if ( mMsDelay == 0 ) |
41 |
|
- |
{ |
|
33 |
+ |
public void onResized() { |
|
34 |
+ |
if ( mMsDelay == 0 ) { |
42 |
35 |
|
doResize(); |
43 |
|
- |
} |
44 |
|
- |
else |
45 |
|
- |
{ |
46 |
|
- |
if ( mTimer == null ) |
47 |
|
- |
{ |
48 |
|
- |
mTimer = new Timer() |
49 |
|
- |
{ |
|
36 |
+ |
} else { |
|
37 |
+ |
if ( mTimer == null ) { |
|
38 |
+ |
mTimer = new Timer() { |
50 |
39 |
|
@Override |
51 |
|
- |
public void run() |
52 |
|
- |
{ |
|
40 |
+ |
public void run() { |
53 |
41 |
|
doResize(); |
54 |
42 |
|
mTimer = null; |
55 |
43 |
|
} |
|
@@ -62,8 +50,7 @@ |
62 |
50 |
|
protected abstract void doResize(); |
63 |
51 |
|
|
64 |
52 |
|
@Override |
65 |
|
- |
public String toString() |
66 |
|
- |
{ |
|
53 |
+ |
public String toString() { |
67 |
54 |
|
return "delay=" + mMsDelay + ",timerRunning=" + Boolean.valueOf( mTimer != null ); |
68 |
55 |
|
} |
69 |
56 |
|
} |