author | briangoetz |
Wed, 18 Dec 2013 10:29:25 -0500 | |
changeset 22159 | 682da512ec17 |
parent 21478 | fa4c7cda1b41 |
child 23799 | daa645653200 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
2 |
* Copyright (c) 1997, 2013, 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 |
||
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1789
diff
changeset
|
28 |
import java.util.*; |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1789
diff
changeset
|
29 |
|
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1789
diff
changeset
|
30 |
import com.sun.javadoc.*; |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
31 |
import com.sun.tools.javac.jvm.Profile; |
14258 | 32 |
import com.sun.tools.doclets.formats.html.markup.*; |
10 | 33 |
import com.sun.tools.doclets.internal.toolkit.*; |
34 |
import com.sun.tools.doclets.internal.toolkit.builders.*; |
|
35 |
import com.sun.tools.doclets.internal.toolkit.taglets.*; |
|
14258 | 36 |
import com.sun.tools.doclets.internal.toolkit.util.*; |
14542 | 37 |
import java.io.IOException; |
10 | 38 |
|
39 |
/** |
|
40 |
* Generate the Class Information Page. |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
41 |
* |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
42 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
43 |
* 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
|
44 |
* 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
|
45 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
46 |
* |
10 | 47 |
* @see com.sun.javadoc.ClassDoc |
48 |
* @see java.util.Collections |
|
49 |
* @see java.util.List |
|
50 |
* @see java.util.ArrayList |
|
51 |
* @see java.util.HashMap |
|
52 |
* |
|
53 |
* @author Atul M Dambalkar |
|
54 |
* @author Robert Field |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
55 |
* @author Bhavesh Patel (Modified) |
10 | 56 |
*/ |
57 |
public class ClassWriterImpl extends SubWriterHolderWriter |
|
58 |
implements ClassWriter { |
|
59 |
||
14542 | 60 |
protected final ClassDoc classDoc; |
10 | 61 |
|
14542 | 62 |
protected final ClassTree classtree; |
10 | 63 |
|
14542 | 64 |
protected final ClassDoc prev; |
10 | 65 |
|
14542 | 66 |
protected final ClassDoc next; |
10 | 67 |
|
68 |
/** |
|
14542 | 69 |
* @param configuration the configuration data for the doclet |
10 | 70 |
* @param classDoc the class being documented. |
71 |
* @param prevClass the previous class that was documented. |
|
72 |
* @param nextClass the next class being documented. |
|
73 |
* @param classTree the class tree for the given class. |
|
74 |
*/ |
|
14542 | 75 |
public ClassWriterImpl (ConfigurationImpl configuration, ClassDoc classDoc, |
10 | 76 |
ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) |
14542 | 77 |
throws IOException { |
78 |
super(configuration, DocPath.forClass(classDoc)); |
|
10 | 79 |
this.classDoc = classDoc; |
80 |
configuration.currentcd = classDoc; |
|
81 |
this.classtree = classTree; |
|
82 |
this.prev = prevClass; |
|
83 |
this.next = nextClass; |
|
84 |
} |
|
85 |
||
86 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
87 |
* Get this package link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
88 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
89 |
* @return a content tree for the package link |
10 | 90 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
91 |
protected Content getNavLinkPackage() { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
92 |
Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
93 |
packageLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
94 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
95 |
return li; |
10 | 96 |
} |
97 |
||
98 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
99 |
* Get the class link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
100 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
101 |
* @return a content tree for the class link |
10 | 102 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
103 |
protected Content getNavLinkClass() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
104 |
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
105 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
106 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
107 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
108 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
109 |
* Get the class use link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
110 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
111 |
* @return a content tree for the class use link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
112 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
113 |
protected Content getNavLinkClassUse() { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
114 |
Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), useLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
115 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
116 |
return li; |
10 | 117 |
} |
118 |
||
119 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
120 |
* Get link to previous class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
121 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
122 |
* @return a content tree for the previous class link |
10 | 123 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
124 |
public Content getNavLinkPrevious() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
125 |
Content li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
126 |
if (prev != null) { |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
127 |
Content prevLink = getLink(new LinkInfoImpl(configuration, |
17561 | 128 |
LinkInfoImpl.Kind.CLASS, prev) |
19907 | 129 |
.label(prevclassLabel).strong(true)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
130 |
li = HtmlTree.LI(prevLink); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
131 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
132 |
else |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
133 |
li = HtmlTree.LI(prevclassLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
134 |
return li; |
10 | 135 |
} |
136 |
||
137 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
138 |
* Get link to next class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
139 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
140 |
* @return a content tree for the next class link |
10 | 141 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
142 |
public Content getNavLinkNext() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
143 |
Content li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
144 |
if (next != null) { |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
145 |
Content nextLink = getLink(new LinkInfoImpl(configuration, |
17561 | 146 |
LinkInfoImpl.Kind.CLASS, next) |
19907 | 147 |
.label(nextclassLabel).strong(true)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
148 |
li = HtmlTree.LI(nextLink); |
10 | 149 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
150 |
else |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
151 |
li = HtmlTree.LI(nextclassLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
152 |
return li; |
10 | 153 |
} |
154 |
||
155 |
/** |
|
156 |
* {@inheritDoc} |
|
157 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
158 |
public Content getHeader(String header) { |
10 | 159 |
String pkgname = (classDoc.containingPackage() != null)? |
160 |
classDoc.containingPackage().name(): ""; |
|
161 |
String clname = classDoc.name(); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
162 |
Content bodyTree = getBody(true, getWindowTitle(clname)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
163 |
addTop(bodyTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
164 |
addNavLinks(true, bodyTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
165 |
bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
166 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
167 |
div.addStyle(HtmlStyle.header); |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
168 |
if (configuration.showProfiles) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
169 |
String sep = ""; |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
170 |
int profile = configuration.profiles.getProfile(getTypeNameForProfile(classDoc)); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
171 |
if (profile > 0) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
172 |
Content profNameContent = new StringContent(); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
173 |
for (int i = profile; i < configuration.profiles.getProfileCount(); i++) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
174 |
profNameContent.addContent(sep); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
175 |
profNameContent.addContent(Profile.lookup(i).name); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
176 |
sep = ", "; |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
177 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
178 |
Content profileNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, profNameContent); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
179 |
div.addContent(profileNameDiv); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
180 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14965
diff
changeset
|
181 |
} |
10 | 182 |
if (pkgname.length() > 0) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
183 |
Content pkgNameContent = new StringContent(pkgname); |
9068
6697b4cbba1d
7010342: End tag for element P is not open for few html files generated using new javadoc
bpatel
parents:
7681
diff
changeset
|
184 |
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); |
6697b4cbba1d
7010342: End tag for element P is not open for few html files generated using new javadoc
bpatel
parents:
7681
diff
changeset
|
185 |
div.addContent(pkgNameDiv); |
10 | 186 |
} |
14542 | 187 |
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, |
17561 | 188 |
LinkInfoImpl.Kind.CLASS_HEADER, classDoc); |
10 | 189 |
//Let's not link to ourselves in the header. |
190 |
linkInfo.linkToSelf = false; |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
191 |
Content headerContent = new StringContent(header); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
192 |
Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
193 |
HtmlStyle.title, headerContent); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
194 |
heading.addContent(getTypeParameterLinks(linkInfo)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
195 |
div.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
196 |
bodyTree.addContent(div); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
197 |
return bodyTree; |
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 |
|
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 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
202 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
203 |
public Content getClassContentHeader() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
204 |
return getContentHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
205 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
206 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
207 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
208 |
* {@inheritDoc} |
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 |
public void addFooter(Content contentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
211 |
contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
212 |
addNavLinks(false, contentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
213 |
addBottom(contentTree); |
10 | 214 |
} |
215 |
||
216 |
/** |
|
217 |
* {@inheritDoc} |
|
218 |
*/ |
|
14265
4e8e488eeae0
8000666: javadoc should write directly to Writer instead of composing strings
jjg
parents:
14260
diff
changeset
|
219 |
public void printDocument(Content contentTree) throws IOException { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
220 |
printHtmlDocument(configuration.metakeywords.getMetaKeywords(classDoc), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
221 |
true, contentTree); |
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 |
|
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 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
226 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
227 |
public Content getClassInfoTreeHeader() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
228 |
return getMemberTreeHeader(); |
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 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
231 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
232 |
* {@inheritDoc} |
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 |
public Content getClassInfo(Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
235 |
return getMemberTree(HtmlStyle.description, classInfoTree); |
10 | 236 |
} |
237 |
||
238 |
/** |
|
239 |
* {@inheritDoc} |
|
240 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
241 |
public void addClassSignature(String modifiers, Content classInfoTree) { |
10 | 242 |
boolean isInterface = classDoc.isInterface(); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
243 |
classInfoTree.addContent(new HtmlTree(HtmlTag.BR)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
244 |
Content pre = new HtmlTree(HtmlTag.PRE); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
245 |
addAnnotationInfo(classDoc, pre); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
246 |
pre.addContent(modifiers); |
14542 | 247 |
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, |
17561 | 248 |
LinkInfoImpl.Kind.CLASS_SIGNATURE, classDoc); |
10 | 249 |
//Let's not link to ourselves in the signature. |
250 |
linkInfo.linkToSelf = false; |
|
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
9068
diff
changeset
|
251 |
Content className = new StringContent(classDoc.name()); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
252 |
Content parameterLinks = getTypeParameterLinks(linkInfo); |
14542 | 253 |
if (configuration.linksource) { |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
9068
diff
changeset
|
254 |
addSrcLink(classDoc, className, pre); |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
9068
diff
changeset
|
255 |
pre.addContent(parameterLinks); |
10 | 256 |
} else { |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
19907
diff
changeset
|
257 |
Content span = HtmlTree.SPAN(HtmlStyle.typeNameLabel, className); |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
9068
diff
changeset
|
258 |
span.addContent(parameterLinks); |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
9068
diff
changeset
|
259 |
pre.addContent(span); |
10 | 260 |
} |
261 |
if (!isInterface) { |
|
262 |
Type superclass = Util.getFirstVisibleSuperClass(classDoc, |
|
14542 | 263 |
configuration); |
10 | 264 |
if (superclass != null) { |
7641
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
265 |
pre.addContent(DocletConstants.NL); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
266 |
pre.addContent("extends "); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
267 |
Content link = getLink(new LinkInfoImpl(configuration, |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
15723
diff
changeset
|
268 |
LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
269 |
superclass)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
270 |
pre.addContent(link); |
10 | 271 |
} |
272 |
} |
|
273 |
Type[] implIntfacs = classDoc.interfaceTypes(); |
|
274 |
if (implIntfacs != null && implIntfacs.length > 0) { |
|
275 |
int counter = 0; |
|
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21478
diff
changeset
|
276 |
for (Type implType : implIntfacs) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21478
diff
changeset
|
277 |
ClassDoc classDoc = implType.asClassDoc(); |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21478
diff
changeset
|
278 |
if (!(classDoc.isPublic() || Util.isLinkable(classDoc, configuration))) { |
10 | 279 |
continue; |
280 |
} |
|
281 |
if (counter == 0) { |
|
7641
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
282 |
pre.addContent(DocletConstants.NL); |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21478
diff
changeset
|
283 |
pre.addContent(isInterface ? "extends " : "implements "); |
10 | 284 |
} else { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
285 |
pre.addContent(", "); |
10 | 286 |
} |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
287 |
Content link = getLink(new LinkInfoImpl(configuration, |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21478
diff
changeset
|
288 |
LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21478
diff
changeset
|
289 |
implType)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
290 |
pre.addContent(link); |
10 | 291 |
counter++; |
292 |
} |
|
293 |
} |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
294 |
classInfoTree.addContent(pre); |
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 |
|
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 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
299 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
300 |
public void addClassDescription(Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
301 |
if(!configuration.nocomment) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
302 |
// generate documentation for the class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
303 |
if (classDoc.inlineTags().length > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
304 |
addInlineComment(classDoc, classInfoTree); |
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 |
} |
10 | 307 |
} |
308 |
||
309 |
/** |
|
310 |
* {@inheritDoc} |
|
311 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
312 |
public void addClassTagInfo(Content classInfoTree) { |
10 | 313 |
if(!configuration.nocomment) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
314 |
// Print Information about all the tags here |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
315 |
addTagsInfo(classDoc, classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
316 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
317 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
318 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
319 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
320 |
* Get the class hierarchy tree for the given class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
321 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
322 |
* @param type the class to print the hierarchy for |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
323 |
* @return a content tree for class inheritence |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
324 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
325 |
private Content getClassInheritenceTree(Type type) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
326 |
Type sup; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
327 |
HtmlTree classTreeUl = new HtmlTree(HtmlTag.UL); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
328 |
classTreeUl.addStyle(HtmlStyle.inheritance); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
329 |
Content liTree = null; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
330 |
do { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
331 |
sup = Util.getFirstVisibleSuperClass( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
332 |
type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(), |
14542 | 333 |
configuration); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
334 |
if (sup != null) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
335 |
HtmlTree ul = new HtmlTree(HtmlTag.UL); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
336 |
ul.addStyle(HtmlStyle.inheritance); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
337 |
ul.addContent(getTreeForClassHelper(type)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
338 |
if (liTree != null) |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
339 |
ul.addContent(liTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
340 |
Content li = HtmlTree.LI(ul); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
341 |
liTree = li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
342 |
type = sup; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
343 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
344 |
else |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
345 |
classTreeUl.addContent(getTreeForClassHelper(type)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
346 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
347 |
while (sup != null); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
348 |
if (liTree != null) |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
349 |
classTreeUl.addContent(liTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
350 |
return classTreeUl; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
351 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
352 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
353 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
354 |
* Get the class helper tree for the given class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
355 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
356 |
* @param type the class to print the helper for |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
357 |
* @return a content tree for class helper |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
358 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
359 |
private Content getTreeForClassHelper(Type type) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
360 |
Content li = new HtmlTree(HtmlTag.LI); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
361 |
if (type.equals(classDoc)) { |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
362 |
Content typeParameters = getTypeParameterLinks( |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
15723
diff
changeset
|
363 |
new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE, |
17561 | 364 |
classDoc)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
365 |
if (configuration.shouldExcludeQualifier( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
366 |
classDoc.containingPackage().name())) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
367 |
li.addContent(type.asClassDoc().name()); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
368 |
li.addContent(typeParameters); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
369 |
} else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
370 |
li.addContent(type.asClassDoc().qualifiedName()); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
371 |
li.addContent(typeParameters); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
372 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
373 |
} else { |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
374 |
Content link = getLink(new LinkInfoImpl(configuration, |
17561 | 375 |
LinkInfoImpl.Kind.CLASS_TREE_PARENT, type) |
376 |
.label(configuration.getClassName(type.asClassDoc()))); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
377 |
li.addContent(link); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
378 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
379 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
380 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
381 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
382 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
383 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
384 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
385 |
public void addClassTree(Content classContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
386 |
if (!classDoc.isClass()) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
387 |
return; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
388 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
389 |
classContentTree.addContent(getClassInheritenceTree(classDoc)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
390 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
391 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
392 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
393 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
394 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
395 |
public void addTypeParamInfo(Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
396 |
if (classDoc.typeParamTags().length > 0) { |
17574
044c7e1e4d53
8012308: Remove TagletOutput in favor of direct use of Content
jjg
parents:
17567
diff
changeset
|
397 |
Content typeParam = (new ParamTaglet()).getTagletOutput(classDoc, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
398 |
getTagletWriterInstance(false)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
399 |
Content dl = HtmlTree.DL(typeParam); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
400 |
classInfoTree.addContent(dl); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
401 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
402 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
403 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
404 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
405 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
406 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
407 |
public void addSubClassInfo(Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
408 |
if (classDoc.isClass()) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
409 |
if (classDoc.qualifiedName().equals("java.lang.Object") || |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
410 |
classDoc.qualifiedName().equals("org.omg.CORBA.Object")) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
411 |
return; // Don't generate the list, too huge |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
412 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
413 |
List<ClassDoc> subclasses = classtree.subs(classDoc, false); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
414 |
if (subclasses.size() > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
415 |
Content label = getResource( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
416 |
"doclet.Subclasses"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
417 |
Content dt = HtmlTree.DT(label); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
418 |
Content dl = HtmlTree.DL(dt); |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
15723
diff
changeset
|
419 |
dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBCLASSES, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
420 |
subclasses)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
421 |
classInfoTree.addContent(dl); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
422 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
423 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
424 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
425 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
426 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
427 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
428 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
429 |
public void addSubInterfacesInfo(Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
430 |
if (classDoc.isInterface()) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
431 |
List<ClassDoc> subInterfaces = classtree.allSubs(classDoc, false); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
432 |
if (subInterfaces.size() > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
433 |
Content label = getResource( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
434 |
"doclet.Subinterfaces"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
435 |
Content dt = HtmlTree.DT(label); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
436 |
Content dl = HtmlTree.DL(dt); |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
15723
diff
changeset
|
437 |
dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBINTERFACES, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
438 |
subInterfaces)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
439 |
classInfoTree.addContent(dl); |
10 | 440 |
} |
441 |
} |
|
442 |
} |
|
443 |
||
444 |
/** |
|
445 |
* {@inheritDoc} |
|
446 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
447 |
public void addInterfaceUsageInfo (Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
448 |
if (! classDoc.isInterface()) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
449 |
return; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
450 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
451 |
if (classDoc.qualifiedName().equals("java.lang.Cloneable") || |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
452 |
classDoc.qualifiedName().equals("java.io.Serializable")) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
453 |
return; // Don't generate the list, too big |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
454 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
455 |
List<ClassDoc> implcl = classtree.implementingclasses(classDoc); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
456 |
if (implcl.size() > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
457 |
Content label = getResource( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
458 |
"doclet.Implementing_Classes"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
459 |
Content dt = HtmlTree.DT(label); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
460 |
Content dl = HtmlTree.DL(dt); |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
15723
diff
changeset
|
461 |
dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_CLASSES, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
462 |
implcl)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
463 |
classInfoTree.addContent(dl); |
10 | 464 |
} |
465 |
} |
|
466 |
||
467 |
/** |
|
468 |
* {@inheritDoc} |
|
469 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
470 |
public void addImplementedInterfacesInfo(Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
471 |
//NOTE: we really should be using ClassDoc.interfaceTypes() here, but |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
472 |
// it doesn't walk up the tree like we want it to. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
473 |
List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
474 |
if (classDoc.isClass() && interfaceArray.size() > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
475 |
Content label = getResource( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
476 |
"doclet.All_Implemented_Interfaces"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
477 |
Content dt = HtmlTree.DT(label); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
478 |
Content dl = HtmlTree.DL(dt); |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
15723
diff
changeset
|
479 |
dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_INTERFACES, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
480 |
interfaceArray)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
481 |
classInfoTree.addContent(dl); |
10 | 482 |
} |
483 |
} |
|
484 |
||
485 |
/** |
|
486 |
* {@inheritDoc} |
|
487 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
488 |
public void addSuperInterfacesInfo(Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
489 |
//NOTE: we really should be using ClassDoc.interfaceTypes() here, but |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
490 |
// it doesn't walk up the tree like we want it to. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
491 |
List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
492 |
if (classDoc.isInterface() && interfaceArray.size() > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
493 |
Content label = getResource( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
494 |
"doclet.All_Superinterfaces"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
495 |
Content dt = HtmlTree.DT(label); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
496 |
Content dl = HtmlTree.DL(dt); |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
15723
diff
changeset
|
497 |
dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUPER_INTERFACES, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
498 |
interfaceArray)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
499 |
classInfoTree.addContent(dl); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
500 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
501 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
502 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
503 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
504 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
505 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
506 |
public void addNestedClassInfo(Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
507 |
ClassDoc outerClass = classDoc.containingClass(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
508 |
if (outerClass != null) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
509 |
Content label; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
510 |
if (outerClass.isInterface()) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
511 |
label = getResource( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
512 |
"doclet.Enclosing_Interface"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
513 |
} else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
514 |
label = getResource( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
515 |
"doclet.Enclosing_Class"); |
10 | 516 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
517 |
Content dt = HtmlTree.DT(label); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
518 |
Content dl = HtmlTree.DL(dt); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
519 |
Content dd = new HtmlTree(HtmlTag.DD); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
520 |
dd.addContent(getLink(new LinkInfoImpl(configuration, |
17561 | 521 |
LinkInfoImpl.Kind.CLASS, outerClass))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
522 |
dl.addContent(dd); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
523 |
classInfoTree.addContent(dl); |
10 | 524 |
} |
525 |
} |
|
526 |
||
527 |
/** |
|
528 |
* {@inheritDoc} |
|
529 |
*/ |
|
14965
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
530 |
public void addFunctionalInterfaceInfo (Content classInfoTree) { |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
531 |
if (classDoc.isFunctionalInterface()) { |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
532 |
Content dt = HtmlTree.DT(getResource("doclet.Functional_Interface")); |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
533 |
Content dl = HtmlTree.DL(dt); |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
534 |
Content dd = new HtmlTree(HtmlTag.DD); |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
535 |
dd.addContent(getResource("doclet.Functional_Interface_Message")); |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
536 |
dl.addContent(dd); |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
537 |
classInfoTree.addContent(dl); |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
538 |
} |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
539 |
} |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
540 |
|
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
541 |
/** |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
542 |
* {@inheritDoc} |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
543 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
544 |
public void addClassDeprecationInfo(Content classInfoTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
545 |
Content hr = new HtmlTree(HtmlTag.HR); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
546 |
classInfoTree.addContent(hr); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
547 |
Tag[] deprs = classDoc.tags("deprecated"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
548 |
if (Util.isDeprecated(classDoc)) { |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
19907
diff
changeset
|
549 |
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); |
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
19907
diff
changeset
|
550 |
Content 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
|
551 |
if (deprs.length > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
552 |
Tag[] commentTags = deprs[0].inlineTags(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
553 |
if (commentTags.length > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
554 |
div.addContent(getSpace()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
555 |
addInlineDeprecatedComment(classDoc, deprs[0], div); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
556 |
} |
10 | 557 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
558 |
classInfoTree.addContent(div); |
10 | 559 |
} |
560 |
} |
|
561 |
||
562 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
563 |
* Get links to the given classes. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
564 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
565 |
* @param context the id of the context where the link will be printed |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
566 |
* @param list the list of classes |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
567 |
* @return a content tree for the class list |
10 | 568 |
*/ |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
15723
diff
changeset
|
569 |
private Content getClassLinks(LinkInfoImpl.Kind context, List<?> list) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
570 |
Object[] typeList = list.toArray(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
571 |
Content dd = new HtmlTree(HtmlTag.DD); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
572 |
for (int i = 0; i < list.size(); i++) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
573 |
if (i > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
574 |
Content separator = new StringContent(", "); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
575 |
dd.addContent(separator); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
576 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
577 |
if (typeList[i] instanceof ClassDoc) { |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
578 |
Content link = getLink( |
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
579 |
new LinkInfoImpl(configuration, context, (ClassDoc)(typeList[i]))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
580 |
dd.addContent(link); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
581 |
} else { |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
582 |
Content link = getLink( |
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
583 |
new LinkInfoImpl(configuration, context, (Type)(typeList[i]))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
584 |
dd.addContent(link); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
585 |
} |
10 | 586 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
587 |
return dd; |
10 | 588 |
} |
589 |
||
590 |
/** |
|
591 |
* {@inheritDoc} |
|
592 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
593 |
protected Content getNavLinkTree() { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14265
diff
changeset
|
594 |
Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE, |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
595 |
treeLabel, "", ""); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
596 |
Content li = HtmlTree.LI(treeLinkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
597 |
return li; |
10 | 598 |
} |
599 |
||
600 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
601 |
* Add summary details to the navigation bar. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
602 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
603 |
* @param subDiv the content tree to which the summary detail links will be added |
10 | 604 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
605 |
protected void addSummaryDetailLinks(Content subDiv) { |
10 | 606 |
try { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
607 |
Content div = HtmlTree.DIV(getNavSummaryLinks()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
608 |
div.addContent(getNavDetailLinks()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
609 |
subDiv.addContent(div); |
10 | 610 |
} catch (Exception e) { |
611 |
e.printStackTrace(); |
|
19667
fdfce85627a9
8001669: javadoc internal DocletAbortException should set cause when appropriate
jjg
parents:
19253
diff
changeset
|
612 |
throw new DocletAbortException(e); |
10 | 613 |
} |
614 |
} |
|
615 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
616 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
617 |
* Get summary links for navigation bar. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
618 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
619 |
* @return the content tree for the navigation summary links |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
620 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
621 |
protected Content getNavSummaryLinks() throws Exception { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
622 |
Content li = HtmlTree.LI(summaryLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
623 |
li.addContent(getSpace()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
624 |
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); |
10 | 625 |
MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
626 |
configuration.getBuilderFactory().getMemberSummaryBuilder(this); |
10 | 627 |
String[] navLinkLabels = new String[] { |
628 |
"doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
629 |
"doclet.navMethod" |
10 | 630 |
}; |
631 |
for (int i = 0; i < navLinkLabels.length; i++ ) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
632 |
Content liNav = new HtmlTree(HtmlTag.LI); |
10 | 633 |
if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) { |
634 |
continue; |
|
635 |
} |
|
636 |
if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) { |
|
637 |
continue; |
|
638 |
} |
|
639 |
AbstractMemberWriter writer = |
|
640 |
((AbstractMemberWriter) memberSummaryBuilder. |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
641 |
getMemberSummaryWriter(i)); |
10 | 642 |
if (writer == null) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
643 |
liNav.addContent(getResource(navLinkLabels[i])); |
10 | 644 |
} else { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
645 |
writer.addNavSummaryLink( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
646 |
memberSummaryBuilder.members(i), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
647 |
memberSummaryBuilder.getVisibleMemberMap(i), liNav); |
10 | 648 |
} |
649 |
if (i < navLinkLabels.length-1) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
650 |
addNavGap(liNav); |
10 | 651 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
652 |
ulNav.addContent(liNav); |
10 | 653 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
654 |
return ulNav; |
10 | 655 |
} |
656 |
||
657 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
658 |
* Get detail links for the navigation bar. |
10 | 659 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
660 |
* @return the content tree for the detail links |
10 | 661 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
662 |
protected Content getNavDetailLinks() throws Exception { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
663 |
Content li = HtmlTree.LI(detailLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
664 |
li.addContent(getSpace()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
665 |
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); |
10 | 666 |
MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
667 |
configuration.getBuilderFactory().getMemberSummaryBuilder(this); |
10 | 668 |
String[] navLinkLabels = new String[] { |
669 |
"doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
670 |
"doclet.navMethod" |
10 | 671 |
}; |
672 |
for (int i = 1; i < navLinkLabels.length; i++ ) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
673 |
Content liNav = new HtmlTree(HtmlTag.LI); |
10 | 674 |
AbstractMemberWriter writer = |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
675 |
((AbstractMemberWriter) memberSummaryBuilder. |
10 | 676 |
getMemberSummaryWriter(i)); |
677 |
if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) { |
|
678 |
continue; |
|
679 |
} |
|
680 |
if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) { |
|
681 |
continue; |
|
682 |
} |
|
683 |
if (writer == null) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
684 |
liNav.addContent(getResource(navLinkLabels[i])); |
10 | 685 |
} else { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
686 |
writer.addNavDetailLink(memberSummaryBuilder.members(i), liNav); |
10 | 687 |
} |
688 |
if (i < navLinkLabels.length - 1) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
689 |
addNavGap(liNav); |
10 | 690 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
691 |
ulNav.addContent(liNav); |
10 | 692 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
693 |
return ulNav; |
10 | 694 |
} |
695 |
||
696 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
697 |
* Add gap between navigation bar elements. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
698 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
699 |
* @param liNav the content tree to which the gap will be added |
10 | 700 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
701 |
protected void addNavGap(Content liNav) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
702 |
liNav.addContent(getSpace()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
703 |
liNav.addContent("|"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
704 |
liNav.addContent(getSpace()); |
10 | 705 |
} |
706 |
||
707 |
/** |
|
708 |
* Return the classDoc being documented. |
|
709 |
* |
|
710 |
* @return the classDoc being documented. |
|
711 |
*/ |
|
712 |
public ClassDoc getClassDoc() { |
|
713 |
return classDoc; |
|
714 |
} |
|
715 |
} |