Thu, 31 Aug 2017 15:17:03 +0800
merge
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 4 | * |
aoqi@0 | 5 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 6 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 7 | * published by the Free Software Foundation. Oracle designates this |
aoqi@0 | 8 | * particular file as subject to the "Classpath" exception as provided |
aoqi@0 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
aoqi@0 | 10 | * |
aoqi@0 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 15 | * accompanied this code). |
aoqi@0 | 16 | * |
aoqi@0 | 17 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 20 | * |
aoqi@0 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 22 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 23 | * questions. |
aoqi@0 | 24 | */ |
aoqi@0 | 25 | |
aoqi@0 | 26 | package com.sun.tools.doclets.formats.html; |
aoqi@0 | 27 | |
aoqi@0 | 28 | import java.io.*; |
aoqi@0 | 29 | |
aoqi@0 | 30 | import com.sun.javadoc.*; |
aoqi@0 | 31 | import com.sun.tools.doclets.formats.html.markup.*; |
aoqi@0 | 32 | import com.sun.tools.doclets.internal.toolkit.*; |
aoqi@0 | 33 | import com.sun.tools.doclets.internal.toolkit.util.*; |
aoqi@0 | 34 | import com.sun.tools.javac.util.StringUtils; |
aoqi@0 | 35 | |
aoqi@0 | 36 | /** |
aoqi@0 | 37 | * Writes method documentation in HTML format. |
aoqi@0 | 38 | * |
aoqi@0 | 39 | * <p><b>This is NOT part of any supported API. |
aoqi@0 | 40 | * If you write code that depends on this, you do so at your own risk. |
aoqi@0 | 41 | * This code and its internal interfaces are subject to change or |
aoqi@0 | 42 | * deletion without notice.</b> |
aoqi@0 | 43 | * |
aoqi@0 | 44 | * @author Robert Field |
aoqi@0 | 45 | * @author Atul M Dambalkar |
aoqi@0 | 46 | * @author Jamie Ho (rewrite) |
aoqi@0 | 47 | * @author Bhavesh Patel (Modified) |
aoqi@0 | 48 | */ |
aoqi@0 | 49 | public class MethodWriterImpl extends AbstractExecutableMemberWriter |
aoqi@0 | 50 | implements MethodWriter, MemberSummaryWriter { |
aoqi@0 | 51 | |
aoqi@0 | 52 | /** |
aoqi@0 | 53 | * Construct a new MethodWriterImpl. |
aoqi@0 | 54 | * |
aoqi@0 | 55 | * @param writer the writer for the class that the methods belong to. |
aoqi@0 | 56 | * @param classDoc the class being documented. |
aoqi@0 | 57 | */ |
aoqi@0 | 58 | public MethodWriterImpl(SubWriterHolderWriter writer, ClassDoc classDoc) { |
aoqi@0 | 59 | super(writer, classDoc); |
aoqi@0 | 60 | } |
aoqi@0 | 61 | |
aoqi@0 | 62 | /** |
aoqi@0 | 63 | * Construct a new MethodWriterImpl. |
aoqi@0 | 64 | * |
aoqi@0 | 65 | * @param writer The writer for the class that the methods belong to. |
aoqi@0 | 66 | */ |
aoqi@0 | 67 | public MethodWriterImpl(SubWriterHolderWriter writer) { |
aoqi@0 | 68 | super(writer); |
aoqi@0 | 69 | } |
aoqi@0 | 70 | |
aoqi@0 | 71 | /** |
aoqi@0 | 72 | * {@inheritDoc} |
aoqi@0 | 73 | */ |
aoqi@0 | 74 | public Content getMemberSummaryHeader(ClassDoc classDoc, |
aoqi@0 | 75 | Content memberSummaryTree) { |
aoqi@0 | 76 | memberSummaryTree.addContent(HtmlConstants.START_OF_METHOD_SUMMARY); |
aoqi@0 | 77 | Content memberTree = writer.getMemberTreeHeader(); |
aoqi@0 | 78 | writer.addSummaryHeader(this, classDoc, memberTree); |
aoqi@0 | 79 | return memberTree; |
aoqi@0 | 80 | } |
aoqi@0 | 81 | |
aoqi@0 | 82 | /** |
aoqi@0 | 83 | * {@inheritDoc} |
aoqi@0 | 84 | */ |
aoqi@0 | 85 | public Content getMethodDetailsTreeHeader(ClassDoc classDoc, |
aoqi@0 | 86 | Content memberDetailsTree) { |
aoqi@0 | 87 | memberDetailsTree.addContent(HtmlConstants.START_OF_METHOD_DETAILS); |
aoqi@0 | 88 | Content methodDetailsTree = writer.getMemberTreeHeader(); |
aoqi@0 | 89 | methodDetailsTree.addContent(writer.getMarkerAnchor( |
aoqi@0 | 90 | SectionName.METHOD_DETAIL)); |
aoqi@0 | 91 | Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, |
aoqi@0 | 92 | writer.methodDetailsLabel); |
aoqi@0 | 93 | methodDetailsTree.addContent(heading); |
aoqi@0 | 94 | return methodDetailsTree; |
aoqi@0 | 95 | } |
aoqi@0 | 96 | |
aoqi@0 | 97 | /** |
aoqi@0 | 98 | * {@inheritDoc} |
aoqi@0 | 99 | */ |
aoqi@0 | 100 | public Content getMethodDocTreeHeader(MethodDoc method, |
aoqi@0 | 101 | Content methodDetailsTree) { |
aoqi@0 | 102 | String erasureAnchor; |
aoqi@0 | 103 | if ((erasureAnchor = getErasureAnchor(method)) != null) { |
aoqi@0 | 104 | methodDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor))); |
aoqi@0 | 105 | } |
aoqi@0 | 106 | methodDetailsTree.addContent( |
aoqi@0 | 107 | writer.getMarkerAnchor(writer.getAnchor(method))); |
aoqi@0 | 108 | Content methodDocTree = writer.getMemberTreeHeader(); |
aoqi@0 | 109 | Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); |
aoqi@0 | 110 | heading.addContent(method.name()); |
aoqi@0 | 111 | methodDocTree.addContent(heading); |
aoqi@0 | 112 | return methodDocTree; |
aoqi@0 | 113 | } |
aoqi@0 | 114 | |
aoqi@0 | 115 | /** |
aoqi@0 | 116 | * Get the signature for the given method. |
aoqi@0 | 117 | * |
aoqi@0 | 118 | * @param method the method being documented. |
aoqi@0 | 119 | * @return a content object for the signature |
aoqi@0 | 120 | */ |
aoqi@0 | 121 | public Content getSignature(MethodDoc method) { |
aoqi@0 | 122 | Content pre = new HtmlTree(HtmlTag.PRE); |
aoqi@0 | 123 | writer.addAnnotationInfo(method, pre); |
aoqi@0 | 124 | addModifiers(method, pre); |
aoqi@0 | 125 | addTypeParameters(method, pre); |
aoqi@0 | 126 | addReturnType(method, pre); |
aoqi@0 | 127 | if (configuration.linksource) { |
aoqi@0 | 128 | Content methodName = new StringContent(method.name()); |
aoqi@0 | 129 | writer.addSrcLink(method, methodName, pre); |
aoqi@0 | 130 | } else { |
aoqi@0 | 131 | addName(method.name(), pre); |
aoqi@0 | 132 | } |
aoqi@0 | 133 | int indent = pre.charCount(); |
aoqi@0 | 134 | addParameters(method, pre, indent); |
aoqi@0 | 135 | addExceptions(method, pre, indent); |
aoqi@0 | 136 | return pre; |
aoqi@0 | 137 | } |
aoqi@0 | 138 | |
aoqi@0 | 139 | /** |
aoqi@0 | 140 | * {@inheritDoc} |
aoqi@0 | 141 | */ |
aoqi@0 | 142 | public void addDeprecated(MethodDoc method, Content methodDocTree) { |
aoqi@0 | 143 | addDeprecatedInfo(method, methodDocTree); |
aoqi@0 | 144 | } |
aoqi@0 | 145 | |
aoqi@0 | 146 | /** |
aoqi@0 | 147 | * {@inheritDoc} |
aoqi@0 | 148 | */ |
aoqi@0 | 149 | public void addComments(Type holder, MethodDoc method, Content methodDocTree) { |
aoqi@0 | 150 | ClassDoc holderClassDoc = holder.asClassDoc(); |
aoqi@0 | 151 | if (method.inlineTags().length > 0) { |
aoqi@0 | 152 | if (holder.asClassDoc().equals(classdoc) || |
aoqi@0 | 153 | (! (holderClassDoc.isPublic() || |
aoqi@0 | 154 | Util.isLinkable(holderClassDoc, configuration)))) { |
aoqi@0 | 155 | writer.addInlineComment(method, methodDocTree); |
aoqi@0 | 156 | } else { |
aoqi@0 | 157 | Content link = |
aoqi@0 | 158 | writer.getDocLink(LinkInfoImpl.Kind.METHOD_DOC_COPY, |
aoqi@0 | 159 | holder.asClassDoc(), method, |
aoqi@0 | 160 | holder.asClassDoc().isIncluded() ? |
aoqi@0 | 161 | holder.typeName() : holder.qualifiedTypeName(), |
aoqi@0 | 162 | false); |
aoqi@0 | 163 | Content codelLink = HtmlTree.CODE(link); |
aoqi@0 | 164 | Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.asClassDoc().isClass()? |
aoqi@0 | 165 | writer.descfrmClassLabel : writer.descfrmInterfaceLabel); |
aoqi@0 | 166 | descfrmLabel.addContent(writer.getSpace()); |
aoqi@0 | 167 | descfrmLabel.addContent(codelLink); |
aoqi@0 | 168 | methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); |
aoqi@0 | 169 | writer.addInlineComment(method, methodDocTree); |
aoqi@0 | 170 | } |
aoqi@0 | 171 | } |
aoqi@0 | 172 | } |
aoqi@0 | 173 | |
aoqi@0 | 174 | /** |
aoqi@0 | 175 | * {@inheritDoc} |
aoqi@0 | 176 | */ |
aoqi@0 | 177 | public void addTags(MethodDoc method, Content methodDocTree) { |
aoqi@0 | 178 | writer.addTagsInfo(method, methodDocTree); |
aoqi@0 | 179 | } |
aoqi@0 | 180 | |
aoqi@0 | 181 | /** |
aoqi@0 | 182 | * {@inheritDoc} |
aoqi@0 | 183 | */ |
aoqi@0 | 184 | public Content getMethodDetails(Content methodDetailsTree) { |
aoqi@0 | 185 | return getMemberTree(methodDetailsTree); |
aoqi@0 | 186 | } |
aoqi@0 | 187 | |
aoqi@0 | 188 | /** |
aoqi@0 | 189 | * {@inheritDoc} |
aoqi@0 | 190 | */ |
aoqi@0 | 191 | public Content getMethodDoc(Content methodDocTree, |
aoqi@0 | 192 | boolean isLastContent) { |
aoqi@0 | 193 | return getMemberTree(methodDocTree, isLastContent); |
aoqi@0 | 194 | } |
aoqi@0 | 195 | |
aoqi@0 | 196 | /** |
aoqi@0 | 197 | * Close the writer. |
aoqi@0 | 198 | */ |
aoqi@0 | 199 | public void close() throws IOException { |
aoqi@0 | 200 | writer.close(); |
aoqi@0 | 201 | } |
aoqi@0 | 202 | |
aoqi@0 | 203 | public int getMemberKind() { |
aoqi@0 | 204 | return VisibleMemberMap.METHODS; |
aoqi@0 | 205 | } |
aoqi@0 | 206 | |
aoqi@0 | 207 | /** |
aoqi@0 | 208 | * {@inheritDoc} |
aoqi@0 | 209 | */ |
aoqi@0 | 210 | public void addSummaryLabel(Content memberTree) { |
aoqi@0 | 211 | Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, |
aoqi@0 | 212 | writer.getResource("doclet.Method_Summary")); |
aoqi@0 | 213 | memberTree.addContent(label); |
aoqi@0 | 214 | } |
aoqi@0 | 215 | |
aoqi@0 | 216 | /** |
aoqi@0 | 217 | * {@inheritDoc} |
aoqi@0 | 218 | */ |
aoqi@0 | 219 | public String getTableSummary() { |
aoqi@0 | 220 | return configuration.getText("doclet.Member_Table_Summary", |
aoqi@0 | 221 | configuration.getText("doclet.Method_Summary"), |
aoqi@0 | 222 | configuration.getText("doclet.methods")); |
aoqi@0 | 223 | } |
aoqi@0 | 224 | |
aoqi@0 | 225 | /** |
aoqi@0 | 226 | * {@inheritDoc} |
aoqi@0 | 227 | */ |
aoqi@0 | 228 | public Content getCaption() { |
aoqi@0 | 229 | return configuration.getResource("doclet.Methods"); |
aoqi@0 | 230 | } |
aoqi@0 | 231 | |
aoqi@0 | 232 | /** |
aoqi@0 | 233 | * {@inheritDoc} |
aoqi@0 | 234 | */ |
aoqi@0 | 235 | public String[] getSummaryTableHeader(ProgramElementDoc member) { |
aoqi@0 | 236 | String[] header = new String[] { |
aoqi@0 | 237 | writer.getModifierTypeHeader(), |
aoqi@0 | 238 | configuration.getText("doclet.0_and_1", |
aoqi@0 | 239 | configuration.getText("doclet.Method"), |
aoqi@0 | 240 | configuration.getText("doclet.Description")) |
aoqi@0 | 241 | }; |
aoqi@0 | 242 | return header; |
aoqi@0 | 243 | } |
aoqi@0 | 244 | |
aoqi@0 | 245 | /** |
aoqi@0 | 246 | * {@inheritDoc} |
aoqi@0 | 247 | */ |
aoqi@0 | 248 | public void addSummaryAnchor(ClassDoc cd, Content memberTree) { |
aoqi@0 | 249 | memberTree.addContent(writer.getMarkerAnchor( |
aoqi@0 | 250 | SectionName.METHOD_SUMMARY)); |
aoqi@0 | 251 | } |
aoqi@0 | 252 | |
aoqi@0 | 253 | /** |
aoqi@0 | 254 | * {@inheritDoc} |
aoqi@0 | 255 | */ |
aoqi@0 | 256 | public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { |
aoqi@0 | 257 | inheritedTree.addContent(writer.getMarkerAnchor( |
aoqi@0 | 258 | SectionName.METHODS_INHERITANCE, configuration.getClassName(cd))); |
aoqi@0 | 259 | } |
aoqi@0 | 260 | |
aoqi@0 | 261 | /** |
aoqi@0 | 262 | * {@inheritDoc} |
aoqi@0 | 263 | */ |
aoqi@0 | 264 | public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { |
aoqi@0 | 265 | Content classLink = writer.getPreQualifiedClassLink( |
aoqi@0 | 266 | LinkInfoImpl.Kind.MEMBER, cd, false); |
aoqi@0 | 267 | Content label = new StringContent(cd.isClass() ? |
aoqi@0 | 268 | configuration.getText("doclet.Methods_Inherited_From_Class") : |
aoqi@0 | 269 | configuration.getText("doclet.Methods_Inherited_From_Interface")); |
aoqi@0 | 270 | Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, |
aoqi@0 | 271 | label); |
aoqi@0 | 272 | labelHeading.addContent(writer.getSpace()); |
aoqi@0 | 273 | labelHeading.addContent(classLink); |
aoqi@0 | 274 | inheritedTree.addContent(labelHeading); |
aoqi@0 | 275 | } |
aoqi@0 | 276 | |
aoqi@0 | 277 | /** |
aoqi@0 | 278 | * {@inheritDoc} |
aoqi@0 | 279 | */ |
aoqi@0 | 280 | protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { |
aoqi@0 | 281 | MethodDoc meth = (MethodDoc)member; |
aoqi@0 | 282 | addModifierAndType(meth, meth.returnType(), tdSummaryType); |
aoqi@0 | 283 | } |
aoqi@0 | 284 | |
aoqi@0 | 285 | /** |
aoqi@0 | 286 | * {@inheritDoc} |
aoqi@0 | 287 | */ |
aoqi@0 | 288 | protected static void addOverridden(HtmlDocletWriter writer, |
aoqi@0 | 289 | Type overriddenType, MethodDoc method, Content dl) { |
aoqi@0 | 290 | if (writer.configuration.nocomment) { |
aoqi@0 | 291 | return; |
aoqi@0 | 292 | } |
aoqi@0 | 293 | ClassDoc holderClassDoc = overriddenType.asClassDoc(); |
aoqi@0 | 294 | if (! (holderClassDoc.isPublic() || |
aoqi@0 | 295 | Util.isLinkable(holderClassDoc, writer.configuration))) { |
aoqi@0 | 296 | //This is an implementation detail that should not be documented. |
aoqi@0 | 297 | return; |
aoqi@0 | 298 | } |
aoqi@0 | 299 | if (overriddenType.asClassDoc().isIncluded() && ! method.isIncluded()) { |
aoqi@0 | 300 | //The class is included but the method is not. That means that it |
aoqi@0 | 301 | //is not visible so don't document this. |
aoqi@0 | 302 | return; |
aoqi@0 | 303 | } |
aoqi@0 | 304 | Content label = writer.overridesLabel; |
aoqi@0 | 305 | LinkInfoImpl.Kind context = LinkInfoImpl.Kind.METHOD_OVERRIDES; |
aoqi@0 | 306 | |
aoqi@0 | 307 | if (method != null) { |
aoqi@0 | 308 | if (overriddenType.asClassDoc().isAbstract() && method.isAbstract()){ |
aoqi@0 | 309 | //Abstract method is implemented from abstract class, |
aoqi@0 | 310 | //not overridden |
aoqi@0 | 311 | label = writer.specifiedByLabel; |
aoqi@0 | 312 | context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY; |
aoqi@0 | 313 | } |
aoqi@0 | 314 | Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, label)); |
aoqi@0 | 315 | dl.addContent(dt); |
aoqi@0 | 316 | Content overriddenTypeLink = |
aoqi@0 | 317 | writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType)); |
aoqi@0 | 318 | Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink); |
aoqi@0 | 319 | String name = method.name(); |
aoqi@0 | 320 | Content methlink = writer.getLink( |
aoqi@0 | 321 | new LinkInfoImpl(writer.configuration, LinkInfoImpl.Kind.MEMBER, |
aoqi@0 | 322 | overriddenType.asClassDoc()) |
aoqi@0 | 323 | .where(writer.getName(writer.getAnchor(method))).label(name)); |
aoqi@0 | 324 | Content codeMethLink = HtmlTree.CODE(methlink); |
aoqi@0 | 325 | Content dd = HtmlTree.DD(codeMethLink); |
aoqi@0 | 326 | dd.addContent(writer.getSpace()); |
aoqi@0 | 327 | dd.addContent(writer.getResource("doclet.in_class")); |
aoqi@0 | 328 | dd.addContent(writer.getSpace()); |
aoqi@0 | 329 | dd.addContent(codeOverridenTypeLink); |
aoqi@0 | 330 | dl.addContent(dd); |
aoqi@0 | 331 | } |
aoqi@0 | 332 | } |
aoqi@0 | 333 | |
aoqi@0 | 334 | /** |
aoqi@0 | 335 | * {@inheritDoc} |
aoqi@0 | 336 | */ |
aoqi@0 | 337 | protected static void addImplementsInfo(HtmlDocletWriter writer, |
aoqi@0 | 338 | MethodDoc method, Content dl) { |
aoqi@0 | 339 | if(writer.configuration.nocomment){ |
aoqi@0 | 340 | return; |
aoqi@0 | 341 | } |
aoqi@0 | 342 | ImplementedMethods implementedMethodsFinder = |
aoqi@0 | 343 | new ImplementedMethods(method, writer.configuration); |
aoqi@0 | 344 | MethodDoc[] implementedMethods = implementedMethodsFinder.build(); |
aoqi@0 | 345 | for (int i = 0; i < implementedMethods.length; i++) { |
aoqi@0 | 346 | MethodDoc implementedMeth = implementedMethods[i]; |
aoqi@0 | 347 | Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth); |
aoqi@0 | 348 | Content intfaclink = writer.getLink(new LinkInfoImpl( |
aoqi@0 | 349 | writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac)); |
aoqi@0 | 350 | Content codeIntfacLink = HtmlTree.CODE(intfaclink); |
aoqi@0 | 351 | Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, writer.specifiedByLabel)); |
aoqi@0 | 352 | dl.addContent(dt); |
aoqi@0 | 353 | Content methlink = writer.getDocLink( |
aoqi@0 | 354 | LinkInfoImpl.Kind.MEMBER, implementedMeth, |
aoqi@0 | 355 | implementedMeth.name(), false); |
aoqi@0 | 356 | Content codeMethLink = HtmlTree.CODE(methlink); |
aoqi@0 | 357 | Content dd = HtmlTree.DD(codeMethLink); |
aoqi@0 | 358 | dd.addContent(writer.getSpace()); |
aoqi@0 | 359 | dd.addContent(writer.getResource("doclet.in_interface")); |
aoqi@0 | 360 | dd.addContent(writer.getSpace()); |
aoqi@0 | 361 | dd.addContent(codeIntfacLink); |
aoqi@0 | 362 | dl.addContent(dd); |
aoqi@0 | 363 | } |
aoqi@0 | 364 | } |
aoqi@0 | 365 | |
aoqi@0 | 366 | /** |
aoqi@0 | 367 | * Add the return type. |
aoqi@0 | 368 | * |
aoqi@0 | 369 | * @param method the method being documented. |
aoqi@0 | 370 | * @param htmltree the content tree to which the return type will be added |
aoqi@0 | 371 | */ |
aoqi@0 | 372 | protected void addReturnType(MethodDoc method, Content htmltree) { |
aoqi@0 | 373 | Type type = method.returnType(); |
aoqi@0 | 374 | if (type != null) { |
aoqi@0 | 375 | Content linkContent = writer.getLink( |
aoqi@0 | 376 | new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type)); |
aoqi@0 | 377 | htmltree.addContent(linkContent); |
aoqi@0 | 378 | htmltree.addContent(writer.getSpace()); |
aoqi@0 | 379 | } |
aoqi@0 | 380 | } |
aoqi@0 | 381 | |
aoqi@0 | 382 | /** |
aoqi@0 | 383 | * {@inheritDoc} |
aoqi@0 | 384 | */ |
aoqi@0 | 385 | protected Content getNavSummaryLink(ClassDoc cd, boolean link) { |
aoqi@0 | 386 | if (link) { |
aoqi@0 | 387 | if (cd == null) { |
aoqi@0 | 388 | return writer.getHyperLink( |
aoqi@0 | 389 | SectionName.METHOD_SUMMARY, |
aoqi@0 | 390 | writer.getResource("doclet.navMethod")); |
aoqi@0 | 391 | } else { |
aoqi@0 | 392 | return writer.getHyperLink( |
aoqi@0 | 393 | SectionName.METHODS_INHERITANCE, |
aoqi@0 | 394 | configuration.getClassName(cd), writer.getResource("doclet.navMethod")); |
aoqi@0 | 395 | } |
aoqi@0 | 396 | } else { |
aoqi@0 | 397 | return writer.getResource("doclet.navMethod"); |
aoqi@0 | 398 | } |
aoqi@0 | 399 | } |
aoqi@0 | 400 | |
aoqi@0 | 401 | /** |
aoqi@0 | 402 | * {@inheritDoc} |
aoqi@0 | 403 | */ |
aoqi@0 | 404 | protected void addNavDetailLink(boolean link, Content liNav) { |
aoqi@0 | 405 | if (link) { |
aoqi@0 | 406 | liNav.addContent(writer.getHyperLink( |
aoqi@0 | 407 | SectionName.METHOD_DETAIL, writer.getResource("doclet.navMethod"))); |
aoqi@0 | 408 | } else { |
aoqi@0 | 409 | liNav.addContent(writer.getResource("doclet.navMethod")); |
aoqi@0 | 410 | } |
aoqi@0 | 411 | } |
aoqi@0 | 412 | } |