litesoft
Diff Revisions
949
vs
950
for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/OurLabel.java
|
@@ -1,45 +1,45 @@ |
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.commonfoundation.html.*; |
5 |
|
- |
import org.litesoft.commonfoundation.typeutils.*; |
6 |
|
- |
|
7 |
|
- |
import com.google.gwt.user.client.*; |
8 |
|
- |
import com.google.gwt.user.client.ui.*; |
9 |
|
- |
|
10 |
|
- |
public class OurLabel extends Label { |
11 |
|
- |
public OurLabel( String text ) { |
12 |
|
- |
super( text ); |
13 |
|
- |
} |
14 |
|
- |
|
15 |
|
- |
public OurLabel( String text, boolean wordWrap ) { |
16 |
|
- |
super( text, wordWrap ); |
17 |
|
- |
} |
18 |
|
- |
|
19 |
|
- |
public OurLabel( boolean wordWrap ) { |
20 |
|
- |
super( "", wordWrap ); |
21 |
|
- |
} |
22 |
|
- |
|
23 |
|
- |
public OurLabel style( String pStyle ) { |
24 |
|
- |
setStyleName( pStyle ); |
25 |
|
- |
return this; |
26 |
|
- |
} |
27 |
|
- |
|
28 |
|
- |
@Override |
29 |
|
- |
public void setText( String text ) { |
30 |
|
- |
setText( text, false ); |
31 |
|
- |
} |
32 |
|
- |
|
33 |
|
- |
public void setText( String pLabelText, boolean pAsHTML ) { |
34 |
|
- |
pLabelText = Strings.deNull( pLabelText ); |
35 |
|
- |
if ( pLabelText.length() == 0 ) { |
36 |
|
- |
pLabelText = HTMLConstants.NBSP; |
37 |
|
- |
pAsHTML = true; |
38 |
|
- |
} |
39 |
|
- |
if ( pAsHTML ) { |
40 |
|
- |
DOM.setInnerHTML( getElement(), pLabelText ); |
41 |
|
- |
} else { |
42 |
|
- |
DOM.setInnerText( getElement(), pLabelText ); |
43 |
|
- |
} |
44 |
|
- |
} |
45 |
|
- |
} |
|
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.commonfoundation.base.*; |
|
5 |
+ |
import org.litesoft.commonfoundation.html.*; |
|
6 |
+ |
|
|
7 |
+ |
import com.google.gwt.user.client.*; |
|
8 |
+ |
import com.google.gwt.user.client.ui.*; |
|
9 |
+ |
|
|
10 |
+ |
public class OurLabel extends Label { |
|
11 |
+ |
public OurLabel( String text ) { |
|
12 |
+ |
super( text ); |
|
13 |
+ |
} |
|
14 |
+ |
|
|
15 |
+ |
public OurLabel( String text, boolean wordWrap ) { |
|
16 |
+ |
super( text, wordWrap ); |
|
17 |
+ |
} |
|
18 |
+ |
|
|
19 |
+ |
public OurLabel( boolean wordWrap ) { |
|
20 |
+ |
super( "", wordWrap ); |
|
21 |
+ |
} |
|
22 |
+ |
|
|
23 |
+ |
public OurLabel style( String pStyle ) { |
|
24 |
+ |
setStyleName( pStyle ); |
|
25 |
+ |
return this; |
|
26 |
+ |
} |
|
27 |
+ |
|
|
28 |
+ |
@Override |
|
29 |
+ |
public void setText( String text ) { |
|
30 |
+ |
setText( text, false ); |
|
31 |
+ |
} |
|
32 |
+ |
|
|
33 |
+ |
public void setText( String pLabelText, boolean pAsHTML ) { |
|
34 |
+ |
pLabelText = ConstrainTo.notNull( pLabelText ); |
|
35 |
+ |
if ( pLabelText.length() == 0 ) { |
|
36 |
+ |
pLabelText = HtmlEntity.NBSP; |
|
37 |
+ |
pAsHTML = true; |
|
38 |
+ |
} |
|
39 |
+ |
if ( pAsHTML ) { |
|
40 |
+ |
DOM.setInnerHTML( getElement(), pLabelText ); |
|
41 |
+ |
} else { |
|
42 |
+ |
DOM.setInnerText( getElement(), pLabelText ); |
|
43 |
+ |
} |
|
44 |
+ |
} |
|
45 |
+ |
} |