author | chegar |
Sun, 17 Aug 2014 15:52:32 +0100 | |
changeset 25874 | 83c19f00452c |
parent 25454 | langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java@376a52c9540c |
child 29957 | 7740f9657f56 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
22159
diff
changeset
|
2 |
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 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 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
26 |
package com.sun.tools.doclets.formats.html; |
|
27 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
28 |
import java.io.*; |
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
29 |
import java.util.*; |
14258 | 30 |
|
10 | 31 |
import com.sun.javadoc.*; |
14258 | 32 |
import com.sun.tools.doclets.formats.html.markup.*; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
33 |
import com.sun.tools.doclets.internal.toolkit.*; |
10 | 34 |
import com.sun.tools.doclets.internal.toolkit.util.*; |
35 |
||
36 |
/** |
|
37 |
* This abstract class exists to provide functionality needed in the |
|
38 |
* the formatting of member information. Since AbstractSubWriter and its |
|
39 |
* subclasses control this, they would be the logical place to put this. |
|
40 |
* However, because each member type has its own subclass, subclassing |
|
41 |
* can not be used effectively to change formatting. The concrete |
|
42 |
* class subclass of this class can be subclassed to change formatting. |
|
43 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
44 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
45 |
* If you write code that depends on this, you do so at your own risk. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
46 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
47 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
48 |
* |
10 | 49 |
* @see AbstractMemberWriter |
50 |
* @see ClassWriterImpl |
|
51 |
* |
|
52 |
* @author Robert Field |
|
53 |
* @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
|
54 |
* @author Bhavesh Patel (Modified) |
10 | 55 |
*/ |
56 |
public abstract class SubWriterHolderWriter extends HtmlDocletWriter { |
|
57 |
||
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
58 |
public SubWriterHolderWriter(ConfigurationImpl configuration, DocPath filename) |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
59 |
throws IOException { |
10 | 60 |
super(configuration, filename); |
61 |
} |
|
62 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
63 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
64 |
* Add the summary header. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
65 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
66 |
* @param mw the writer for the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
67 |
* @param cd the classdoc to be documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
68 |
* @param memberTree the content tree to which the summary header will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
69 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
70 |
public void addSummaryHeader(AbstractMemberWriter mw, ClassDoc cd, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
71 |
Content memberTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
72 |
mw.addSummaryAnchor(cd, memberTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
73 |
mw.addSummaryLabel(memberTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
74 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
75 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
76 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
77 |
* Get the summary table. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
78 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
79 |
* @param mw the writer for the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
80 |
* @param cd the classdoc to be documented |
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
81 |
* @param tableContents list of summary table contents |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
82 |
* @param showTabs true if the table needs to show tabs |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
83 |
* @return the content tree for the summary table |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
84 |
*/ |
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
85 |
public Content getSummaryTableTree(AbstractMemberWriter mw, ClassDoc cd, |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
86 |
List<Content> tableContents, boolean showTabs) { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
87 |
Content caption; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
88 |
if (showTabs) { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
89 |
caption = getTableCaption(mw.methodTypes); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
90 |
generateMethodTypesScript(mw.typeMap, mw.methodTypes); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
91 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
92 |
else { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
93 |
caption = getTableCaption(mw.getCaption()); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
94 |
} |
20613
ab4801a53abb
8008164: Invisible table captions in javadoc-generated html
bpatel
parents:
19253
diff
changeset
|
95 |
Content table = HtmlTree.TABLE(HtmlStyle.memberSummary, 0, 3, 0, |
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
96 |
mw.getTableSummary(), caption); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
97 |
table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col")); |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21478
diff
changeset
|
98 |
for (Content tableContent : tableContents) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21478
diff
changeset
|
99 |
table.addContent(tableContent); |
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
100 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
101 |
return table; |
10 | 102 |
} |
103 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
104 |
/** |
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
105 |
* Get the summary table caption. |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
106 |
* |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
107 |
* @param methodTypes set comprising of method types to show as table caption |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
108 |
* @return the caption for the summary table |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
109 |
*/ |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
110 |
public Content getTableCaption(Set<MethodTypes> methodTypes) { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
111 |
Content tabbedCaption = new HtmlTree(HtmlTag.CAPTION); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
112 |
for (MethodTypes type : methodTypes) { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
113 |
Content captionSpan; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
114 |
Content span; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
115 |
if (type.isDefaultTab()) { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
116 |
captionSpan = HtmlTree.SPAN(new StringContent(type.text())); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
117 |
span = HtmlTree.SPAN(type.tabId(), |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
118 |
HtmlStyle.activeTableTab, captionSpan); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
119 |
} else { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
120 |
captionSpan = HtmlTree.SPAN(getMethodTypeLinks(type)); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
121 |
span = HtmlTree.SPAN(type.tabId(), |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
122 |
HtmlStyle.tableTab, captionSpan); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
123 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
124 |
Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, getSpace()); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
125 |
span.addContent(tabSpan); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
126 |
tabbedCaption.addContent(span); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
127 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
128 |
return tabbedCaption; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
129 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
130 |
|
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
131 |
/** |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
132 |
* Get the method type links for the table caption. |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
133 |
* |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
134 |
* @param methodType the method type to be displayed as link |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
135 |
* @return the content tree for the method type link |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
136 |
*/ |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
137 |
public Content getMethodTypeLinks(MethodTypes methodType) { |
17569 | 138 |
String jsShow = "javascript:show(" + methodType.value() +");"; |
139 |
HtmlTree link = HtmlTree.A(jsShow, new StringContent(methodType.text())); |
|
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
140 |
return link; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
141 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
142 |
|
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14357
diff
changeset
|
143 |
/** |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
144 |
* Add the inherited summary header. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
145 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
146 |
* @param mw the writer for the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
147 |
* @param cd the classdoc to be documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
148 |
* @param inheritedTree the content tree to which the inherited summary header will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
149 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
150 |
public void addInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
151 |
Content inheritedTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
152 |
mw.addInheritedSummaryAnchor(cd, inheritedTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
153 |
mw.addInheritedSummaryLabel(cd, inheritedTree); |
10 | 154 |
} |
155 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
156 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
157 |
* Add the index comment. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
158 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
159 |
* @param member the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
160 |
* @param contentTree the content tree to which the comment will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
161 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
162 |
protected void addIndexComment(Doc member, Content contentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
163 |
addIndexComment(member, member.firstSentenceTags(), contentTree); |
10 | 164 |
} |
165 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
166 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
167 |
* Add the index comment. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
168 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
169 |
* @param member the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
170 |
* @param firstSentenceTags the first sentence tags for the member to be documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
171 |
* @param tdSummary the content tree to which the comment will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
172 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
173 |
protected void addIndexComment(Doc member, Tag[] firstSentenceTags, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
174 |
Content tdSummary) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
175 |
Tag[] deprs = member.tags("deprecated"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
176 |
Content div; |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
22159
diff
changeset
|
177 |
if (utils.isDeprecated((ProgramElementDoc) member)) { |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
20613
diff
changeset
|
178 |
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); |
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
20613
diff
changeset
|
179 |
div = HtmlTree.DIV(HtmlStyle.block, deprLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
180 |
div.addContent(getSpace()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
181 |
if (deprs.length > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
182 |
addInlineDeprecatedComment(member, deprs[0], div); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
183 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
184 |
tdSummary.addContent(div); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
185 |
return; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
186 |
} else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
187 |
ClassDoc cd = ((ProgramElementDoc)member).containingClass(); |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
22159
diff
changeset
|
188 |
if (cd != null && utils.isDeprecated(cd)) { |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
20613
diff
changeset
|
189 |
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); |
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
20613
diff
changeset
|
190 |
div = HtmlTree.DIV(HtmlStyle.block, deprLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
191 |
div.addContent(getSpace()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
192 |
tdSummary.addContent(div); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
193 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
194 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
195 |
addSummaryComment(member, firstSentenceTags, tdSummary); |
10 | 196 |
} |
197 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
198 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
199 |
* Add the summary type for the member. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
200 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
201 |
* @param mw the writer for the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
202 |
* @param member the member to be documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
203 |
* @param tdSummaryType the content tree to which the type will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
204 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
205 |
public void addSummaryType(AbstractMemberWriter mw, ProgramElementDoc member, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
206 |
Content tdSummaryType) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
207 |
mw.addSummaryType(member, tdSummaryType); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
208 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
209 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
210 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
211 |
* Add the summary link for the member. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
212 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
213 |
* @param mw the writer for the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
214 |
* @param member the member to be documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
215 |
* @param contentTree the content tree to which the link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
216 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
217 |
public void addSummaryLinkComment(AbstractMemberWriter mw, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
218 |
ProgramElementDoc member, Content contentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
219 |
addSummaryLinkComment(mw, member, member.firstSentenceTags(), contentTree); |
10 | 220 |
} |
221 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
222 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
223 |
* Add the summary link comment. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
224 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
225 |
* @param mw the writer for the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
226 |
* @param member the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
227 |
* @param firstSentenceTags the first sentence tags for the member to be documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
228 |
* @param tdSummary the content tree to which the comment will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
229 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
230 |
public void addSummaryLinkComment(AbstractMemberWriter mw, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
231 |
ProgramElementDoc member, Tag[] firstSentenceTags, Content tdSummary) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
232 |
addIndexComment(member, firstSentenceTags, tdSummary); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
233 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
234 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
235 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
236 |
* Add the inherited member summary. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
237 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
238 |
* @param mw the writer for the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
239 |
* @param cd the class being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
240 |
* @param member the member being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
241 |
* @param isFirst true if its the first link being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
242 |
* @param linksTree the content tree to which the summary will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
243 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
244 |
public void addInheritedMemberSummary(AbstractMemberWriter mw, ClassDoc cd, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
245 |
ProgramElementDoc member, boolean isFirst, Content linksTree) { |
10 | 246 |
if (! isFirst) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
247 |
linksTree.addContent(", "); |
10 | 248 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
249 |
mw.addInheritedSummaryLink(cd, member, linksTree); |
10 | 250 |
} |
251 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
252 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
253 |
* Get the document content header tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
254 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
255 |
* @return a content tree the document content header |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
256 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
257 |
public Content getContentHeader() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
258 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
259 |
div.addStyle(HtmlStyle.contentContainer); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
260 |
return div; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
261 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
262 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
263 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
264 |
* Get the member header tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
265 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
266 |
* @return a content tree the member header |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
267 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
268 |
public Content getMemberTreeHeader() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
269 |
HtmlTree li = new HtmlTree(HtmlTag.LI); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
270 |
li.addStyle(HtmlStyle.blockList); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
271 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
272 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
273 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
274 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
275 |
* Get the member tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
276 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
277 |
* @param contentTree the tree used to generate the complete member tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
278 |
* @return a content tree for the member |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
279 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
280 |
public Content getMemberTree(Content contentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
281 |
Content ul = HtmlTree.UL(HtmlStyle.blockList, contentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
282 |
return ul; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
283 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
284 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
285 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
286 |
* Get the member summary tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
287 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
288 |
* @param contentTree the tree used to generate the member summary tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
289 |
* @return a content tree for the member summary |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
290 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
291 |
public Content getMemberSummaryTree(Content contentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
292 |
return getMemberTree(HtmlStyle.summary, contentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
293 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
294 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
295 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
296 |
* Get the member details tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
297 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
298 |
* @param contentTree the tree used to generate the member details tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
299 |
* @return a content tree for the member details |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
300 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
301 |
public Content getMemberDetailsTree(Content contentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
302 |
return getMemberTree(HtmlStyle.details, contentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
303 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
304 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
305 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
306 |
* Get the member tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
307 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
308 |
* @param style the style class to be added to the content tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
309 |
* @param contentTree the tree used to generate the complete member tree |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
310 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
311 |
public Content getMemberTree(HtmlStyle style, Content contentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
312 |
Content div = HtmlTree.DIV(style, getMemberTree(contentTree)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
313 |
return div; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
314 |
} |
10 | 315 |
} |