01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets.plaf.html;
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: import com.javelin.swinglets.plaf.html.*;
14:
15: /**
16: * HTMLTextFieldUI defines a look and feel for default HTML.
17: *
18: * @author Robin Sharp
19: */
20:
21: public class HTMLTextFieldUI extends HTMLComponentUI {
22: /**
23: * Render the UI on the PrintWriter
24: */
25: public void update(PrintWriter out, SComponent c) {
26: if (!c.isVisible())
27: return;
28:
29: STextField textField = (STextField) c;
30:
31: out.print("<INPUT SIZE=\"");
32: out.print(textField.getColumns());
33: out.println("\"");
34:
35: out.print(" MAXLENGTH=\"");
36: out.print(textField.getMaxLength());
37: out.println("\"");
38:
39: if (c.isEnabled()) {
40: HTMLUtility.setName(out, textField);
41: }
42: HTMLUtility.setTabIndex(out, c);
43:
44: HTMLUtility.setValue(out, textField);
45:
46: HTMLUtility.setMouseOverStatusText(out, c.getToolTipText());
47:
48: updateEvent(out, c);
49:
50: if (!c.isEnabled()) {
51: out.println(" DISABLED");
52: }
53:
54: out.println(">");
55: }
56: }
|