01: package simpleorm.simplewebapp.scalarFields;
02:
03: import simpleorm.simplewebapp.core.WField;
04:
05: /** An image whose url is name, display only. */
06: public class WFieldImage extends WField {
07: public WFieldImage(String name) {
08: super (name, IMAGE);
09: }
10:
11: public WFieldImage(String name, String widget) {
12: super (name, widget);
13: }
14:
15: protected String format() {
16: return (String) value;
17: }
18:
19: protected void parse(String rawText) {
20: this .value = rawText;
21: }
22:
23: public String getText() {
24: String text = super .getText();
25: return text != null ? text : "../rsaesg/image/spacer.gif"; // todo fix image hack
26: }
27:
28: public Class getValueClass() {
29: return String.class;
30: }
31:
32: }
|