80 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
80 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
81 import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter; |
81 import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter; |
82 import jdk.javadoc.internal.doclets.toolkit.ClassWriter; |
82 import jdk.javadoc.internal.doclets.toolkit.ClassWriter; |
83 import jdk.javadoc.internal.doclets.toolkit.Configuration; |
83 import jdk.javadoc.internal.doclets.toolkit.Configuration; |
84 import jdk.javadoc.internal.doclets.toolkit.Content; |
84 import jdk.javadoc.internal.doclets.toolkit.Content; |
|
85 import jdk.javadoc.internal.doclets.toolkit.Messages; |
85 import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter; |
86 import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter; |
|
87 import jdk.javadoc.internal.doclets.toolkit.Resources; |
86 import jdk.javadoc.internal.doclets.toolkit.taglets.DocRootTaglet; |
88 import jdk.javadoc.internal.doclets.toolkit.taglets.DocRootTaglet; |
87 import jdk.javadoc.internal.doclets.toolkit.taglets.TagletWriter; |
89 import jdk.javadoc.internal.doclets.toolkit.taglets.TagletWriter; |
88 import jdk.javadoc.internal.doclets.toolkit.util.DocFile; |
90 import jdk.javadoc.internal.doclets.toolkit.util.DocFile; |
89 import jdk.javadoc.internal.doclets.toolkit.util.DocLink; |
91 import jdk.javadoc.internal.doclets.toolkit.util.DocLink; |
90 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
92 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
143 */ |
145 */ |
144 public final ConfigurationImpl configuration; |
146 public final ConfigurationImpl configuration; |
145 |
147 |
146 protected final Utils utils; |
148 protected final Utils utils; |
147 |
149 |
|
150 protected final Contents contents; |
|
151 |
|
152 protected final Messages messages; |
|
153 |
|
154 protected final Resources resources; |
|
155 |
148 /** |
156 /** |
149 * To check whether annotation heading is printed or not. |
157 * To check whether annotation heading is printed or not. |
150 */ |
158 */ |
151 protected boolean printedAnnotationHeading = false; |
159 protected boolean printedAnnotationHeading = false; |
152 |
160 |
172 /** |
180 /** |
173 * Constructor to construct the HtmlStandardWriter object. |
181 * Constructor to construct the HtmlStandardWriter object. |
174 * |
182 * |
175 * @param path File to be generated. |
183 * @param path File to be generated. |
176 */ |
184 */ |
177 public HtmlDocletWriter(ConfigurationImpl configuration, DocPath path) |
185 public HtmlDocletWriter(ConfigurationImpl configuration, DocPath path) { |
178 throws IOException { |
|
179 super(configuration, path); |
186 super(configuration, path); |
180 this.configuration = configuration; |
187 this.configuration = configuration; |
|
188 this.contents = configuration.contents; |
|
189 this.messages = configuration.messages; |
|
190 this.resources = configuration.resources; |
181 this.utils = configuration.utils; |
191 this.utils = configuration.utils; |
182 this.path = path; |
192 this.path = path; |
183 this.pathToRoot = path.parent().invert(); |
193 this.pathToRoot = path.parent().invert(); |
184 this.filename = path.basename(); |
194 this.filename = path.basename(); |
185 } |
195 } |
247 * @param id id of the element to show or hide |
257 * @param id id of the element to show or hide |
248 * @return a content tree for the script |
258 * @return a content tree for the script |
249 */ |
259 */ |
250 public Content getAllClassesLinkScript(String id) { |
260 public Content getAllClassesLinkScript(String id) { |
251 HtmlTree script = HtmlTree.SCRIPT(); |
261 HtmlTree script = HtmlTree.SCRIPT(); |
252 String scriptCode = "<!--" + DocletConstants.NL + |
262 String scriptCode = "<!--\n" + |
253 " allClassesLink = document.getElementById(\"" + id + "\");" + DocletConstants.NL + |
263 " allClassesLink = document.getElementById(\"" + id + "\");\n" + |
254 " if(window==top) {" + DocletConstants.NL + |
264 " if(window==top) {\n" + |
255 " allClassesLink.style.display = \"block\";" + DocletConstants.NL + |
265 " allClassesLink.style.display = \"block\";\n" + |
256 " }" + DocletConstants.NL + |
266 " }\n" + |
257 " else {" + DocletConstants.NL + |
267 " else {\n" + |
258 " allClassesLink.style.display = \"none\";" + DocletConstants.NL + |
268 " allClassesLink.style.display = \"none\";\n" + |
259 " }" + DocletConstants.NL + |
269 " }\n" + |
260 " //-->" + DocletConstants.NL; |
270 " //-->\n"; |
261 Content scriptContent = new RawHtml(scriptCode); |
271 Content scriptContent = new RawHtml(scriptCode.replace("\n", DocletConstants.NL)); |
262 script.addContent(scriptContent); |
272 script.addContent(scriptContent); |
263 Content div = HtmlTree.DIV(script); |
273 Content div = HtmlTree.DIV(script); |
264 Content div_noscript = HtmlTree.DIV(getResource("doclet.No_Script_Message")); |
274 Content div_noscript = HtmlTree.DIV(contents.noScriptMessage); |
265 Content noScript = HtmlTree.NOSCRIPT(div_noscript); |
275 Content noScript = HtmlTree.NOSCRIPT(div_noscript); |
266 div.addContent(noScript); |
276 div.addContent(noScript); |
267 return div; |
277 return div; |
268 } |
278 } |
269 |
279 |
402 tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
412 tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
403 altColor = !altColor; |
413 altColor = !altColor; |
404 HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD); |
414 HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD); |
405 tdClassDescription.addStyle(HtmlStyle.colLast); |
415 tdClassDescription.addStyle(HtmlStyle.colLast); |
406 if (utils.isDeprecated(te)) { |
416 if (utils.isDeprecated(te)) { |
407 tdClassDescription.addContent(deprecatedLabel); |
417 tdClassDescription.addContent(contents.deprecatedLabel); |
408 List<? extends DocTree> tags = utils.getDeprecatedTrees(te); |
418 List<? extends DocTree> tags = utils.getDeprecatedTrees(te); |
409 if (!tags.isEmpty()) { |
419 if (!tags.isEmpty()) { |
410 addSummaryDeprecatedComment(te, tags.get(0), tdClassDescription); |
420 addSummaryDeprecatedComment(te, tags.get(0), tdClassDescription); |
411 } |
421 } |
412 } else { |
422 } else { |
533 ? HtmlTree.NAV() |
543 ? HtmlTree.NAV() |
534 : htmlTree; |
544 : htmlTree; |
535 String allClassesId = "allclasses_"; |
545 String allClassesId = "allclasses_"; |
536 HtmlTree navDiv = new HtmlTree(HtmlTag.DIV); |
546 HtmlTree navDiv = new HtmlTree(HtmlTag.DIV); |
537 fixedNavDiv.addStyle(HtmlStyle.fixedNav); |
547 fixedNavDiv.addStyle(HtmlStyle.fixedNav); |
538 Content skipNavLinks = configuration.getResource("doclet.Skip_navigation_links"); |
548 Content skipNavLinks = configuration.getContent("doclet.Skip_navigation_links"); |
539 if (header) { |
549 if (header) { |
540 fixedNavDiv.addContent(HtmlConstants.START_OF_TOP_NAVBAR); |
550 fixedNavDiv.addContent(HtmlConstants.START_OF_TOP_NAVBAR); |
541 navDiv.addStyle(HtmlStyle.topNav); |
551 navDiv.addStyle(HtmlStyle.topNav); |
542 allClassesId += "navbar_top"; |
552 allClassesId += "navbar_top"; |
543 Content a = getMarkerAnchor(SectionName.NAVBAR_TOP); |
553 Content a = getMarkerAnchor(SectionName.NAVBAR_TOP); |
615 ulAllClasses.addAttr(HtmlAttr.ID, allClassesId); |
625 ulAllClasses.addAttr(HtmlAttr.ID, allClassesId); |
616 subDiv.addContent(ulAllClasses); |
626 subDiv.addContent(ulAllClasses); |
617 if (header && configuration.createindex) { |
627 if (header && configuration.createindex) { |
618 HtmlTree inputText = HtmlTree.INPUT("text", "search"); |
628 HtmlTree inputText = HtmlTree.INPUT("text", "search"); |
619 HtmlTree inputReset = HtmlTree.INPUT("reset", "reset"); |
629 HtmlTree inputReset = HtmlTree.INPUT("reset", "reset"); |
620 Content searchTxt = configuration.getResource("doclet.search"); |
630 Content searchTxt = new ContentBuilder(); |
621 searchTxt.addContent(getSpace()); |
631 searchTxt.addContent(configuration.getContent("doclet.search")); |
|
632 searchTxt.addContent(Contents.SPACE); |
622 HtmlTree liInput = HtmlTree.LI(HtmlTree.SPAN(searchTxt)); |
633 HtmlTree liInput = HtmlTree.LI(HtmlTree.SPAN(searchTxt)); |
623 liInput.addContent(inputText); |
634 liInput.addContent(inputText); |
624 liInput.addContent(inputReset); |
635 liInput.addContent(inputReset); |
625 HtmlTree ulSearch = HtmlTree.UL(HtmlStyle.navListSearch, liInput); |
636 HtmlTree ulSearch = HtmlTree.UL(HtmlStyle.navListSearch, liInput); |
626 subDiv.addContent(ulSearch); |
637 subDiv.addContent(ulSearch); |
630 if (header) { |
641 if (header) { |
631 subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_TOP)); |
642 subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_TOP)); |
632 fixedNavDiv.addContent(subDiv); |
643 fixedNavDiv.addContent(subDiv); |
633 fixedNavDiv.addContent(HtmlConstants.END_OF_TOP_NAVBAR); |
644 fixedNavDiv.addContent(HtmlConstants.END_OF_TOP_NAVBAR); |
634 tree.addContent(fixedNavDiv); |
645 tree.addContent(fixedNavDiv); |
635 HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, getSpace()); |
646 HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Contents.SPACE); |
636 tree.addContent(paddingDiv); |
647 tree.addContent(paddingDiv); |
637 } else { |
648 } else { |
638 subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_BOTTOM)); |
649 subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_BOTTOM)); |
639 tree.addContent(subDiv); |
650 tree.addContent(subDiv); |
640 tree.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR); |
651 tree.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR); |
676 * |
687 * |
677 * @return a content tree for the link |
688 * @return a content tree for the link |
678 */ |
689 */ |
679 protected Content getNavLinkContents() { |
690 protected Content getNavLinkContents() { |
680 Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_SUMMARY), |
691 Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_SUMMARY), |
681 overviewLabel, "", ""); |
692 contents.overviewLabel, "", ""); |
682 Content li = HtmlTree.LI(linkContent); |
693 Content li = HtmlTree.LI(linkContent); |
683 return li; |
694 return li; |
684 } |
695 } |
685 |
696 |
686 /** |
697 /** |
688 * |
699 * |
689 * @param mdle Module to which link will be generated |
700 * @param mdle Module to which link will be generated |
690 * @return a content tree for the link |
701 * @return a content tree for the link |
691 */ |
702 */ |
692 protected Content getNavLinkModule(ModuleElement mdle) { |
703 protected Content getNavLinkModule(ModuleElement mdle) { |
693 Content linkContent = getModuleLink(mdle, moduleLabel); |
704 Content linkContent = getModuleLink(mdle, contents.moduleLabel); |
694 Content li = HtmlTree.LI(linkContent); |
705 Content li = HtmlTree.LI(linkContent); |
695 return li; |
706 return li; |
696 } |
707 } |
697 |
708 |
698 /** |
709 /** |
699 * Get the word "Module", to indicate that link is not available here. |
710 * Get the word "Module", to indicate that link is not available here. |
700 * |
711 * |
701 * @return a content tree for the link |
712 * @return a content tree for the link |
702 */ |
713 */ |
703 protected Content getNavLinkModule() { |
714 protected Content getNavLinkModule() { |
704 Content li = HtmlTree.LI(moduleLabel); |
715 Content li = HtmlTree.LI(contents.moduleLabel); |
705 return li; |
716 return li; |
706 } |
717 } |
707 |
718 |
708 /** |
719 /** |
709 * Get link to the "package-summary.html" page for the package passed. |
720 * Get link to the "package-summary.html" page for the package passed. |
710 * |
721 * |
711 * @param pkg Package to which link will be generated |
722 * @param pkg Package to which link will be generated |
712 * @return a content tree for the link |
723 * @return a content tree for the link |
713 */ |
724 */ |
714 protected Content getNavLinkPackage(PackageElement pkg) { |
725 protected Content getNavLinkPackage(PackageElement pkg) { |
715 Content linkContent = getPackageLink(pkg, packageLabel); |
726 Content linkContent = getPackageLink(pkg, contents.packageLabel); |
716 Content li = HtmlTree.LI(linkContent); |
727 Content li = HtmlTree.LI(linkContent); |
717 return li; |
728 return li; |
718 } |
729 } |
719 |
730 |
720 /** |
731 /** |
721 * Get the word "Package" , to indicate that link is not available here. |
732 * Get the word "Package" , to indicate that link is not available here. |
722 * |
733 * |
723 * @return a content tree for the link |
734 * @return a content tree for the link |
724 */ |
735 */ |
725 protected Content getNavLinkPackage() { |
736 protected Content getNavLinkPackage() { |
726 Content li = HtmlTree.LI(packageLabel); |
737 Content li = HtmlTree.LI(contents.packageLabel); |
727 return li; |
738 return li; |
728 } |
739 } |
729 |
740 |
730 /** |
741 /** |
731 * Get the word "Use", to indicate that link is not available. |
742 * Get the word "Use", to indicate that link is not available. |
732 * |
743 * |
733 * @return a content tree for the link |
744 * @return a content tree for the link |
734 */ |
745 */ |
735 protected Content getNavLinkClassUse() { |
746 protected Content getNavLinkClassUse() { |
736 Content li = HtmlTree.LI(useLabel); |
747 Content li = HtmlTree.LI(contents.useLabel); |
737 return li; |
748 return li; |
738 } |
749 } |
739 |
750 |
740 /** |
751 /** |
741 * Get link for previous file. |
752 * Get link for previous file. |
744 * @return a content tree for the link |
755 * @return a content tree for the link |
745 */ |
756 */ |
746 public Content getNavLinkPrevious(DocPath prev) { |
757 public Content getNavLinkPrevious(DocPath prev) { |
747 Content li; |
758 Content li; |
748 if (prev != null) { |
759 if (prev != null) { |
749 li = HtmlTree.LI(getHyperLink(prev, prevLabel, "", "")); |
760 li = HtmlTree.LI(getHyperLink(prev, contents.prevLabel, "", "")); |
750 } |
761 } |
751 else |
762 else |
752 li = HtmlTree.LI(prevLabel); |
763 li = HtmlTree.LI(contents.prevLabel); |
753 return li; |
764 return li; |
754 } |
765 } |
755 |
766 |
756 /** |
767 /** |
757 * Get link for next file. If next is null, just print the label |
768 * Get link for next file. If next is null, just print the label |
761 * @return a content tree for the link |
772 * @return a content tree for the link |
762 */ |
773 */ |
763 public Content getNavLinkNext(DocPath next) { |
774 public Content getNavLinkNext(DocPath next) { |
764 Content li; |
775 Content li; |
765 if (next != null) { |
776 if (next != null) { |
766 li = HtmlTree.LI(getHyperLink(next, nextLabel, "", "")); |
777 li = HtmlTree.LI(getHyperLink(next, contents.nextLabel, "", "")); |
767 } |
778 } |
768 else |
779 else |
769 li = HtmlTree.LI(nextLabel); |
780 li = HtmlTree.LI(contents.nextLabel); |
770 return li; |
781 return li; |
771 } |
782 } |
772 |
783 |
773 /** |
784 /** |
774 * Get "FRAMES" link, to switch to the frame version of the output. |
785 * Get "FRAMES" link, to switch to the frame version of the output. |
776 * @param link File to be linked, "index.html" |
787 * @param link File to be linked, "index.html" |
777 * @return a content tree for the link |
788 * @return a content tree for the link |
778 */ |
789 */ |
779 protected Content getNavShowLists(DocPath link) { |
790 protected Content getNavShowLists(DocPath link) { |
780 DocLink dl = new DocLink(link, path.getPath(), null); |
791 DocLink dl = new DocLink(link, path.getPath(), null); |
781 Content framesContent = getHyperLink(dl, framesLabel, "", "_top"); |
792 Content framesContent = getHyperLink(dl, contents.framesLabel, "", "_top"); |
782 Content li = HtmlTree.LI(framesContent); |
793 Content li = HtmlTree.LI(framesContent); |
783 return li; |
794 return li; |
784 } |
795 } |
785 |
796 |
786 /** |
797 /** |
797 * |
808 * |
798 * @param link File to be linked |
809 * @param link File to be linked |
799 * @return a content tree for the link |
810 * @return a content tree for the link |
800 */ |
811 */ |
801 protected Content getNavHideLists(DocPath link) { |
812 protected Content getNavHideLists(DocPath link) { |
802 Content noFramesContent = getHyperLink(link, noframesLabel, "", "_top"); |
813 Content noFramesContent = getHyperLink(link, contents.noFramesLabel, "", "_top"); |
803 Content li = HtmlTree.LI(noFramesContent); |
814 Content li = HtmlTree.LI(noFramesContent); |
804 return li; |
815 return li; |
805 } |
816 } |
806 |
817 |
807 /** |
818 /** |
815 protected Content getNavLinkTree() { |
826 protected Content getNavLinkTree() { |
816 List<PackageElement> packages = new ArrayList<>(utils.getSpecifiedPackages()); |
827 List<PackageElement> packages = new ArrayList<>(utils.getSpecifiedPackages()); |
817 DocPath docPath = packages.size() == 1 && utils.getSpecifiedClasses().isEmpty() |
828 DocPath docPath = packages.size() == 1 && utils.getSpecifiedClasses().isEmpty() |
818 ? pathString(packages.get(0), DocPaths.PACKAGE_TREE) |
829 ? pathString(packages.get(0), DocPaths.PACKAGE_TREE) |
819 : pathToRoot.resolve(DocPaths.OVERVIEW_TREE); |
830 : pathToRoot.resolve(DocPaths.OVERVIEW_TREE); |
820 return HtmlTree.LI(getHyperLink(docPath, treeLabel, "", "")); |
831 return HtmlTree.LI(getHyperLink(docPath, contents.treeLabel, "", "")); |
821 } |
832 } |
822 |
833 |
823 /** |
834 /** |
824 * Get the overview tree link for the main tree. |
835 * Get the overview tree link for the main tree. |
825 * |
836 * |
837 * Get the word "Class", to indicate that class link is not available. |
848 * Get the word "Class", to indicate that class link is not available. |
838 * |
849 * |
839 * @return a content tree for the link |
850 * @return a content tree for the link |
840 */ |
851 */ |
841 protected Content getNavLinkClass() { |
852 protected Content getNavLinkClass() { |
842 Content li = HtmlTree.LI(classLabel); |
853 Content li = HtmlTree.LI(contents.classLabel); |
843 return li; |
854 return li; |
844 } |
855 } |
845 |
856 |
846 /** |
857 /** |
847 * Get "Deprecated" API link in the navigation bar. |
858 * Get "Deprecated" API link in the navigation bar. |
848 * |
859 * |
849 * @return a content tree for the link |
860 * @return a content tree for the link |
850 */ |
861 */ |
851 protected Content getNavLinkDeprecated() { |
862 protected Content getNavLinkDeprecated() { |
852 Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST), |
863 Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST), |
853 deprecatedLabel, "", ""); |
864 contents.deprecatedLabel, "", ""); |
854 Content li = HtmlTree.LI(linkContent); |
865 Content li = HtmlTree.LI(linkContent); |
855 return li; |
866 return li; |
856 } |
867 } |
857 |
868 |
858 /** |
869 /** |
863 * @return a content tree for the link |
874 * @return a content tree for the link |
864 */ |
875 */ |
865 protected Content getNavLinkClassIndex() { |
876 protected Content getNavLinkClassIndex() { |
866 Content allClassesContent = getHyperLink(pathToRoot.resolve( |
877 Content allClassesContent = getHyperLink(pathToRoot.resolve( |
867 DocPaths.ALLCLASSES_NOFRAME), |
878 DocPaths.ALLCLASSES_NOFRAME), |
868 allclassesLabel, "", ""); |
879 contents.allClassesLabel, "", ""); |
869 Content li = HtmlTree.LI(allClassesContent); |
880 Content li = HtmlTree.LI(allClassesContent); |
870 return li; |
881 return li; |
871 } |
882 } |
872 |
883 |
873 /** |
884 /** |
878 protected Content getNavLinkIndex() { |
889 protected Content getNavLinkIndex() { |
879 Content linkContent = getHyperLink(pathToRoot.resolve( |
890 Content linkContent = getHyperLink(pathToRoot.resolve( |
880 (configuration.splitindex |
891 (configuration.splitindex |
881 ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)) |
892 ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)) |
882 : DocPaths.INDEX_ALL)), |
893 : DocPaths.INDEX_ALL)), |
883 indexLabel, "", ""); |
894 contents.indexLabel, "", ""); |
884 Content li = HtmlTree.LI(linkContent); |
895 Content li = HtmlTree.LI(linkContent); |
885 return li; |
896 return li; |
886 } |
897 } |
887 |
898 |
888 /** |
899 /** |
900 } else { |
911 } else { |
901 DocFile file = DocFile.createFileForInput(configuration, helpfile); |
912 DocFile file = DocFile.createFileForInput(configuration, helpfile); |
902 helpfilenm = DocPath.create(file.getName()); |
913 helpfilenm = DocPath.create(file.getName()); |
903 } |
914 } |
904 Content linkContent = getHyperLink(pathToRoot.resolve(helpfilenm), |
915 Content linkContent = getHyperLink(pathToRoot.resolve(helpfilenm), |
905 helpLabel, "", ""); |
916 contents.helpLabel, "", ""); |
906 Content li = HtmlTree.LI(linkContent); |
917 Content li = HtmlTree.LI(linkContent); |
907 return li; |
918 return li; |
908 } |
919 } |
909 |
920 |
910 /** |
921 /** |
911 * Add gap between navigation bar elements. |
922 * Add gap between navigation bar elements. |
912 * |
923 * |
913 * @param liNav the content tree to which the gap will be added |
924 * @param liNav the content tree to which the gap will be added |
914 */ |
925 */ |
915 protected void addNavGap(Content liNav) { |
926 protected void addNavGap(Content liNav) { |
916 liNav.addContent(getSpace()); |
927 liNav.addContent(Contents.SPACE); |
917 liNav.addContent("|"); |
928 liNav.addContent("|"); |
918 liNav.addContent(getSpace()); |
929 liNav.addContent(Contents.SPACE); |
919 } |
930 } |
920 |
931 |
921 /** |
932 /** |
922 * Get summary table header. |
933 * Get summary table header. |
923 * |
934 * |
952 * @param rawText the caption for the table which could be raw Html |
963 * @param rawText the caption for the table which could be raw Html |
953 * @return a content tree for the caption |
964 * @return a content tree for the caption |
954 */ |
965 */ |
955 public Content getTableCaption(Content title) { |
966 public Content getTableCaption(Content title) { |
956 Content captionSpan = HtmlTree.SPAN(title); |
967 Content captionSpan = HtmlTree.SPAN(title); |
957 Content space = getSpace(); |
968 Content space = Contents.SPACE; |
958 Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space); |
969 Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space); |
959 Content caption = HtmlTree.CAPTION(captionSpan); |
970 Content caption = HtmlTree.CAPTION(captionSpan); |
960 caption.addContent(tabSpan); |
971 caption.addContent(tabSpan); |
961 return caption; |
972 return caption; |
962 } |
973 } |
1012 * @param packageElement the package to check |
1023 * @param packageElement the package to check |
1013 * @return package name content |
1024 * @return package name content |
1014 */ |
1025 */ |
1015 public Content getPackageName(PackageElement packageElement) { |
1026 public Content getPackageName(PackageElement packageElement) { |
1016 return packageElement == null || packageElement.isUnnamed() |
1027 return packageElement == null || packageElement.isUnnamed() |
1017 ? defaultPackageLabel |
1028 ? contents.defaultPackageLabel |
1018 : getPackageLabel(packageElement.getQualifiedName()); |
1029 : getPackageLabel(packageElement.getQualifiedName()); |
1019 } |
1030 } |
1020 |
1031 |
1021 /** |
1032 /** |
1022 * Returns a package name label. |
1033 * Returns a package name label. |
1038 * @param contentTree the content tree to which the deprecated package table will be added |
1049 * @param contentTree the content tree to which the deprecated package table will be added |
1039 */ |
1050 */ |
1040 protected void addPackageDeprecatedAPI(SortedSet<Element> deprPkgs, String headingKey, |
1051 protected void addPackageDeprecatedAPI(SortedSet<Element> deprPkgs, String headingKey, |
1041 String tableSummary, List<String> tableHeader, Content contentTree) { |
1052 String tableSummary, List<String> tableHeader, Content contentTree) { |
1042 if (deprPkgs.size() > 0) { |
1053 if (deprPkgs.size() > 0) { |
1043 Content caption = getTableCaption(configuration.getResource(headingKey)); |
1054 Content caption = getTableCaption(configuration.getContent(headingKey)); |
1044 Content table = (configuration.isOutputHtml5()) |
1055 Content table = (configuration.isOutputHtml5()) |
1045 ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption) |
1056 ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption) |
1046 : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption); |
1057 : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption); |
1047 table.addContent(getSummaryTableHeader(tableHeader, "col")); |
1058 table.addContent(getSummaryTableHeader(tableHeader, "col")); |
1048 Content tbody = new HtmlTree(HtmlTag.TBODY); |
1059 Content tbody = new HtmlTree(HtmlTag.TBODY); |
1549 refMemName, label, false, "", !isLinkPlain)) != null) { |
1560 refMemName, label, false, "", !isLinkPlain)) != null) { |
1550 // Class cross link found (possibly to a member in the class) |
1561 // Class cross link found (possibly to a member in the class) |
1551 return classCrossLink; |
1562 return classCrossLink; |
1552 } else { |
1563 } else { |
1553 // No cross link found so print warning |
1564 // No cross link found so print warning |
1554 configuration.getDocletSpecificMsg().warning(ch.getDocTreePath(see), |
1565 messages.warning(ch.getDocTreePath(see), |
1555 "doclet.see.class_or_package_not_found", |
1566 "doclet.see.class_or_package_not_found", |
1556 "@" + tagName, |
1567 "@" + tagName, |
1557 seetext); |
1568 seetext); |
1558 return (label.isEmpty() ? text: label); |
1569 return (label.isEmpty() ? text: label); |
1559 } |
1570 } |
1592 // The current class either overrides the referenced member or |
1603 // The current class either overrides the referenced member or |
1593 // inherits it automatically. |
1604 // inherits it automatically. |
1594 if (this instanceof ClassWriterImpl) { |
1605 if (this instanceof ClassWriterImpl) { |
1595 containing = ((ClassWriterImpl) this).getTypeElement(); |
1606 containing = ((ClassWriterImpl) this).getTypeElement(); |
1596 } else if (!utils.isPublic(containing)) { |
1607 } else if (!utils.isPublic(containing)) { |
1597 configuration.getDocletSpecificMsg().warning( |
1608 messages.warning( |
1598 ch.getDocTreePath(see), "doclet.see.class_or_package_not_accessible", |
1609 ch.getDocTreePath(see), "doclet.see.class_or_package_not_accessible", |
1599 tagName, utils.getFullyQualifiedName(containing)); |
1610 tagName, utils.getFullyQualifiedName(containing)); |
1600 } else { |
1611 } else { |
1601 configuration.getDocletSpecificMsg().warning( |
1612 messages.warning( |
1602 ch.getDocTreePath(see), "doclet.see.class_or_package_not_found", |
1613 ch.getDocTreePath(see), "doclet.see.class_or_package_not_found", |
1603 tagName, seetext); |
1614 tagName, seetext); |
1604 } |
1615 } |
1605 } |
1616 } |
1606 if (configuration.currentTypeElement != containing) { |
1617 if (configuration.currentTypeElement != containing) { |
1915 return false; |
1926 return false; |
1916 } |
1927 } |
1917 |
1928 |
1918 @Override @DefinedBy(Api.COMPILER_TREE) |
1929 @Override @DefinedBy(Api.COMPILER_TREE) |
1919 public Boolean visitErroneous(ErroneousTree node, Content c) { |
1930 public Boolean visitErroneous(ErroneousTree node, Content c) { |
1920 configuration.getDocletSpecificMsg().warning(ch.getDocTreePath(node), |
1931 messages.warning(ch.getDocTreePath(node), |
1921 "doclet.tag.invalid_usage", node); |
1932 "doclet.tag.invalid_usage", node); |
1922 result.addContent(new RawHtml(node.toString())); |
1933 result.addContent(new RawHtml(node.toString())); |
1923 return false; |
1934 return false; |
1924 } |
1935 } |
1925 |
1936 |