01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets.plaf.wml;
06:
07: import java.awt.*;
08: import java.util.*;
09: import java.io.*;
10:
11: import com.javelin.swinglets.*;
12: import com.javelin.swinglets.plaf.*;
13:
14: /**
15: * WMLCheckBoxUI defines a look and feel for default WML.
16: *
17: * @author Robin Sharp
18: */
19:
20: public class WMLCheckBoxUI extends WMLComponentUI {
21: /**
22: * Render the UI on the PrintWriter
23: */
24: public void update(PrintWriter out, SComponent c) {
25: if (!c.isVisible())
26: return;
27:
28: SToggleButton check = (SToggleButton) c;
29:
30: out.print("<select name=\"");
31: out.print(check.getName());
32: out.print("\"");
33:
34: if (check.isSelected()) {
35: out.print(" ivalue=\"0\"");
36: }
37: out.println(">");
38:
39: out.print("<option value=\"0\">");
40: out.print(check.getText());
41: out.println("</option>");
42:
43: out.println("</select>");
44:
45: }
46: }
|