|
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 |
|
46 */ |
|
47 public abstract class SubWriterHolderWriter extends HtmlDocletWriter { |
|
48 |
|
49 public SubWriterHolderWriter(ConfigurationImpl configuration, |
|
50 String filename) throws IOException { |
|
51 super(configuration, filename); |
|
52 } |
|
53 |
|
54 |
|
55 public SubWriterHolderWriter(ConfigurationImpl configuration, |
|
56 String path, String filename, String relpath) |
|
57 throws IOException { |
|
58 super(configuration, path, filename, relpath); |
|
59 } |
|
60 |
|
61 public void printTypeSummaryHeader() { |
|
62 tdIndex(); |
|
63 font("-1"); |
|
64 code(); |
|
65 } |
|
66 |
|
67 public void printTypeSummaryFooter() { |
|
68 codeEnd(); |
|
69 fontEnd(); |
|
70 tdEnd(); |
|
71 } |
|
72 |
|
73 public void printSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) { |
|
74 mw.printSummaryAnchor(cd); |
|
75 tableIndexSummary(); |
|
76 tableHeaderStart("#CCCCFF"); |
|
77 mw.printSummaryLabel(cd); |
|
78 tableHeaderEnd(); |
|
79 } |
|
80 |
|
81 public void printTableHeadingBackground(String str) { |
|
82 tableIndexDetail(); |
|
83 tableHeaderStart("#CCCCFF", 1); |
|
84 bold(str); |
|
85 tableHeaderEnd(); |
|
86 tableEnd(); |
|
87 } |
|
88 |
|
89 public void printInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) { |
|
90 mw.printInheritedSummaryAnchor(cd); |
|
91 tableIndexSummary(); |
|
92 tableInheritedHeaderStart("#EEEEFF"); |
|
93 mw.printInheritedSummaryLabel(cd); |
|
94 tableInheritedHeaderEnd(); |
|
95 trBgcolorStyle("white", "TableRowColor"); |
|
96 summaryRow(0); |
|
97 code(); |
|
98 } |
|
99 |
|
100 public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) { |
|
101 tableEnd(); |
|
102 space(); |
|
103 } |
|
104 |
|
105 public void printInheritedSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) { |
|
106 codeEnd(); |
|
107 summaryRowEnd(); |
|
108 trEnd(); |
|
109 tableEnd(); |
|
110 space(); |
|
111 } |
|
112 |
|
113 protected void printIndexComment(Doc member) { |
|
114 printIndexComment(member, member.firstSentenceTags()); |
|
115 } |
|
116 |
|
117 protected void printIndexComment(Doc member, Tag[] firstSentenceTags) { |
|
118 Tag[] deprs = member.tags("deprecated"); |
|
119 if (Util.isDeprecated((ProgramElementDoc) member)) { |
|
120 boldText("doclet.Deprecated"); |
|
121 space(); |
|
122 if (deprs.length > 0) { |
|
123 printInlineDeprecatedComment(member, deprs[0]); |
|
124 } |
|
125 return; |
|
126 } else { |
|
127 ClassDoc cd = ((ProgramElementDoc)member).containingClass(); |
|
128 if (cd != null && Util.isDeprecated(cd)) { |
|
129 boldText("doclet.Deprecated"); space(); |
|
130 } |
|
131 } |
|
132 printSummaryComment(member, firstSentenceTags); |
|
133 } |
|
134 |
|
135 public void printSummaryLinkType(AbstractMemberWriter mw, |
|
136 ProgramElementDoc member) { |
|
137 trBgcolorStyle("white", "TableRowColor"); |
|
138 mw.printSummaryType(member); |
|
139 summaryRow(0); |
|
140 code(); |
|
141 } |
|
142 |
|
143 public void printSummaryLinkComment(AbstractMemberWriter mw, |
|
144 ProgramElementDoc member) { |
|
145 printSummaryLinkComment(mw, member, member.firstSentenceTags()); |
|
146 } |
|
147 |
|
148 public void printSummaryLinkComment(AbstractMemberWriter mw, |
|
149 ProgramElementDoc member, |
|
150 Tag[] firstSentenceTags) { |
|
151 codeEnd(); |
|
152 println(); |
|
153 br(); |
|
154 printNbsps(); |
|
155 printIndexComment(member, firstSentenceTags); |
|
156 summaryRowEnd(); |
|
157 trEnd(); |
|
158 } |
|
159 |
|
160 public void printInheritedSummaryMember(AbstractMemberWriter mw, ClassDoc cd, |
|
161 ProgramElementDoc member, boolean isFirst) { |
|
162 if (! isFirst) { |
|
163 mw.print(", "); |
|
164 } |
|
165 mw.writeInheritedSummaryLink(cd, member); |
|
166 } |
|
167 |
|
168 public void printMemberHeader() { |
|
169 hr(); |
|
170 } |
|
171 |
|
172 public void printMemberFooter() { |
|
173 } |
|
174 |
|
175 } |