litesoft
Diff Revisions
948
vs
950
for /trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/NonWrappingLabel.java
|
@@ -1,40 +1,40 @@ |
1 |
|
- |
package com.temp.client.foundation.widget; |
2 |
|
- |
|
3 |
|
- |
import com.temp.client.foundation.widget.input.support.*; |
4 |
|
- |
import com.temp.shared.utils.*; |
5 |
|
- |
|
6 |
|
- |
/** |
7 |
|
- |
* This Widget is a wrapper around a GWT HTML (Label). |
8 |
|
- |
* <p/> |
9 |
|
- |
* Its key features are: |
10 |
|
- |
* <ul> |
11 |
|
- |
* <li>Text will never wrap</li> |
12 |
|
- |
* <li>Leading & Trailing white space can be preserved</li> |
13 |
|
- |
* </ul> |
14 |
|
- |
*/ |
15 |
|
- |
public class NonWrappingLabel extends TextLabel { |
16 |
|
- |
public NonWrappingLabel() { |
17 |
|
- |
initWidget( htmlWidget ); |
18 |
|
- |
} |
19 |
|
- |
|
20 |
|
- |
public NonWrappingLabel( String text, boolean preserveLeadingAndTrailingWhiteSpace ) { |
21 |
|
- |
this(); |
22 |
|
- |
if ( preserveLeadingAndTrailingWhiteSpace ) { |
23 |
|
- |
setTextNoTrim( text ); |
24 |
|
- |
} else { |
25 |
|
- |
setText( text ); |
26 |
|
- |
} |
27 |
|
- |
} |
28 |
|
- |
|
29 |
|
- |
public NonWrappingLabel( String text ) { |
30 |
|
- |
this( text, false ); |
31 |
|
- |
} |
32 |
|
- |
|
33 |
|
- |
/** |
34 |
|
- |
* @param text will NOT be null but MAT have leading/trailing whitespace |
35 |
|
- |
*/ |
36 |
|
- |
@Override |
37 |
|
- |
protected String normalizeHTML( String text ) { |
38 |
|
- |
return SafeHtmlizer.getInstance().noEmpty( text ); |
39 |
|
- |
} |
40 |
|
- |
} |
|
1 |
+ |
package com.temp.client.foundation.widget; |
|
2 |
+ |
|
|
3 |
+ |
import com.temp.client.foundation.widget.input.support.*; |
|
4 |
+ |
import com.temp.shared.utils.*; |
|
5 |
+ |
|
|
6 |
+ |
/** |
|
7 |
+ |
* This Widget is a wrapper around a GWT HTML (Label). |
|
8 |
+ |
* <p/> |
|
9 |
+ |
* Its key features are: |
|
10 |
+ |
* <ul> |
|
11 |
+ |
* <li>Text will never wrap</li> |
|
12 |
+ |
* <li>Leading & Trailing white space can be preserved</li> |
|
13 |
+ |
* </ul> |
|
14 |
+ |
*/ |
|
15 |
+ |
public class NonWrappingLabel extends TextLabel { |
|
16 |
+ |
public NonWrappingLabel() { |
|
17 |
+ |
initWidget( htmlWidget ); |
|
18 |
+ |
} |
|
19 |
+ |
|
|
20 |
+ |
public NonWrappingLabel( String text, boolean preserveLeadingAndTrailingWhiteSpace ) { |
|
21 |
+ |
this(); |
|
22 |
+ |
if ( preserveLeadingAndTrailingWhiteSpace ) { |
|
23 |
+ |
setTextNoTrim( text ); |
|
24 |
+ |
} else { |
|
25 |
+ |
setText( text ); |
|
26 |
+ |
} |
|
27 |
+ |
} |
|
28 |
+ |
|
|
29 |
+ |
public NonWrappingLabel( String text ) { |
|
30 |
+ |
this( text, false ); |
|
31 |
+ |
} |
|
32 |
+ |
|
|
33 |
+ |
/** |
|
34 |
+ |
* @param text will NOT be null but MAT have leading/trailing whitespace |
|
35 |
+ |
*/ |
|
36 |
+ |
@Override |
|
37 |
+ |
protected String normalizeHTML( String text ) { |
|
38 |
+ |
return SafeHtmlizer.getInstance().noEmpty( text ); |
|
39 |
+ |
} |
|
40 |
+ |
} |