1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Mon Oct 15 17:07:55 2012 -0700 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Tue Oct 16 21:03:36 2012 -0700 1.3 @@ -206,33 +206,6 @@ 1.4 } 1.5 1.6 /** 1.7 - * Print Html Hyper Link, with target frame. This 1.8 - * link will only appear if page is not in a frame. 1.9 - * 1.10 - * @param link String name of the file. 1.11 - * @param where Position in the file 1.12 - * @param target Name of the target frame. 1.13 - * @param label Tag for the link. 1.14 - * @param strong Whether the label should be strong or not? 1.15 - */ 1.16 - public void printNoFramesTargetHyperLink(String link, String where, 1.17 - String target, String label, 1.18 - boolean strong) { 1.19 - script(); 1.20 - println(" <!--"); 1.21 - println(" if(window==top) {"); 1.22 - println(" document.writeln('" 1.23 - + getHyperLinkString(link, where, label, strong, "", "", target) + "');"); 1.24 - println(" }"); 1.25 - println(" //-->"); 1.26 - scriptEnd(); 1.27 - noScript(); 1.28 - println(" " + getHyperLinkString(link, where, label, strong, "", "", target)); 1.29 - noScriptEnd(); 1.30 - println(DocletConstants.NL); 1.31 - } 1.32 - 1.33 - /** 1.34 * Get the script to show or hide the All classes link. 1.35 * 1.36 * @param id id of the element to show or hide 1.37 @@ -329,14 +302,6 @@ 1.38 return new TagletWriterImpl(this, isFirstSentence); 1.39 } 1.40 1.41 - protected void printTagsInfoHeader() { 1.42 - dl(); 1.43 - } 1.44 - 1.45 - protected void printTagsInfoFooter() { 1.46 - dlEnd(); 1.47 - } 1.48 - 1.49 /** 1.50 * Get Package link, with target frame. 1.51 * 1.52 @@ -391,7 +356,7 @@ 1.53 head, body); 1.54 Content htmlDocument = new HtmlDocument(htmlDocType, 1.55 htmlComment, htmlTree); 1.56 - htmlDocument.write(this, true); 1.57 + write(htmlDocument); 1.58 } 1.59 1.60 /** 1.61 @@ -408,26 +373,6 @@ 1.62 } 1.63 1.64 /** 1.65 - * Print user specified header and the footer. 1.66 - * 1.67 - * @param header if true print the user provided header else print the 1.68 - * user provided footer. 1.69 - */ 1.70 - public void printUserHeaderFooter(boolean header) { 1.71 - em(); 1.72 - if (header) { 1.73 - print(replaceDocRootDir(configuration.header)); 1.74 - } else { 1.75 - if (configuration.footer.length() != 0) { 1.76 - print(replaceDocRootDir(configuration.footer)); 1.77 - } else { 1.78 - print(replaceDocRootDir(configuration.header)); 1.79 - } 1.80 - } 1.81 - emEnd(); 1.82 - } 1.83 - 1.84 - /** 1.85 * Get user specified header and the footer. 1.86 * 1.87 * @param header if true print the user provided header else print the 1.88 @@ -450,14 +395,6 @@ 1.89 } 1.90 1.91 /** 1.92 - * Print the user specified top. 1.93 - */ 1.94 - public void printTop() { 1.95 - print(replaceDocRootDir(configuration.top)); 1.96 - hr(); 1.97 - } 1.98 - 1.99 - /** 1.100 * Adds the user specified top. 1.101 * 1.102 * @param body the content tree to which user specified top will be added 1.103 @@ -468,14 +405,6 @@ 1.104 } 1.105 1.106 /** 1.107 - * Print the user specified bottom. 1.108 - */ 1.109 - public void printBottom() { 1.110 - hr(); 1.111 - print(replaceDocRootDir(configuration.bottom)); 1.112 - } 1.113 - 1.114 - /** 1.115 * Adds the user specified bottom. 1.116 * 1.117 * @param body the content tree to which user specified bottom will be added 1.118 @@ -488,128 +417,6 @@ 1.119 } 1.120 1.121 /** 1.122 - * Print the navigation bar for the Html page at the top and and the bottom. 1.123 - * 1.124 - * @param header If true print navigation bar at the top of the page else 1.125 - * print the nevigation bar at the bottom. 1.126 - */ 1.127 - protected void navLinks(boolean header) { 1.128 - println(""); 1.129 - if (!configuration.nonavbar) { 1.130 - if (header) { 1.131 - println(DocletConstants.NL + "<!-- ========= START OF TOP NAVBAR ======= -->"); 1.132 - anchor("navbar_top"); 1.133 - println(); 1.134 - print(getHyperLinkString("", "skip-navbar_top", "", false, "", 1.135 - configuration.getText("doclet.Skip_navigation_links"), "")); 1.136 - } else { 1.137 - println(DocletConstants.NL + "<!-- ======= START OF BOTTOM NAVBAR ====== -->"); 1.138 - anchor("navbar_bottom"); 1.139 - println(); 1.140 - print(getHyperLinkString("", "skip-navbar_bottom", "", false, "", 1.141 - configuration.getText("doclet.Skip_navigation_links"), "")); 1.142 - } 1.143 - table(0, "100%", 1, 0); 1.144 - tr(); 1.145 - tdColspanBgcolorStyle(2, "#EEEEFF", "NavBarCell1"); 1.146 - println(""); 1.147 - if (header) { 1.148 - anchor("navbar_top_firstrow"); 1.149 - } else { 1.150 - anchor("navbar_bottom_firstrow"); 1.151 - } 1.152 - table(0, 0, 3); 1.153 - print(" "); 1.154 - trAlignVAlign("center", "top"); 1.155 - 1.156 - if (configuration.createoverview) { 1.157 - navLinkContents(); 1.158 - } 1.159 - 1.160 - if (configuration.packages.length == 1) { 1.161 - navLinkPackage(configuration.packages[0]); 1.162 - } else if (configuration.packages.length > 1) { 1.163 - navLinkPackage(); 1.164 - } 1.165 - 1.166 - navLinkClass(); 1.167 - 1.168 - if(configuration.classuse) { 1.169 - navLinkClassUse(); 1.170 - } 1.171 - if(configuration.createtree) { 1.172 - navLinkTree(); 1.173 - } 1.174 - if(!(configuration.nodeprecated || 1.175 - configuration.nodeprecatedlist)) { 1.176 - navLinkDeprecated(); 1.177 - } 1.178 - if(configuration.createindex) { 1.179 - navLinkIndex(); 1.180 - } 1.181 - if (!configuration.nohelp) { 1.182 - navLinkHelp(); 1.183 - } 1.184 - print(" "); 1.185 - trEnd(); 1.186 - tableEnd(); 1.187 - tdEnd(); 1.188 - 1.189 - tdAlignVAlignRowspan("right", "top", 3); 1.190 - 1.191 - printUserHeaderFooter(header); 1.192 - tdEnd(); 1.193 - trEnd(); 1.194 - println(""); 1.195 - 1.196 - tr(); 1.197 - tdBgcolorStyle("white", "NavBarCell2"); 1.198 - font("-2"); 1.199 - space(); 1.200 - navLinkPrevious(); 1.201 - space(); 1.202 - println(""); 1.203 - space(); 1.204 - navLinkNext(); 1.205 - fontEnd(); 1.206 - tdEnd(); 1.207 - 1.208 - tdBgcolorStyle("white", "NavBarCell2"); 1.209 - font("-2"); 1.210 - print(" "); 1.211 - navShowLists(); 1.212 - print(" "); 1.213 - space(); 1.214 - println(""); 1.215 - space(); 1.216 - navHideLists(filename); 1.217 - print(" "); 1.218 - space(); 1.219 - println(""); 1.220 - space(); 1.221 - navLinkClassIndex(); 1.222 - fontEnd(); 1.223 - tdEnd(); 1.224 - 1.225 - trEnd(); 1.226 - 1.227 - printSummaryDetailLinks(); 1.228 - 1.229 - tableEnd(); 1.230 - if (header) { 1.231 - aName("skip-navbar_top"); 1.232 - aEnd(); 1.233 - println(DocletConstants.NL + "<!-- ========= END OF TOP NAVBAR ========= -->"); 1.234 - } else { 1.235 - aName("skip-navbar_bottom"); 1.236 - aEnd(); 1.237 - println(DocletConstants.NL + "<!-- ======== END OF BOTTOM NAVBAR ======= -->"); 1.238 - } 1.239 - println(""); 1.240 - } 1.241 - } 1.242 - 1.243 - /** 1.244 * Adds the navigation bar for the Html page at the top and and the bottom. 1.245 * 1.246 * @param header If true print navigation bar at the top of the page else 1.247 @@ -701,14 +508,6 @@ 1.248 } 1.249 1.250 /** 1.251 - * Print the word "NEXT" to indicate that no link is available. Override 1.252 - * this method to customize next link. 1.253 - */ 1.254 - protected void navLinkNext() { 1.255 - navLinkNext(null); 1.256 - } 1.257 - 1.258 - /** 1.259 * Get the word "NEXT" to indicate that no link is available. Override 1.260 * this method to customize next link. 1.261 * 1.262 @@ -719,14 +518,6 @@ 1.263 } 1.264 1.265 /** 1.266 - * Print the word "PREV" to indicate that no link is available. Override 1.267 - * this method to customize prev link. 1.268 - */ 1.269 - protected void navLinkPrevious() { 1.270 - navLinkPrevious(null); 1.271 - } 1.272 - 1.273 - /** 1.274 * Get the word "PREV" to indicate that no link is available. Override 1.275 * this method to customize prev link. 1.276 * 1.277 @@ -739,26 +530,10 @@ 1.278 /** 1.279 * Do nothing. This is the default method. 1.280 */ 1.281 - protected void printSummaryDetailLinks() { 1.282 - } 1.283 - 1.284 - /** 1.285 - * Do nothing. This is the default method. 1.286 - */ 1.287 protected void addSummaryDetailLinks(Content navDiv) { 1.288 } 1.289 1.290 /** 1.291 - * Print link to the "overview-summary.html" page. 1.292 - */ 1.293 - protected void navLinkContents() { 1.294 - navCellStart(); 1.295 - printHyperLink(relativePath + "overview-summary.html", "", 1.296 - configuration.getText("doclet.Overview"), true, "NavBarFont1"); 1.297 - navCellEnd(); 1.298 - } 1.299 - 1.300 - /** 1.301 * Get link to the "overview-summary.html" page. 1.302 * 1.303 * @return a content tree for the link 1.304 @@ -771,46 +546,6 @@ 1.305 } 1.306 1.307 /** 1.308 - * Description for a cell in the navigation bar. 1.309 - */ 1.310 - protected void navCellStart() { 1.311 - print(" "); 1.312 - tdBgcolorStyle("#EEEEFF", "NavBarCell1"); 1.313 - print(" "); 1.314 - } 1.315 - 1.316 - /** 1.317 - * Description for a cell in the navigation bar, but with reverse 1.318 - * high-light effect. 1.319 - */ 1.320 - protected void navCellRevStart() { 1.321 - print(" "); 1.322 - tdBgcolorStyle("#FFFFFF", "NavBarCell1Rev"); 1.323 - print(" "); 1.324 - space(); 1.325 - } 1.326 - 1.327 - /** 1.328 - * Closing tag for navigation bar cell. 1.329 - */ 1.330 - protected void navCellEnd() { 1.331 - space(); 1.332 - tdEnd(); 1.333 - } 1.334 - 1.335 - /** 1.336 - * Print link to the "package-summary.html" page for the package passed. 1.337 - * 1.338 - * @param pkg Package to which link will be generated. 1.339 - */ 1.340 - protected void navLinkPackage(PackageDoc pkg) { 1.341 - navCellStart(); 1.342 - printPackageLink(pkg, configuration.getText("doclet.Package"), true, 1.343 - "NavBarFont1"); 1.344 - navCellEnd(); 1.345 - } 1.346 - 1.347 - /** 1.348 * Get link to the "package-summary.html" page for the package passed. 1.349 * 1.350 * @param pkg Package to which link will be generated 1.351 @@ -824,18 +559,6 @@ 1.352 } 1.353 1.354 /** 1.355 - * Print the word "Package" in the navigation bar cell, to indicate that 1.356 - * link is not available here. 1.357 - */ 1.358 - protected void navLinkPackage() { 1.359 - navCellStart(); 1.360 - fontStyle("NavBarFont1"); 1.361 - printText("doclet.Package"); 1.362 - fontEnd(); 1.363 - navCellEnd(); 1.364 - } 1.365 - 1.366 - /** 1.367 * Get the word "Package" , to indicate that link is not available here. 1.368 * 1.369 * @return a content tree for the link 1.370 @@ -846,18 +569,6 @@ 1.371 } 1.372 1.373 /** 1.374 - * Print the word "Use" in the navigation bar cell, to indicate that link 1.375 - * is not available. 1.376 - */ 1.377 - protected void navLinkClassUse() { 1.378 - navCellStart(); 1.379 - fontStyle("NavBarFont1"); 1.380 - printText("doclet.navClassUse"); 1.381 - fontEnd(); 1.382 - navCellEnd(); 1.383 - } 1.384 - 1.385 - /** 1.386 * Get the word "Use", to indicate that link is not available. 1.387 * 1.388 * @return a content tree for the link 1.389 @@ -868,20 +579,6 @@ 1.390 } 1.391 1.392 /** 1.393 - * Print link for previous file. 1.394 - * 1.395 - * @param prev File name for the prev link. 1.396 - */ 1.397 - public void navLinkPrevious(String prev) { 1.398 - String tag = configuration.getText("doclet.Prev"); 1.399 - if (prev != null) { 1.400 - printHyperLink(prev, "", tag, true) ; 1.401 - } else { 1.402 - print(tag); 1.403 - } 1.404 - } 1.405 - 1.406 - /** 1.407 * Get link for previous file. 1.408 * 1.409 * @param prev File name for the prev link 1.410 @@ -898,21 +595,6 @@ 1.411 } 1.412 1.413 /** 1.414 - * Print link for next file. If next is null, just print the label 1.415 - * without linking it anywhere. 1.416 - * 1.417 - * @param next File name for the next link. 1.418 - */ 1.419 - public void navLinkNext(String next) { 1.420 - String tag = configuration.getText("doclet.Next"); 1.421 - if (next != null) { 1.422 - printHyperLink(next, "", tag, true); 1.423 - } else { 1.424 - print(tag); 1.425 - } 1.426 - } 1.427 - 1.428 - /** 1.429 * Get link for next file. If next is null, just print the label 1.430 * without linking it anywhere. 1.431 * 1.432 @@ -930,16 +612,6 @@ 1.433 } 1.434 1.435 /** 1.436 - * Print "FRAMES" link, to switch to the frame version of the output. 1.437 - * 1.438 - * @param link File to be linked, "index.html". 1.439 - */ 1.440 - protected void navShowLists(String link) { 1.441 - print(getHyperLinkString(link + "?" + path + filename, "", 1.442 - configuration.getText("doclet.FRAMES"), true, "", "", "_top")); 1.443 - } 1.444 - 1.445 - /** 1.446 * Get "FRAMES" link, to switch to the frame version of the output. 1.447 * 1.448 * @param link File to be linked, "index.html" 1.449 @@ -953,13 +625,6 @@ 1.450 } 1.451 1.452 /** 1.453 - * Print "FRAMES" link, to switch to the frame version of the output. 1.454 - */ 1.455 - protected void navShowLists() { 1.456 - navShowLists(relativePath + "index.html"); 1.457 - } 1.458 - 1.459 - /** 1.460 * Get "FRAMES" link, to switch to the frame version of the output. 1.461 * 1.462 * @return a content tree for the link 1.463 @@ -969,16 +634,6 @@ 1.464 } 1.465 1.466 /** 1.467 - * Print "NO FRAMES" link, to switch to the non-frame version of the output. 1.468 - * 1.469 - * @param link File to be linked. 1.470 - */ 1.471 - protected void navHideLists(String link) { 1.472 - print(getHyperLinkString(link, "", configuration.getText("doclet.NO_FRAMES"), 1.473 - true, "", "", "_top")); 1.474 - } 1.475 - 1.476 - /** 1.477 * Get "NO FRAMES" link, to switch to the non-frame version of the output. 1.478 * 1.479 * @param link File to be linked 1.480 @@ -991,25 +646,6 @@ 1.481 } 1.482 1.483 /** 1.484 - * Print "Tree" link in the navigation bar. If there is only one package 1.485 - * specified on the command line, then the "Tree" link will be to the 1.486 - * only "package-tree.html" file otherwise it will be to the 1.487 - * "overview-tree.html" file. 1.488 - */ 1.489 - protected void navLinkTree() { 1.490 - navCellStart(); 1.491 - PackageDoc[] packages = configuration.root.specifiedPackages(); 1.492 - if (packages.length == 1 && configuration.root.specifiedClasses().length == 0) { 1.493 - printHyperLink(pathString(packages[0], "package-tree.html"), "", 1.494 - configuration.getText("doclet.Tree"), true, "NavBarFont1"); 1.495 - } else { 1.496 - printHyperLink(relativePath + "overview-tree.html", "", 1.497 - configuration.getText("doclet.Tree"), true, "NavBarFont1"); 1.498 - } 1.499 - navCellEnd(); 1.500 - } 1.501 - 1.502 - /** 1.503 * Get "Tree" link in the navigation bar. If there is only one package 1.504 * specified on the command line, then the "Tree" link will be to the 1.505 * only "package-tree.html" file otherwise it will be to the 1.506 @@ -1046,18 +682,6 @@ 1.507 } 1.508 1.509 /** 1.510 - * Print the word "Class" in the navigation bar cell, to indicate that 1.511 - * class link is not available. 1.512 - */ 1.513 - protected void navLinkClass() { 1.514 - navCellStart(); 1.515 - fontStyle("NavBarFont1"); 1.516 - printText("doclet.Class"); 1.517 - fontEnd(); 1.518 - navCellEnd(); 1.519 - } 1.520 - 1.521 - /** 1.522 * Get the word "Class", to indicate that class link is not available. 1.523 * 1.524 * @return a content tree for the link 1.525 @@ -1068,16 +692,6 @@ 1.526 } 1.527 1.528 /** 1.529 - * Print "Deprecated" API link in the navigation bar. 1.530 - */ 1.531 - protected void navLinkDeprecated() { 1.532 - navCellStart(); 1.533 - printHyperLink(relativePath + "deprecated-list.html", "", 1.534 - configuration.getText("doclet.navDeprecated"), true, "NavBarFont1"); 1.535 - navCellEnd(); 1.536 - } 1.537 - 1.538 - /** 1.539 * Get "Deprecated" API link in the navigation bar. 1.540 * 1.541 * @return a content tree for the link 1.542 @@ -1090,17 +704,6 @@ 1.543 } 1.544 1.545 /** 1.546 - * Print link for generated index. If the user has used "-splitindex" 1.547 - * command line option, then link to file "index-files/index-1.html" is 1.548 - * generated otherwise link to file "index-all.html" is generated. 1.549 - */ 1.550 - protected void navLinkClassIndex() { 1.551 - printNoFramesTargetHyperLink(relativePath + 1.552 - AllClassesFrameWriter.OUTPUT_FILE_NAME_NOFRAMES, 1.553 - "", "", configuration.getText("doclet.All_Classes"), true); 1.554 - } 1.555 - 1.556 - /** 1.557 * Get link for generated index. If the user has used "-splitindex" 1.558 * command line option, then link to file "index-files/index-1.html" is 1.559 * generated otherwise link to file "index-all.html" is generated. 1.560 @@ -1114,20 +717,6 @@ 1.561 Content li = HtmlTree.LI(allClassesContent); 1.562 return li; 1.563 } 1.564 - /** 1.565 - * Print link for generated class index. 1.566 - */ 1.567 - protected void navLinkIndex() { 1.568 - navCellStart(); 1.569 - printHyperLink(relativePath + 1.570 - (configuration.splitindex? 1.571 - DirectoryManager.getPath("index-files") + 1.572 - fileseparator: "") + 1.573 - (configuration.splitindex? 1.574 - "index-1.html" : "index-all.html"), "", 1.575 - configuration.getText("doclet.Index"), true, "NavBarFont1"); 1.576 - navCellEnd(); 1.577 - } 1.578 1.579 /** 1.580 * Get link for generated class index. 1.581 @@ -1144,27 +733,6 @@ 1.582 } 1.583 1.584 /** 1.585 - * Print help file link. If user has provided a help file, then generate a 1.586 - * link to the user given file, which is already copied to current or 1.587 - * destination directory. 1.588 - */ 1.589 - protected void navLinkHelp() { 1.590 - String helpfilenm = configuration.helpfile; 1.591 - if (helpfilenm.equals("")) { 1.592 - helpfilenm = "help-doc.html"; 1.593 - } else { 1.594 - int lastsep; 1.595 - if ((lastsep = helpfilenm.lastIndexOf(File.separatorChar)) != -1) { 1.596 - helpfilenm = helpfilenm.substring(lastsep + 1); 1.597 - } 1.598 - } 1.599 - navCellStart(); 1.600 - printHyperLink(relativePath + helpfilenm, "", 1.601 - configuration.getText("doclet.Help"), true, "NavBarFont1"); 1.602 - navCellEnd(); 1.603 - } 1.604 - 1.605 - /** 1.606 * Get help file link. If user has provided a help file, then generate a 1.607 * link to the user given file, which is already copied to current or 1.608 * destination directory. 1.609 @@ -1188,87 +756,6 @@ 1.610 } 1.611 1.612 /** 1.613 - * Print the word "Detail" in the navigation bar. No link is available. 1.614 - */ 1.615 - protected void navDetail() { 1.616 - printText("doclet.Detail"); 1.617 - } 1.618 - 1.619 - /** 1.620 - * Print the word "Summary" in the navigation bar. No link is available. 1.621 - */ 1.622 - protected void navSummary() { 1.623 - printText("doclet.Summary"); 1.624 - } 1.625 - 1.626 - /** 1.627 - * Print the Html table tag for the index summary tables. The table tag 1.628 - * printed is 1.629 - * {@code <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> } 1.630 - */ 1.631 - public void tableIndexSummary() { 1.632 - table(1, "100%", 3, 0); 1.633 - } 1.634 - 1.635 - /** 1.636 - * Print the Html table tag for the index summary tables. 1.637 - * 1.638 - * @param summary the summary for the table tag summary attribute. 1.639 - */ 1.640 - public void tableIndexSummary(String summary) { 1.641 - table(1, "100%", 3, 0, summary); 1.642 - } 1.643 - 1.644 - /** 1.645 - * Same as {@link #tableIndexSummary()}. 1.646 - */ 1.647 - public void tableIndexDetail() { 1.648 - table(1, "100%", 3, 0); 1.649 - } 1.650 - 1.651 - /** 1.652 - * Print Html tag for table elements. The tag printed is 1.653 - * <TD ALIGN="right" VALIGN="top" WIDTH="1%">. 1.654 - */ 1.655 - public void tdIndex() { 1.656 - print("<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\">"); 1.657 - } 1.658 - 1.659 - /** 1.660 - * Print table caption. 1.661 - */ 1.662 - public void tableCaptionStart() { 1.663 - captionStyle("TableCaption"); 1.664 - } 1.665 - 1.666 - /** 1.667 - * Print table sub-caption. 1.668 - */ 1.669 - public void tableSubCaptionStart() { 1.670 - captionStyle("TableSubCaption"); 1.671 - } 1.672 - 1.673 - /** 1.674 - * Print table caption end tags. 1.675 - */ 1.676 - public void tableCaptionEnd() { 1.677 - captionEnd(); 1.678 - } 1.679 - 1.680 - /** 1.681 - * Print summary table header. 1.682 - */ 1.683 - public void summaryTableHeader(String[] header, String scope) { 1.684 - tr(); 1.685 - for ( int i=0; i < header.length; i++ ) { 1.686 - thScopeNoWrap("TableHeader", scope); 1.687 - print(header[i]); 1.688 - thEnd(); 1.689 - } 1.690 - trEnd(); 1.691 - } 1.692 - 1.693 - /** 1.694 * Get summary table header. 1.695 * 1.696 * @param header the header for the table 1.697 @@ -1397,144 +884,6 @@ 1.698 } 1.699 1.700 /** 1.701 - * Prine table header information about color, column span and the font. 1.702 - * 1.703 - * @param color Background color. 1.704 - * @param span Column span. 1.705 - */ 1.706 - public void tableHeaderStart(String color, int span) { 1.707 - trBgcolorStyle(color, "TableHeadingColor"); 1.708 - thAlignColspan("left", span); 1.709 - font("+2"); 1.710 - } 1.711 - 1.712 - /** 1.713 - * Print table header for the inherited members summary tables. Print the 1.714 - * background color information. 1.715 - * 1.716 - * @param color Background color. 1.717 - */ 1.718 - public void tableInheritedHeaderStart(String color) { 1.719 - trBgcolorStyle(color, "TableSubHeadingColor"); 1.720 - thAlign("left"); 1.721 - } 1.722 - 1.723 - /** 1.724 - * Print "Use" table header. Print the background color and the column span. 1.725 - * 1.726 - * @param color Background color. 1.727 - */ 1.728 - public void tableUseInfoHeaderStart(String color) { 1.729 - trBgcolorStyle(color, "TableSubHeadingColor"); 1.730 - thAlignColspan("left", 2); 1.731 - } 1.732 - 1.733 - /** 1.734 - * Print table header with the background color with default column span 2. 1.735 - * 1.736 - * @param color Background color. 1.737 - */ 1.738 - public void tableHeaderStart(String color) { 1.739 - tableHeaderStart(color, 2); 1.740 - } 1.741 - 1.742 - /** 1.743 - * Print table header with the column span, with the default color #CCCCFF. 1.744 - * 1.745 - * @param span Column span. 1.746 - */ 1.747 - public void tableHeaderStart(int span) { 1.748 - tableHeaderStart("#CCCCFF", span); 1.749 - } 1.750 - 1.751 - /** 1.752 - * Print table header with default column span 2 and default color #CCCCFF. 1.753 - */ 1.754 - public void tableHeaderStart() { 1.755 - tableHeaderStart(2); 1.756 - } 1.757 - 1.758 - /** 1.759 - * Print table header end tags for font, column and row. 1.760 - */ 1.761 - public void tableHeaderEnd() { 1.762 - fontEnd(); 1.763 - thEnd(); 1.764 - trEnd(); 1.765 - } 1.766 - 1.767 - /** 1.768 - * Print table header end tags in inherited tables for column and row. 1.769 - */ 1.770 - public void tableInheritedHeaderEnd() { 1.771 - thEnd(); 1.772 - trEnd(); 1.773 - } 1.774 - 1.775 - /** 1.776 - * Print the summary table row cell attribute width. 1.777 - * 1.778 - * @param width Width of the table cell. 1.779 - */ 1.780 - public void summaryRow(int width) { 1.781 - if (width != 0) { 1.782 - tdWidth(width + "%"); 1.783 - } else { 1.784 - td(); 1.785 - } 1.786 - } 1.787 - 1.788 - /** 1.789 - * Print the summary table row cell end tag. 1.790 - */ 1.791 - public void summaryRowEnd() { 1.792 - tdEnd(); 1.793 - } 1.794 - 1.795 - /** 1.796 - * Print the heading in Html {@literal <H2>} format. 1.797 - * 1.798 - * @param str The Header string. 1.799 - */ 1.800 - public void printIndexHeading(String str) { 1.801 - h2(); 1.802 - print(str); 1.803 - h2End(); 1.804 - } 1.805 - 1.806 - /** 1.807 - * Print Html tag <FRAMESET=arg>. 1.808 - * 1.809 - * @param arg Argument for the tag. 1.810 - */ 1.811 - public void frameSet(String arg) { 1.812 - println("<FRAMESET " + arg + ">"); 1.813 - } 1.814 - 1.815 - /** 1.816 - * Print Html closing tag </FRAMESET>. 1.817 - */ 1.818 - public void frameSetEnd() { 1.819 - println("</FRAMESET>"); 1.820 - } 1.821 - 1.822 - /** 1.823 - * Print Html tag <FRAME=arg>. 1.824 - * 1.825 - * @param arg Argument for the tag. 1.826 - */ 1.827 - public void frame(String arg) { 1.828 - println("<FRAME " + arg + ">"); 1.829 - } 1.830 - 1.831 - /** 1.832 - * Print Html closing tag </FRAME>. 1.833 - */ 1.834 - public void frameEnd() { 1.835 - println("</FRAME>"); 1.836 - } 1.837 - 1.838 - /** 1.839 * Return path to the class page for a classdoc. For example, the class 1.840 * name is "java.lang.Object" and if the current file getting generated is 1.841 * "java/io/File.html", then the path string to the class, returned is 1.842 @@ -1573,30 +922,6 @@ 1.843 } 1.844 1.845 /** 1.846 - * Print the link to the given package. 1.847 - * 1.848 - * @param pkg the package to link to. 1.849 - * @param label the label for the link. 1.850 - * @param isStrong true if the label should be strong. 1.851 - */ 1.852 - public void printPackageLink(PackageDoc pkg, String label, boolean isStrong) { 1.853 - print(getPackageLinkString(pkg, label, isStrong)); 1.854 - } 1.855 - 1.856 - /** 1.857 - * Print the link to the given package. 1.858 - * 1.859 - * @param pkg the package to link to. 1.860 - * @param label the label for the link. 1.861 - * @param isStrong true if the label should be strong. 1.862 - * @param style the font of the package link label. 1.863 - */ 1.864 - public void printPackageLink(PackageDoc pkg, String label, boolean isStrong, 1.865 - String style) { 1.866 - print(getPackageLinkString(pkg, label, isStrong, style)); 1.867 - } 1.868 - 1.869 - /** 1.870 * Return the link to the given package. 1.871 * 1.872 * @param pkg the package to link to. 1.873 @@ -1679,21 +1004,6 @@ 1.874 return (cd.isInterface())? italicsText(name): name; 1.875 } 1.876 1.877 - public void printSrcLink(ProgramElementDoc d, String label) { 1.878 - if (d == null) { 1.879 - return; 1.880 - } 1.881 - ClassDoc cd = d.containingClass(); 1.882 - if (cd == null) { 1.883 - //d must be a class doc since in has no containing class. 1.884 - cd = (ClassDoc) d; 1.885 - } 1.886 - String href = relativePath + DocletConstants.SOURCE_OUTPUT_DIR_NAME 1.887 - + DirectoryManager.getDirectoryPath(cd.containingPackage()) 1.888 - + cd.name() + ".html#" + SourceToHTMLConverter.getAnchorName(d); 1.889 - printHyperLink(href, "", label, true); 1.890 - } 1.891 - 1.892 /** 1.893 * Add the link to the content tree. 1.894 * 1.895 @@ -1743,13 +1053,6 @@ 1.896 factory.getTypeParameterLinks(linkInfo, false)).toString(); 1.897 } 1.898 1.899 - /** 1.900 - * Print the link to the given class. 1.901 - */ 1.902 - public void printLink(LinkInfoImpl linkInfo) { 1.903 - print(getLink(linkInfo)); 1.904 - } 1.905 - 1.906 /************************************************************* 1.907 * Return a class cross link to external class documentation. 1.908 * The name must be fully qualified to determine which package 1.909 @@ -1773,7 +1076,7 @@ 1.910 while((periodIndex = packageName.lastIndexOf('.')) != -1) { 1.911 className = packageName.substring(periodIndex + 1, packageName.length()) + 1.912 (className.length() > 0 ? "." + className : ""); 1.913 - String defaultLabel = code ? getCode() + className + getCodeEnd() : className; 1.914 + String defaultLabel = code ? codeText(className) : className; 1.915 packageName = packageName.substring(0, periodIndex); 1.916 if (getCrossPackageLink(packageName) != null) { 1.917 //The package exists in external documentation, so link to the external 1.918 @@ -1881,30 +1184,6 @@ 1.919 addPreQualifiedClassLink(context, cd, true, contentTree); 1.920 } 1.921 1.922 - public void printText(String key) { 1.923 - print(configuration.getText(key)); 1.924 - } 1.925 - 1.926 - public void printText(String key, String a1) { 1.927 - print(configuration.getText(key, a1)); 1.928 - } 1.929 - 1.930 - public void printText(String key, String a1, String a2) { 1.931 - print(configuration.getText(key, a1, a2)); 1.932 - } 1.933 - 1.934 - public void strongText(String key) { 1.935 - strong(configuration.getText(key)); 1.936 - } 1.937 - 1.938 - public void strongText(String key, String a1) { 1.939 - strong(configuration.getText(key, a1)); 1.940 - } 1.941 - 1.942 - public void strongText(String key, String a1, String a2) { 1.943 - strong(configuration.getText(key, a1, a2)); 1.944 - } 1.945 - 1.946 /** 1.947 * Get the link for the given member. 1.948 * 1.949 @@ -1918,22 +1197,6 @@ 1.950 } 1.951 1.952 /** 1.953 - * Print the link for the given member. 1.954 - * 1.955 - * @param context the id of the context where the link will be printed. 1.956 - * @param classDoc the classDoc that we should link to. This is not 1.957 - * necessarily equal to doc.containingClass(). We may be 1.958 - * inheriting comments. 1.959 - * @param doc the member being linked to. 1.960 - * @param label the label for the link. 1.961 - * @param strong true if the link should be strong. 1.962 - */ 1.963 - public void printDocLink(int context, ClassDoc classDoc, MemberDoc doc, 1.964 - String label, boolean strong) { 1.965 - print(getDocLink(context, classDoc, doc, label, strong)); 1.966 - } 1.967 - 1.968 - /** 1.969 * Return the link for the given member. 1.970 * 1.971 * @param context the id of the context where the link will be printed. 1.972 @@ -2004,10 +1267,6 @@ 1.973 } 1.974 } 1.975 1.976 - public void anchor(ExecutableMemberDoc emd) { 1.977 - anchor(getAnchor(emd)); 1.978 - } 1.979 - 1.980 public String getAnchor(ExecutableMemberDoc emd) { 1.981 StringBuilder signature = new StringBuilder(emd.signature()); 1.982 StringBuilder signatureParsed = new StringBuilder(); 1.983 @@ -2030,66 +1289,61 @@ 1.984 if (! (tagName.startsWith("@link") || tagName.equals("@see"))) { 1.985 return ""; 1.986 } 1.987 - StringBuilder result = new StringBuilder(); 1.988 - boolean isplaintext = tagName.toLowerCase().equals("@linkplain"); 1.989 - String label = see.label(); 1.990 - label = (label.length() > 0)? 1.991 - ((isplaintext) ? label : 1.992 - getCode() + label + getCodeEnd()):""; 1.993 + 1.994 String seetext = replaceDocRootDir(see.text()); 1.995 1.996 //Check if @see is an href or "string" 1.997 if (seetext.startsWith("<") || seetext.startsWith("\"")) { 1.998 - result.append(seetext); 1.999 - return result.toString(); 1.1000 + return seetext; 1.1001 } 1.1002 1.1003 + boolean plain = tagName.equalsIgnoreCase("@linkplain"); 1.1004 + String label = plainOrCodeText(plain, see.label()); 1.1005 + 1.1006 //The text from the @see tag. We will output this text when a label is not specified. 1.1007 - String text = (isplaintext) ? seetext : getCode() + seetext + getCodeEnd(); 1.1008 + String text = plainOrCodeText(plain, seetext); 1.1009 1.1010 ClassDoc refClass = see.referencedClass(); 1.1011 String refClassName = see.referencedClassName(); 1.1012 MemberDoc refMem = see.referencedMember(); 1.1013 String refMemName = see.referencedMemberName(); 1.1014 + 1.1015 if (refClass == null) { 1.1016 //@see is not referencing an included class 1.1017 PackageDoc refPackage = see.referencedPackage(); 1.1018 if (refPackage != null && refPackage.isIncluded()) { 1.1019 //@see is referencing an included package 1.1020 - String packageName = isplaintext ? refPackage.name() : 1.1021 - getCode() + refPackage.name() + getCodeEnd(); 1.1022 - result.append(getPackageLinkString(refPackage, 1.1023 - label.length() == 0 ? packageName : label, false)); 1.1024 + if (label.isEmpty()) 1.1025 + label = plainOrCodeText(plain, refPackage.name()); 1.1026 + return getPackageLinkString(refPackage, label, false); 1.1027 } else { 1.1028 //@see is not referencing an included class or package. Check for cross links. 1.1029 String classCrossLink, packageCrossLink = getCrossPackageLink(refClassName); 1.1030 if (packageCrossLink != null) { 1.1031 //Package cross link found 1.1032 - result.append(getHyperLinkString(packageCrossLink, "", 1.1033 - (label.length() == 0)? text : label, false)); 1.1034 + return getHyperLinkString(packageCrossLink, "", 1.1035 + (label.isEmpty() ? text : label), false); 1.1036 } else if ((classCrossLink = getCrossClassLink(refClassName, 1.1037 - refMemName, label, false, "", ! isplaintext)) != null) { 1.1038 - //Class cross link found (possiblly to a member in the class) 1.1039 - result.append(classCrossLink); 1.1040 + refMemName, label, false, "", !plain)) != null) { 1.1041 + //Class cross link found (possibly to a member in the class) 1.1042 + return classCrossLink; 1.1043 } else { 1.1044 //No cross link found so print warning 1.1045 configuration.getDocletSpecificMsg().warning(see.position(), "doclet.see.class_or_package_not_found", 1.1046 tagName, seetext); 1.1047 - result.append((label.length() == 0)? text: label); 1.1048 + return (label.isEmpty() ? text: label); 1.1049 } 1.1050 } 1.1051 } else if (refMemName == null) { 1.1052 // Must be a class reference since refClass is not null and refMemName is null. 1.1053 - if (label.length() == 0) { 1.1054 - label = (isplaintext) ? refClass.name() : getCode() + refClass.name() + getCodeEnd(); 1.1055 - result.append(getLink(new LinkInfoImpl(refClass, label))); 1.1056 - } else { 1.1057 - result.append(getLink(new LinkInfoImpl(refClass, label))); 1.1058 + if (label.isEmpty()) { 1.1059 + label = plainOrCodeText(plain, refClass.name()); 1.1060 } 1.1061 + return getLink(new LinkInfoImpl(refClass, label)); 1.1062 } else if (refMem == null) { 1.1063 // Must be a member reference since refClass is not null and refMemName is not null. 1.1064 // However, refMem is null, so this referenced member does not exist. 1.1065 - result.append((label.length() == 0)? text: label); 1.1066 + return (label.isEmpty() ? text: label); 1.1067 } else { 1.1068 // Must be a member reference since refClass is not null and refMemName is not null. 1.1069 // refMem is not null, so this @see tag must be referencing a valid member. 1.1070 @@ -2121,17 +1375,16 @@ 1.1071 refMemName += ((ExecutableMemberDoc)refMem).signature(); 1.1072 } 1.1073 } 1.1074 - text = (isplaintext) ? 1.1075 - refMemName : getCode() + Util.escapeHtmlChars(refMemName) + getCodeEnd(); 1.1076 1.1077 - result.append(getDocLink(LinkInfoImpl.CONTEXT_SEE_TAG, containing, 1.1078 - refMem, (label.length() == 0)? text: label, false)); 1.1079 + text = plainOrCodeText(plain, Util.escapeHtmlChars(refMemName)); 1.1080 + 1.1081 + return getDocLink(LinkInfoImpl.CONTEXT_SEE_TAG, containing, 1.1082 + refMem, (label.isEmpty() ? text: label), false); 1.1083 } 1.1084 - return result.toString(); 1.1085 } 1.1086 1.1087 - public void printInlineComment(Doc doc, Tag tag) { 1.1088 - printCommentTags(doc, tag.inlineTags(), false, false); 1.1089 + private String plainOrCodeText(boolean plain, String text) { 1.1090 + return (plain || text.isEmpty()) ? text : codeText(text); 1.1091 } 1.1092 1.1093 /** 1.1094 @@ -2145,10 +1398,6 @@ 1.1095 addCommentTags(doc, tag.inlineTags(), false, false, htmltree); 1.1096 } 1.1097 1.1098 - public void printInlineDeprecatedComment(Doc doc, Tag tag) { 1.1099 - printCommentTags(doc, tag.inlineTags(), true, false); 1.1100 - } 1.1101 - 1.1102 /** 1.1103 * Add the inline deprecated comment. 1.1104 * 1.1105 @@ -2160,10 +1409,6 @@ 1.1106 addCommentTags(doc, tag.inlineTags(), true, false, htmltree); 1.1107 } 1.1108 1.1109 - public void printSummaryComment(Doc doc) { 1.1110 - printSummaryComment(doc, doc.firstSentenceTags()); 1.1111 - } 1.1112 - 1.1113 /** 1.1114 * Adds the summary content. 1.1115 * 1.1116 @@ -2174,10 +1419,6 @@ 1.1117 addSummaryComment(doc, doc.firstSentenceTags(), htmltree); 1.1118 } 1.1119 1.1120 - public void printSummaryComment(Doc doc, Tag[] firstSentenceTags) { 1.1121 - printCommentTags(doc, firstSentenceTags, false, true); 1.1122 - } 1.1123 - 1.1124 /** 1.1125 * Adds the summary content. 1.1126 * 1.1127 @@ -2189,23 +1430,10 @@ 1.1128 addCommentTags(doc, firstSentenceTags, false, true, htmltree); 1.1129 } 1.1130 1.1131 - public void printSummaryDeprecatedComment(Doc doc) { 1.1132 - printCommentTags(doc, doc.firstSentenceTags(), true, true); 1.1133 - } 1.1134 - 1.1135 - public void printSummaryDeprecatedComment(Doc doc, Tag tag) { 1.1136 - printCommentTags(doc, tag.firstSentenceTags(), true, true); 1.1137 - } 1.1138 - 1.1139 public void addSummaryDeprecatedComment(Doc doc, Tag tag, Content htmltree) { 1.1140 addCommentTags(doc, tag.firstSentenceTags(), true, true, htmltree); 1.1141 } 1.1142 1.1143 - public void printInlineComment(Doc doc) { 1.1144 - printCommentTags(doc, doc.inlineTags(), false, false); 1.1145 - p(); 1.1146 - } 1.1147 - 1.1148 /** 1.1149 * Adds the inline comment. 1.1150 * 1.1151 @@ -2216,27 +1444,6 @@ 1.1152 addCommentTags(doc, doc.inlineTags(), false, false, htmltree); 1.1153 } 1.1154 1.1155 - public void printInlineDeprecatedComment(Doc doc) { 1.1156 - printCommentTags(doc, doc.inlineTags(), true, false); 1.1157 - } 1.1158 - 1.1159 - private void printCommentTags(Doc doc, Tag[] tags, boolean depr, boolean first) { 1.1160 - if(configuration.nocomment){ 1.1161 - return; 1.1162 - } 1.1163 - if (depr) { 1.1164 - italic(); 1.1165 - } 1.1166 - String result = commentTagsToString(null, doc, tags, first); 1.1167 - print(result); 1.1168 - if (depr) { 1.1169 - italicEnd(); 1.1170 - } 1.1171 - if (tags.length == 0) { 1.1172 - space(); 1.1173 - } 1.1174 - } 1.1175 - 1.1176 /** 1.1177 * Adds the comment tags. 1.1178 * 1.1179 @@ -2501,22 +1708,6 @@ 1.1180 } 1.1181 } 1.1182 1.1183 - public void printStyleSheetProperties() { 1.1184 - String filename = configuration.stylesheetfile; 1.1185 - if (filename.length() > 0) { 1.1186 - File stylefile = new File(filename); 1.1187 - String parent = stylefile.getParent(); 1.1188 - filename = (parent == null)? 1.1189 - filename: 1.1190 - filename.substring(parent.length() + 1); 1.1191 - } else { 1.1192 - filename = "stylesheet.css"; 1.1193 - } 1.1194 - filename = relativePath + filename; 1.1195 - link("REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"" + 1.1196 - filename + "\" " + "TITLE=\"Style\""); 1.1197 - } 1.1198 - 1.1199 /** 1.1200 * Returns a link to the stylesheet file. 1.1201 * 1.1202 @@ -2548,15 +1739,6 @@ 1.1203 } 1.1204 1.1205 /** 1.1206 - * Write the annotatation types for the given packageDoc. 1.1207 - * 1.1208 - * @param packageDoc the package to write annotations for. 1.1209 - */ 1.1210 - public void writeAnnotationInfo(PackageDoc packageDoc) { 1.1211 - writeAnnotationInfo(packageDoc, packageDoc.annotations()); 1.1212 - } 1.1213 - 1.1214 - /** 1.1215 * Adds the annotatation types for the given packageDoc. 1.1216 * 1.1217 * @param packageDoc the package to write annotations for. 1.1218 @@ -2568,15 +1750,6 @@ 1.1219 } 1.1220 1.1221 /** 1.1222 - * Write the annotatation types for the given doc. 1.1223 - * 1.1224 - * @param doc the doc to write annotations for. 1.1225 - */ 1.1226 - public void writeAnnotationInfo(ProgramElementDoc doc) { 1.1227 - writeAnnotationInfo(doc, doc.annotations()); 1.1228 - } 1.1229 - 1.1230 - /** 1.1231 * Adds the annotatation types for the given doc. 1.1232 * 1.1233 * @param doc the package to write annotations for 1.1234 @@ -2587,17 +1760,6 @@ 1.1235 } 1.1236 1.1237 /** 1.1238 - * Write the annotatation types for the given doc and parameter. 1.1239 - * 1.1240 - * @param indent the number of spaced to indent the parameters. 1.1241 - * @param doc the doc to write annotations for. 1.1242 - * @param param the parameter to write annotations for. 1.1243 - */ 1.1244 - public boolean writeAnnotationInfo(int indent, Doc doc, Parameter param) { 1.1245 - return writeAnnotationInfo(indent, doc, param.annotations(), false); 1.1246 - } 1.1247 - 1.1248 - /** 1.1249 * Add the annotatation types for the given doc and parameter. 1.1250 * 1.1251 * @param indent the number of spaces to indent the parameters. 1.1252 @@ -2611,16 +1773,6 @@ 1.1253 } 1.1254 1.1255 /** 1.1256 - * Write the annotatation types for the given doc. 1.1257 - * 1.1258 - * @param doc the doc to write annotations for. 1.1259 - * @param descList the array of {@link AnnotationDesc}. 1.1260 - */ 1.1261 - private void writeAnnotationInfo(Doc doc, AnnotationDesc[] descList) { 1.1262 - writeAnnotationInfo(0, doc, descList, true); 1.1263 - } 1.1264 - 1.1265 - /** 1.1266 * Adds the annotatation types for the given doc. 1.1267 * 1.1268 * @param doc the doc to write annotations for. 1.1269 @@ -2634,26 +1786,6 @@ 1.1270 } 1.1271 1.1272 /** 1.1273 - * Write the annotatation types for the given doc. 1.1274 - * 1.1275 - * @param indent the number of extra spaces to indent the annotations. 1.1276 - * @param doc the doc to write annotations for. 1.1277 - * @param descList the array of {@link AnnotationDesc}. 1.1278 - */ 1.1279 - private boolean writeAnnotationInfo(int indent, Doc doc, AnnotationDesc[] descList, boolean lineBreak) { 1.1280 - List<String> annotations = getAnnotations(indent, descList, lineBreak); 1.1281 - if (annotations.size() == 0) { 1.1282 - return false; 1.1283 - } 1.1284 - fontNoNewLine("-1"); 1.1285 - for (Iterator<String> iter = annotations.iterator(); iter.hasNext();) { 1.1286 - print(iter.next()); 1.1287 - } 1.1288 - fontEnd(); 1.1289 - return true; 1.1290 - } 1.1291 - 1.1292 - /** 1.1293 * Adds the annotatation types for the given doc. 1.1294 * 1.1295 * @param indent the number of extra spaces to indent the annotations.