< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java

Print this page




 175     /**
 176      * The HTML tree for main tag.
 177      */
 178     protected HtmlTree mainTree = HtmlTree.MAIN();
 179 
 180     /**
 181      * The HTML tree for section tag.
 182      */
 183     protected HtmlTree sectionTree = HtmlTree.SECTION();
 184 
 185     /**
 186      * Constructor to construct ModuleWriter object and to generate "moduleName-summary.html" file.
 187      *
 188      * @param configuration the configuration of the doclet.
 189      * @param mdle        Module under consideration.
 190      * @param prevModule   Previous module in the sorted array.
 191      * @param nextModule   Next module in the sorted array.
 192      */
 193     public ModuleWriterImpl(HtmlConfiguration configuration,
 194             ModuleElement mdle, ModuleElement prevModule, ModuleElement nextModule) {
 195         super(configuration, DocPaths.moduleSummary(mdle));
 196         this.prevModule = prevModule;
 197         this.nextModule = nextModule;
 198         this.mdle = mdle;
 199         this.moduleMode = configuration.docEnv.getModuleMode();
 200         computeModulesData();
 201     }
 202 
 203     /**
 204      * Get the module header.
 205      *
 206      * @param heading the heading for the section
 207      */
 208     @Override
 209     public Content getModuleHeader(String heading) {
 210         HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString()));
 211         HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
 212                 ? HtmlTree.HEADER()
 213                 : bodyTree;
 214         addTop(htmlTree);
 215         addNavLinks(true, htmlTree);


1039      *
1040      * @return a content tree for the module link
1041      */
1042     @Override
1043     protected Content getNavLinkModule() {
1044         Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.moduleLabel);
1045         return li;
1046     }
1047 
1048     /**
1049      * Get "PREV MODULE" link in the navigation bar.
1050      *
1051      * @return a content tree for the previous link
1052      */
1053     @Override
1054     public Content getNavLinkPrevious() {
1055         Content li;
1056         if (prevModule == null) {
1057             li = HtmlTree.LI(contents.prevModuleLabel);
1058         } else {
1059             li = HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
1060                     prevModule)), contents.prevModuleLabel, "", ""));
1061         }
1062         return li;
1063     }
1064 
1065     /**
1066      * Get "NEXT MODULE" link in the navigation bar.
1067      *
1068      * @return a content tree for the next link
1069      */
1070     @Override
1071     public Content getNavLinkNext() {
1072         Content li;
1073         if (nextModule == null) {
1074             li = HtmlTree.LI(contents.nextModuleLabel);
1075         } else {
1076             li = HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
1077                     nextModule)), contents.nextModuleLabel, "", ""));
1078         }
1079         return li;
1080     }
1081 }


 175     /**
 176      * The HTML tree for main tag.
 177      */
 178     protected HtmlTree mainTree = HtmlTree.MAIN();
 179 
 180     /**
 181      * The HTML tree for section tag.
 182      */
 183     protected HtmlTree sectionTree = HtmlTree.SECTION();
 184 
 185     /**
 186      * Constructor to construct ModuleWriter object and to generate "moduleName-summary.html" file.
 187      *
 188      * @param configuration the configuration of the doclet.
 189      * @param mdle        Module under consideration.
 190      * @param prevModule   Previous module in the sorted array.
 191      * @param nextModule   Next module in the sorted array.
 192      */
 193     public ModuleWriterImpl(HtmlConfiguration configuration,
 194             ModuleElement mdle, ModuleElement prevModule, ModuleElement nextModule) {
 195         super(configuration, configuration.docPaths.moduleSummary(mdle));
 196         this.prevModule = prevModule;
 197         this.nextModule = nextModule;
 198         this.mdle = mdle;
 199         this.moduleMode = configuration.docEnv.getModuleMode();
 200         computeModulesData();
 201     }
 202 
 203     /**
 204      * Get the module header.
 205      *
 206      * @param heading the heading for the section
 207      */
 208     @Override
 209     public Content getModuleHeader(String heading) {
 210         HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString()));
 211         HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
 212                 ? HtmlTree.HEADER()
 213                 : bodyTree;
 214         addTop(htmlTree);
 215         addNavLinks(true, htmlTree);


1039      *
1040      * @return a content tree for the module link
1041      */
1042     @Override
1043     protected Content getNavLinkModule() {
1044         Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.moduleLabel);
1045         return li;
1046     }
1047 
1048     /**
1049      * Get "PREV MODULE" link in the navigation bar.
1050      *
1051      * @return a content tree for the previous link
1052      */
1053     @Override
1054     public Content getNavLinkPrevious() {
1055         Content li;
1056         if (prevModule == null) {
1057             li = HtmlTree.LI(contents.prevModuleLabel);
1058         } else {
1059             li = HtmlTree.LI(links.createLink(pathToRoot.resolve(docPaths.moduleSummary(
1060                     prevModule)), contents.prevModuleLabel, "", ""));
1061         }
1062         return li;
1063     }
1064 
1065     /**
1066      * Get "NEXT MODULE" link in the navigation bar.
1067      *
1068      * @return a content tree for the next link
1069      */
1070     @Override
1071     public Content getNavLinkNext() {
1072         Content li;
1073         if (nextModule == null) {
1074             li = HtmlTree.LI(contents.nextModuleLabel);
1075         } else {
1076             li = HtmlTree.LI(links.createLink(pathToRoot.resolve(docPaths.moduleSummary(
1077                     nextModule)), contents.nextModuleLabel, "", ""));
1078         }
1079         return li;
1080     }
1081 }
< prev index next >