1 /* |
1 /* |
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
119 * |
119 * |
120 * @param pkg the package to be documented |
120 * @param pkg the package to be documented |
121 * @param dlTree the content tree to which the description will be added |
121 * @param dlTree the content tree to which the description will be added |
122 */ |
122 */ |
123 protected void addDescription(PackageDoc pkg, Content dlTree) { |
123 protected void addDescription(PackageDoc pkg, Content dlTree) { |
124 Content link = getPackageLink(pkg, new StringContent(Util.getPackageName(pkg))); |
124 Content link = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))); |
125 Content dt = HtmlTree.DT(link); |
125 Content dt = HtmlTree.DT(link); |
126 dt.addContent(" - "); |
126 dt.addContent(" - "); |
127 dt.addContent(getResource("doclet.package")); |
127 dt.addContent(getResource("doclet.package")); |
128 dt.addContent(" " + pkg.name()); |
128 dt.addContent(" " + pkg.name()); |
129 dlTree.addContent(dt); |
129 dlTree.addContent(dt); |
157 * @param cd the class being documented |
157 * @param cd the class being documented |
158 * @param contentTree the content tree to which the class info will be added |
158 * @param contentTree the content tree to which the class info will be added |
159 */ |
159 */ |
160 protected void addClassInfo(ClassDoc cd, Content contentTree) { |
160 protected void addClassInfo(ClassDoc cd, Content contentTree) { |
161 contentTree.addContent(getResource("doclet.in", |
161 contentTree.addContent(getResource("doclet.in", |
162 Util.getTypeName(configuration, cd, false), |
162 utils.getTypeName(configuration, cd, false), |
163 getPackageLink(cd.containingPackage(), |
163 getPackageLink(cd.containingPackage(), |
164 Util.getPackageName(cd.containingPackage())) |
164 utils.getPackageName(cd.containingPackage())) |
165 )); |
165 )); |
166 } |
166 } |
167 |
167 |
168 /** |
168 /** |
169 * Add description for Class, Field, Method or Constructor. |
169 * Add description for Class, Field, Method or Constructor. |
198 protected void addComment(ProgramElementDoc element, Content contentTree) { |
198 protected void addComment(ProgramElementDoc element, Content contentTree) { |
199 Tag[] tags; |
199 Tag[] tags; |
200 Content span = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); |
200 Content span = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); |
201 HtmlTree div = new HtmlTree(HtmlTag.DIV); |
201 HtmlTree div = new HtmlTree(HtmlTag.DIV); |
202 div.addStyle(HtmlStyle.block); |
202 div.addStyle(HtmlStyle.block); |
203 if (Util.isDeprecated(element)) { |
203 if (utils.isDeprecated(element)) { |
204 div.addContent(span); |
204 div.addContent(span); |
205 if ((tags = element.tags("deprecated")).length > 0) |
205 if ((tags = element.tags("deprecated")).length > 0) |
206 addInlineDeprecatedComment(element, tags[0], div); |
206 addInlineDeprecatedComment(element, tags[0], div); |
207 contentTree.addContent(div); |
207 contentTree.addContent(div); |
208 } else { |
208 } else { |
209 ClassDoc cont = element.containingClass(); |
209 ClassDoc cont = element.containingClass(); |
210 while (cont != null) { |
210 while (cont != null) { |
211 if (Util.isDeprecated(cont)) { |
211 if (utils.isDeprecated(cont)) { |
212 div.addContent(span); |
212 div.addContent(span); |
213 contentTree.addContent(div); |
213 contentTree.addContent(div); |
214 break; |
214 break; |
215 } |
215 } |
216 cont = cont.containingClass(); |
216 cont = cont.containingClass(); |
226 * @param member MemberDoc for the member within the Class Kind |
226 * @param member MemberDoc for the member within the Class Kind |
227 * @param contentTree the content tree to which the member description will be added |
227 * @param contentTree the content tree to which the member description will be added |
228 */ |
228 */ |
229 protected void addMemberDesc(MemberDoc member, Content contentTree) { |
229 protected void addMemberDesc(MemberDoc member, Content contentTree) { |
230 ClassDoc containing = member.containingClass(); |
230 ClassDoc containing = member.containingClass(); |
231 String classdesc = Util.getTypeName( |
231 String classdesc = utils.getTypeName( |
232 configuration, containing, true) + " "; |
232 configuration, containing, true) + " "; |
233 if (member.isField()) { |
233 if (member.isField()) { |
234 if (member.isStatic()) { |
234 if (member.isStatic()) { |
235 contentTree.addContent( |
235 contentTree.addContent( |
236 getResource("doclet.Static_variable_in", classdesc)); |
236 getResource("doclet.Static_variable_in", classdesc)); |