litesoft
Diff Revisions
949
vs
950
for /trunk/Java/GWT/OldClient/src/org/litesoft/GWT/client/commands/IconTextCommand.java
|
@@ -1,26 +1,26 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.client.commands; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.client.widgets.*; |
5 |
|
- |
import org.litesoft.commonfoundation.typeutils.*; |
6 |
|
- |
|
7 |
|
- |
public abstract class IconTextCommand extends TextCommand { |
8 |
|
- |
private String mIconURL; |
9 |
|
- |
|
10 |
|
- |
protected IconTextCommand( String pIconURL, String pText ) { |
11 |
|
- |
super( pText ); |
12 |
|
- |
mIconURL = Strings.noEmpty( pIconURL ); |
13 |
|
- |
} |
14 |
|
- |
|
15 |
|
- |
public boolean hasIconURL() { |
16 |
|
- |
return mIconURL != null; |
17 |
|
- |
} |
18 |
|
- |
|
19 |
|
- |
public String getIconURL() { |
20 |
|
- |
return hasIconURL() ? mIconURL : TransparentImage.URL; |
21 |
|
- |
} |
22 |
|
- |
|
23 |
|
- |
protected String preText() { |
24 |
|
- |
return hasIconURL() ? "(img:" + mIconURL + ")" : super.preText(); |
25 |
|
- |
} |
26 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.client.commands; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.client.widgets.*; |
|
5 |
+ |
import org.litesoft.commonfoundation.base.*; |
|
6 |
+ |
|
|
7 |
+ |
public abstract class IconTextCommand extends TextCommand { |
|
8 |
+ |
private String mIconURL; |
|
9 |
+ |
|
|
10 |
+ |
protected IconTextCommand( String pIconURL, String pText ) { |
|
11 |
+ |
super( pText ); |
|
12 |
+ |
mIconURL = ConstrainTo.significantOrNull( pIconURL ); |
|
13 |
+ |
} |
|
14 |
+ |
|
|
15 |
+ |
public boolean hasIconURL() { |
|
16 |
+ |
return mIconURL != null; |
|
17 |
+ |
} |
|
18 |
+ |
|
|
19 |
+ |
public String getIconURL() { |
|
20 |
+ |
return hasIconURL() ? mIconURL : TransparentImage.URL; |
|
21 |
+ |
} |
|
22 |
+ |
|
|
23 |
+ |
protected String preText() { |
|
24 |
+ |
return hasIconURL() ? "(img:" + mIconURL + ")" : super.preText(); |
|
25 |
+ |
} |
|
26 |
+ |
} |