litesoft
Diff Revisions
2
vs
44
for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/OurLabel.java
|
@@ -2,6 +2,7 @@ |
2 |
2 |
|
|
3 |
3 |
|
import org.litesoft.core.util.*; |
4 |
4 |
|
|
|
5 |
+ |
import com.google.gwt.user.client.*; |
5 |
6 |
|
import com.google.gwt.user.client.ui.*; |
6 |
7 |
|
|
7 |
8 |
|
public class OurLabel extends Label |
|
@@ -16,6 +17,11 @@ |
16 |
17 |
|
super( text, wordWrap ); |
17 |
18 |
|
} |
18 |
19 |
|
|
|
20 |
+ |
public OurLabel( boolean wordWrap ) |
|
21 |
+ |
{ |
|
22 |
+ |
super( "", wordWrap ); |
|
23 |
+ |
} |
|
24 |
+ |
|
19 |
25 |
|
public OurLabel style( String pStyle ) |
20 |
26 |
|
{ |
21 |
27 |
|
setStyleName( pStyle ); |
|
@@ -25,6 +31,24 @@ |
25 |
31 |
|
@Override |
26 |
32 |
|
public void setText( String text ) |
27 |
33 |
|
{ |
28 |
|
- |
super.setText( UtilsCommon.deNull( text ) ); |
|
34 |
+ |
setText( text, false ); |
|
35 |
+ |
} |
|
36 |
+ |
|
|
37 |
+ |
public void setText( String pLabelText, boolean pAsHTML ) |
|
38 |
+ |
{ |
|
39 |
+ |
pLabelText = UtilsCommon.deNull( pLabelText ); |
|
40 |
+ |
if ( pLabelText.length() == 0 ) |
|
41 |
+ |
{ |
|
42 |
+ |
pLabelText = " "; |
|
43 |
+ |
pAsHTML = true; |
|
44 |
+ |
} |
|
45 |
+ |
if ( pAsHTML ) |
|
46 |
+ |
{ |
|
47 |
+ |
DOM.setInnerHTML( getElement(), pLabelText ); |
|
48 |
+ |
} |
|
49 |
+ |
else |
|
50 |
+ |
{ |
|
51 |
+ |
DOM.setInnerText( getElement(), pLabelText ); |
|
52 |
+ |
} |
29 |
53 |
|
} |
30 |
54 |
|
} |