author | bpatel |
Thu, 08 Jan 2009 16:26:59 -0800 | |
changeset 1787 | 1aa079321cd2 |
parent 10 | 06bc494ca11e |
child 5520 | 86e4b9a9da40 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
2 |
* Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Sun designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Sun in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
* have any questions. |
|
24 |
*/ |
|
25 |
||
26 |
package com.sun.tools.doclets.formats.html; |
|
27 |
||
28 |
import com.sun.javadoc.*; |
|
29 |
import java.io.*; |
|
30 |
||
31 |
/** |
|
32 |
* Generate the Serialized Form Information Page. |
|
33 |
* |
|
34 |
* @author Atul M Dambalkar |
|
35 |
*/ |
|
36 |
public class SerializedFormWriterImpl extends SubWriterHolderWriter |
|
37 |
implements com.sun.tools.doclets.internal.toolkit.SerializedFormWriter { |
|
38 |
||
39 |
private static final String FILE_NAME = "serialized-form.html"; |
|
40 |
||
41 |
/** |
|
42 |
* @throws IOException |
|
43 |
* @throws DocletAbortException |
|
44 |
*/ |
|
45 |
public SerializedFormWriterImpl() throws IOException { |
|
46 |
super(ConfigurationImpl.getInstance(), FILE_NAME); |
|
47 |
} |
|
48 |
||
49 |
/** |
|
50 |
* Writes the given header. |
|
51 |
* |
|
52 |
* @param header the header to write. |
|
53 |
*/ |
|
54 |
public void writeHeader(String header) { |
|
55 |
printHtmlHeader(header, null, true); |
|
56 |
printTop(); |
|
57 |
navLinks(true); |
|
58 |
hr(); |
|
59 |
center(); |
|
60 |
h1(); |
|
61 |
print(header); |
|
62 |
h1End(); |
|
63 |
centerEnd(); |
|
64 |
} |
|
65 |
||
66 |
/** |
|
67 |
* Write the given package header. |
|
68 |
* |
|
69 |
* @param packageName the package header to write. |
|
70 |
*/ |
|
71 |
public void writePackageHeader(String packageName) { |
|
72 |
hr(4, "noshade"); |
|
73 |
tableHeader(); |
|
74 |
thAlign("center"); |
|
75 |
font("+2"); |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
76 |
strongText("doclet.Package"); |
10 | 77 |
print(' '); |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
78 |
strong(packageName); |
10 | 79 |
tableFooter(); |
80 |
} |
|
81 |
||
82 |
/** |
|
83 |
* Write the serial UID info. |
|
84 |
* |
|
85 |
* @param header the header that will show up before the UID. |
|
86 |
* @param serialUID the serial UID to print. |
|
87 |
*/ |
|
88 |
public void writeSerialUIDInfo(String header, String serialUID) { |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
89 |
strong(header + " "); |
10 | 90 |
println(serialUID); |
91 |
p(); |
|
92 |
} |
|
93 |
||
94 |
/** |
|
95 |
* Write the footer. |
|
96 |
*/ |
|
97 |
public void writeFooter() { |
|
98 |
p(); |
|
99 |
hr(); |
|
100 |
navLinks(false); |
|
101 |
printBottom(); |
|
102 |
printBodyHtmlEnd(); |
|
103 |
} |
|
104 |
||
105 |
||
106 |
/** |
|
107 |
* Write the serializable class heading. |
|
108 |
* |
|
109 |
* @param classDoc the class being processed. |
|
110 |
*/ |
|
111 |
public void writeClassHeader(ClassDoc classDoc) { |
|
112 |
String classLink = (classDoc.isPublic() || classDoc.isProtected())? |
|
113 |
getLink(new LinkInfoImpl(classDoc, |
|
114 |
configuration.getClassName(classDoc))): |
|
115 |
classDoc.qualifiedName(); |
|
116 |
p(); |
|
117 |
anchor(classDoc.qualifiedName()); |
|
118 |
String superClassLink = |
|
119 |
classDoc.superclassType() != null ? |
|
120 |
getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_SERIALIZED_FORM, |
|
121 |
classDoc.superclassType())) : |
|
122 |
null; |
|
123 |
||
124 |
//Print the heading. |
|
125 |
String className = superClassLink == null ? |
|
126 |
configuration.getText( |
|
127 |
"doclet.Class_0_implements_serializable", classLink) : |
|
128 |
configuration.getText( |
|
129 |
"doclet.Class_0_extends_implements_serializable", classLink, |
|
130 |
superClassLink); |
|
131 |
tableHeader(); |
|
132 |
thAlignColspan("left", 2); |
|
133 |
font("+2"); |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
134 |
strong(className); |
10 | 135 |
tableFooter(); |
136 |
p(); |
|
137 |
} |
|
138 |
||
139 |
private void tableHeader() { |
|
140 |
tableIndexSummary(); |
|
141 |
trBgcolorStyle("#CCCCFF", "TableSubHeadingColor"); |
|
142 |
} |
|
143 |
||
144 |
private void tableFooter() { |
|
145 |
fontEnd(); |
|
146 |
thEnd(); trEnd(); tableEnd(); |
|
147 |
} |
|
148 |
||
149 |
/** |
|
150 |
* Return an instance of a SerialFieldWriter. |
|
151 |
* |
|
152 |
* @return an instance of a SerialFieldWriter. |
|
153 |
*/ |
|
154 |
public SerialFieldWriter getSerialFieldWriter(ClassDoc classDoc) { |
|
155 |
return new HtmlSerialFieldWriter(this, classDoc); |
|
156 |
} |
|
157 |
||
158 |
/** |
|
159 |
* Return an instance of a SerialMethodWriter. |
|
160 |
* |
|
161 |
* @return an instance of a SerialMethodWriter. |
|
162 |
*/ |
|
163 |
public SerialMethodWriter getSerialMethodWriter(ClassDoc classDoc) { |
|
164 |
return new HtmlSerialMethodWriter(this, classDoc); |
|
165 |
} |
|
166 |
} |