author | bpatel |
Thu, 19 Mar 2009 19:00:54 -0700 | |
changeset 2320 | 5b8c377175f4 |
parent 1787 | 1aa079321cd2 |
child 5520 | 86e4b9a9da40 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
2 |
* Copyright 1997-2004 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 com.sun.tools.doclets.internal.toolkit.util.*; |
|
30 |
||
31 |
import java.io.*; |
|
32 |
||
33 |
/** |
|
34 |
* This abstract class exists to provide functionality needed in the |
|
35 |
* the formatting of member information. Since AbstractSubWriter and its |
|
36 |
* subclasses control this, they would be the logical place to put this. |
|
37 |
* However, because each member type has its own subclass, subclassing |
|
38 |
* can not be used effectively to change formatting. The concrete |
|
39 |
* class subclass of this class can be subclassed to change formatting. |
|
40 |
* |
|
41 |
* @see AbstractMemberWriter |
|
42 |
* @see ClassWriterImpl |
|
43 |
* |
|
44 |
* @author Robert Field |
|
45 |
* @author Atul M Dambalkar |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
46 |
* @author Bhavesh Patel (Modified) |
10 | 47 |
*/ |
48 |
public abstract class SubWriterHolderWriter extends HtmlDocletWriter { |
|
49 |
||
50 |
public SubWriterHolderWriter(ConfigurationImpl configuration, |
|
51 |
String filename) throws IOException { |
|
52 |
super(configuration, filename); |
|
53 |
} |
|
54 |
||
55 |
||
56 |
public SubWriterHolderWriter(ConfigurationImpl configuration, |
|
57 |
String path, String filename, String relpath) |
|
58 |
throws IOException { |
|
59 |
super(configuration, path, filename, relpath); |
|
60 |
} |
|
61 |
||
62 |
public void printTypeSummaryHeader() { |
|
63 |
tdIndex(); |
|
64 |
font("-1"); |
|
65 |
code(); |
|
66 |
} |
|
67 |
||
68 |
public void printTypeSummaryFooter() { |
|
69 |
codeEnd(); |
|
70 |
fontEnd(); |
|
71 |
tdEnd(); |
|
72 |
} |
|
73 |
||
74 |
public void printSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) { |
|
75 |
mw.printSummaryAnchor(cd); |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
76 |
mw.printTableSummary(); |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
77 |
tableCaptionStart(); |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
78 |
mw.printSummaryLabel(); |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
79 |
tableCaptionEnd(); |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
80 |
mw.printSummaryTableHeader(cd); |
10 | 81 |
} |
82 |
||
83 |
public void printTableHeadingBackground(String str) { |
|
84 |
tableIndexDetail(); |
|
85 |
tableHeaderStart("#CCCCFF", 1); |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
86 |
strong(str); |
10 | 87 |
tableHeaderEnd(); |
88 |
tableEnd(); |
|
89 |
} |
|
90 |
||
91 |
public void printInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) { |
|
92 |
mw.printInheritedSummaryAnchor(cd); |
|
93 |
tableIndexSummary(); |
|
94 |
tableInheritedHeaderStart("#EEEEFF"); |
|
95 |
mw.printInheritedSummaryLabel(cd); |
|
96 |
tableInheritedHeaderEnd(); |
|
97 |
trBgcolorStyle("white", "TableRowColor"); |
|
98 |
summaryRow(0); |
|
99 |
code(); |
|
100 |
} |
|
101 |
||
102 |
public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) { |
|
103 |
tableEnd(); |
|
104 |
space(); |
|
105 |
} |
|
106 |
||
107 |
public void printInheritedSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) { |
|
108 |
codeEnd(); |
|
109 |
summaryRowEnd(); |
|
110 |
trEnd(); |
|
111 |
tableEnd(); |
|
112 |
space(); |
|
113 |
} |
|
114 |
||
115 |
protected void printIndexComment(Doc member) { |
|
116 |
printIndexComment(member, member.firstSentenceTags()); |
|
117 |
} |
|
118 |
||
119 |
protected void printIndexComment(Doc member, Tag[] firstSentenceTags) { |
|
120 |
Tag[] deprs = member.tags("deprecated"); |
|
121 |
if (Util.isDeprecated((ProgramElementDoc) member)) { |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
122 |
strongText("doclet.Deprecated"); |
10 | 123 |
space(); |
124 |
if (deprs.length > 0) { |
|
125 |
printInlineDeprecatedComment(member, deprs[0]); |
|
126 |
} |
|
127 |
return; |
|
128 |
} else { |
|
129 |
ClassDoc cd = ((ProgramElementDoc)member).containingClass(); |
|
130 |
if (cd != null && Util.isDeprecated(cd)) { |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
131 |
strongText("doclet.Deprecated"); space(); |
10 | 132 |
} |
133 |
} |
|
134 |
printSummaryComment(member, firstSentenceTags); |
|
135 |
} |
|
136 |
||
137 |
public void printSummaryLinkType(AbstractMemberWriter mw, |
|
138 |
ProgramElementDoc member) { |
|
139 |
trBgcolorStyle("white", "TableRowColor"); |
|
140 |
mw.printSummaryType(member); |
|
141 |
summaryRow(0); |
|
142 |
code(); |
|
143 |
} |
|
144 |
||
145 |
public void printSummaryLinkComment(AbstractMemberWriter mw, |
|
146 |
ProgramElementDoc member) { |
|
147 |
printSummaryLinkComment(mw, member, member.firstSentenceTags()); |
|
148 |
} |
|
149 |
||
150 |
public void printSummaryLinkComment(AbstractMemberWriter mw, |
|
151 |
ProgramElementDoc member, |
|
152 |
Tag[] firstSentenceTags) { |
|
153 |
codeEnd(); |
|
154 |
println(); |
|
155 |
br(); |
|
156 |
printNbsps(); |
|
157 |
printIndexComment(member, firstSentenceTags); |
|
158 |
summaryRowEnd(); |
|
159 |
trEnd(); |
|
160 |
} |
|
161 |
||
162 |
public void printInheritedSummaryMember(AbstractMemberWriter mw, ClassDoc cd, |
|
163 |
ProgramElementDoc member, boolean isFirst) { |
|
164 |
if (! isFirst) { |
|
165 |
mw.print(", "); |
|
166 |
} |
|
167 |
mw.writeInheritedSummaryLink(cd, member); |
|
168 |
} |
|
169 |
||
170 |
public void printMemberHeader() { |
|
171 |
hr(); |
|
172 |
} |
|
173 |
||
174 |
public void printMemberFooter() { |
|
175 |
} |
|
176 |
||
177 |
} |