|
@@ -1,58 +1,58 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.client.widgets; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.client.widgets.nonpublic.*; |
5 |
|
- |
|
6 |
|
- |
import com.google.gwt.user.client.*; |
7 |
|
- |
import com.google.gwt.user.client.ui.*; |
8 |
|
- |
|
9 |
|
- |
public class TightGrid extends Grid implements OnBrowserEventListenable { |
10 |
|
- |
public TightGrid() { |
11 |
|
- |
tighten( this ); |
12 |
|
- |
} |
13 |
|
- |
|
14 |
|
- |
public TightGrid( int rows, int columns ) { |
15 |
|
- |
super( rows, columns ); |
16 |
|
- |
tighten( this ); |
17 |
|
- |
} |
18 |
|
- |
|
19 |
|
- |
public static void tighten( Grid pGrid ) { |
20 |
|
- |
pGrid.setCellPadding( 0 ); |
21 |
|
- |
pGrid.setBorderWidth( 0 ); |
22 |
|
- |
pGrid.setCellSpacing( 0 ); |
23 |
|
- |
} |
24 |
|
- |
|
25 |
|
- |
private OnBrowserEventListener mListener = null; |
26 |
|
- |
|
27 |
|
- |
@Override |
28 |
|
- |
public Widget getOnBrowserEventListenableWidget() { |
29 |
|
- |
return this; |
30 |
|
- |
} |
31 |
|
- |
|
32 |
|
- |
@Override |
33 |
|
- |
public OnBrowserEventListener getOnBrowserEventListener() { |
34 |
|
- |
return mListener; |
35 |
|
- |
} |
36 |
|
- |
|
37 |
|
- |
@Override |
38 |
|
- |
public void setOnBrowserEventListener( int pEventBitsToAdd, OnBrowserEventListener pListener ) { |
39 |
|
- |
if ( null != (mListener = pListener) ) { |
40 |
|
- |
sinkEvents( pEventBitsToAdd ); |
41 |
|
- |
} |
42 |
|
- |
} |
43 |
|
- |
|
44 |
|
- |
@Override |
45 |
|
- |
public void clearOnBrowserEventListener() { |
46 |
|
- |
mListener = null; |
47 |
|
- |
} |
48 |
|
- |
|
49 |
|
- |
@Override |
50 |
|
- |
public void onBrowserEvent( Event event ) { |
51 |
|
- |
if ( mListener != null ) { |
52 |
|
- |
if ( mListener.onBrowserEvent( event ) ) { |
53 |
|
- |
return; |
54 |
|
- |
} |
55 |
|
- |
} |
56 |
|
- |
super.onBrowserEvent( event ); |
57 |
|
- |
} |
58 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.client.widgets; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.client.widgets.nonpublic.*; |
|
5 |
+ |
|
|
6 |
+ |
import com.google.gwt.user.client.*; |
|
7 |
+ |
import com.google.gwt.user.client.ui.*; |
|
8 |
+ |
|
|
9 |
+ |
public class TightGrid extends Grid implements OnBrowserEventListenable { |
|
10 |
+ |
public TightGrid() { |
|
11 |
+ |
tighten( this ); |
|
12 |
+ |
} |
|
13 |
+ |
|
|
14 |
+ |
public TightGrid( int rows, int columns ) { |
|
15 |
+ |
super( rows, columns ); |
|
16 |
+ |
tighten( this ); |
|
17 |
+ |
} |
|
18 |
+ |
|
|
19 |
+ |
public static void tighten( Grid pGrid ) { |
|
20 |
+ |
pGrid.setCellPadding( 0 ); |
|
21 |
+ |
pGrid.setBorderWidth( 0 ); |
|
22 |
+ |
pGrid.setCellSpacing( 0 ); |
|
23 |
+ |
} |
|
24 |
+ |
|
|
25 |
+ |
private OnBrowserEventListener mListener = null; |
|
26 |
+ |
|
|
27 |
+ |
@Override |
|
28 |
+ |
public Widget getOnBrowserEventListenableWidget() { |
|
29 |
+ |
return this; |
|
30 |
+ |
} |
|
31 |
+ |
|
|
32 |
+ |
@Override |
|
33 |
+ |
public OnBrowserEventListener getOnBrowserEventListener() { |
|
34 |
+ |
return mListener; |
|
35 |
+ |
} |
|
36 |
+ |
|
|
37 |
+ |
@Override |
|
38 |
+ |
public void setOnBrowserEventListener( int pEventBitsToAdd, OnBrowserEventListener pListener ) { |
|
39 |
+ |
if ( null != (mListener = pListener) ) { |
|
40 |
+ |
sinkEvents( pEventBitsToAdd ); |
|
41 |
+ |
} |
|
42 |
+ |
} |
|
43 |
+ |
|
|
44 |
+ |
@Override |
|
45 |
+ |
public void clearOnBrowserEventListener() { |
|
46 |
+ |
mListener = null; |
|
47 |
+ |
} |
|
48 |
+ |
|
|
49 |
+ |
@Override |
|
50 |
+ |
public void onBrowserEvent( Event event ) { |
|
51 |
+ |
if ( mListener != null ) { |
|
52 |
+ |
if ( mListener.onBrowserEvent( event ) ) { |
|
53 |
+ |
return; |
|
54 |
+ |
} |
|
55 |
+ |
} |
|
56 |
+ |
super.onBrowserEvent( event ); |
|
57 |
+ |
} |
|
58 |
+ |
} |