litesoft
Diff Revisions
949
vs
950
for /trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/ClippingLabel.java
|
@@ -1,34 +1,34 @@ |
1 |
|
- |
package com.temp.client.foundation.widget; |
2 |
|
- |
|
3 |
|
- |
import com.google.gwt.dom.client.*; |
4 |
|
- |
import com.temp.client.foundation.widget.input.support.*; |
5 |
|
- |
import com.temp.shared.utils.*; |
6 |
|
- |
|
7 |
|
- |
/** |
8 |
|
- |
* This Widget is a wrapper around a GWT HTML (Label). |
9 |
|
- |
* <p/> |
10 |
|
- |
* Its key features are: |
11 |
|
- |
* <ul> |
12 |
|
- |
* <li>Leading and trailing whitespace is removed</li> |
13 |
|
- |
* <li>Text will be clipped</li> |
14 |
|
- |
* </ul> |
15 |
|
- |
*/ |
16 |
|
- |
public class ClippingLabel extends TextLabel { |
17 |
|
- |
public ClippingLabel() { |
18 |
|
- |
initWidget( htmlWidget ); |
19 |
|
- |
htmlWidget.getElement().getStyle().setOverflow( Style.Overflow.HIDDEN ); |
20 |
|
- |
} |
21 |
|
- |
|
22 |
|
- |
public ClippingLabel( String text ) { |
23 |
|
- |
this(); |
24 |
|
- |
setText( text ); |
25 |
|
- |
} |
26 |
|
- |
|
27 |
|
- |
/** |
28 |
|
- |
* @param text will NOT be null or have any leading/trailing whitespace |
29 |
|
- |
*/ |
30 |
|
- |
@Override |
31 |
|
- |
protected String normalizeHTML( String text ) { |
32 |
|
- |
return SafeHtmlizer.getInstance().noEmpty( text ); |
33 |
|
- |
} |
34 |
|
- |
} |
|
1 |
+ |
package com.temp.client.foundation.widget; |
|
2 |
+ |
|
|
3 |
+ |
import com.google.gwt.dom.client.*; |
|
4 |
+ |
import com.temp.client.foundation.widget.input.support.*; |
|
5 |
+ |
import com.temp.shared.utils.*; |
|
6 |
+ |
|
|
7 |
+ |
/** |
|
8 |
+ |
* This Widget is a wrapper around a GWT HTML (Label). |
|
9 |
+ |
* <p/> |
|
10 |
+ |
* Its key features are: |
|
11 |
+ |
* <ul> |
|
12 |
+ |
* <li>Leading and trailing whitespace is removed</li> |
|
13 |
+ |
* <li>Text will be clipped</li> |
|
14 |
+ |
* </ul> |
|
15 |
+ |
*/ |
|
16 |
+ |
public class ClippingLabel extends TextLabel { |
|
17 |
+ |
public ClippingLabel() { |
|
18 |
+ |
initWidget( htmlWidget ); |
|
19 |
+ |
htmlWidget.getElement().getStyle().setOverflow( Style.Overflow.HIDDEN ); |
|
20 |
+ |
} |
|
21 |
+ |
|
|
22 |
+ |
public ClippingLabel( String text ) { |
|
23 |
+ |
this(); |
|
24 |
+ |
setText( text ); |
|
25 |
+ |
} |
|
26 |
+ |
|
|
27 |
+ |
/** |
|
28 |
+ |
* @param text will NOT be null or have any leading/trailing whitespace |
|
29 |
+ |
*/ |
|
30 |
+ |
@Override |
|
31 |
+ |
protected String normalizeHTML( String text ) { |
|
32 |
+ |
return SafeHtmlizer.getInstance().noEmpty( text ); |
|
33 |
+ |
} |
|
34 |
+ |
} |