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.table.*;
13: import com.javelin.swinglets.plaf.*;
14:
15: /**
16: * WMLTabbedPaneUI defines a look and feel for default WML.
17: *
18: * @author Robin Sharp
19: */
20:
21: public class WMLTabbedPaneUI extends WMLContainerUI {
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: STabbedPane tabbedPane = (STabbedPane) c;
30:
31: for (int index = 0; index < tabbedPane.getTabCount(); index++) {
32: out.print("<card");
33:
34: out.print(" id=\"");
35: out.print(tabbedPane.getComponentAt(index).getName());
36: out.print("\"");
37:
38: out.print(" title=\"");
39: out.print(tabbedPane.getTitleAt(index));
40: out.print("\"");
41:
42: out.print(" newcontext=\"true\""); //new context?
43:
44: out.println(">");
45:
46: for (int inner = 0; inner < tabbedPane.getTabCount(); inner++) {
47: out.print("<do type=\"");
48: out.print(tabbedPane.getComponentAt(inner).getName());
49: out.print("\" label=\"");
50: out.print(tabbedPane.getTitleAt(inner));
51: out.println("\">");
52:
53: out.print("<go href=\"#");
54: out.print(tabbedPane.getComponentAt(inner).getName());
55: out.println("\"/>");
56:
57: out.println("</do>");
58: }
59:
60: out.println("<p>");
61:
62: tabbedPane.getComponentAt(index).paint(out);
63:
64: out.println();
65: out.println("</p>");
66:
67: out.println("</card>");
68: }
69: }
70: }
|