# HG changeset patch # User jjg # Date 1507340433 25200 # Node ID da60bce4fc9f05b2146a51fac2e988736f7d6cbd # Parent 8b09673f7edead956087d3bb7f80e86ea40b0264 8188578: move printFramesDocument from HtmlDocWriter to FrameOutputWriter Reviewed-by: ksrini diff -r 8b09673f7ede -r da60bce4fc9f src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java Fri Oct 06 20:54:37 2017 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java Fri Oct 06 18:40:33 2017 -0700 @@ -25,11 +25,15 @@ package jdk.javadoc.internal.doclets.formats.html; +import jdk.javadoc.internal.doclets.formats.html.markup.Comment; +import jdk.javadoc.internal.doclets.formats.html.markup.DocType; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr; +import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml; +import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; import jdk.javadoc.internal.doclets.toolkit.util.DocPath; @@ -110,15 +114,41 @@ body.addContent(frame); } if (configuration.windowtitle.length() > 0) { - printFramesDocument(configuration.windowtitle, configuration, - body); + printFramesDocument(configuration.windowtitle, body); } else { - printFramesDocument(configuration.getText("doclet.Generated_Docs_Untitled"), - configuration, body); + printFramesDocument(configuration.getText("doclet.Generated_Docs_Untitled"), body); } } /** + * Print the frames version of the Html file header. + * Called only when generating an HTML frames file. + * + * @param title Title of this HTML document + * @param body the body content tree to be added to the HTML document + * @throws DocFileIOException if there is an error writing the frames document + */ + private void printFramesDocument(String title, HtmlTree body) throws DocFileIOException { + Content htmlDocType = configuration.isOutputHtml5() + ? DocType.HTML5 + : DocType.TRANSITIONAL; + Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); + Content head = new HtmlTree(HtmlTag.HEAD); + head.addContent(getGeneratedBy(!configuration.notimestamp)); + Content windowTitle = HtmlTree.TITLE(new StringContent(title)); + head.addContent(windowTitle); + Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE, configuration.charset); + head.addContent(meta); + head.addContent(getStyleSheetProperties(configuration)); + head.addContent(getFramesJavaScript()); + Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), + head, body); + Content htmlDocument = new HtmlDocument(htmlDocType, + htmlComment, htmlTree); + write(htmlDocument); + } + + /** * Get the frame sizes and their contents. * * @return a content tree for the frame details diff -r 8b09673f7ede -r da60bce4fc9f src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java Fri Oct 06 20:54:37 2017 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java Fri Oct 06 18:40:33 2017 -0700 @@ -37,7 +37,6 @@ import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.Messages; import jdk.javadoc.internal.doclets.toolkit.util.DocFile; -import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; import jdk.javadoc.internal.doclets.toolkit.util.DocLink; import jdk.javadoc.internal.doclets.toolkit.util.DocPath; import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; @@ -310,36 +309,6 @@ } /** - * Print the frames version of the Html file header. - * Called only when generating an HTML frames file. - * - * @param title Title of this HTML document - * @param configuration the configuration object - * @param body the body content tree to be added to the HTML document - * @throws DocFileIOException if there is an error writing the frames document - */ - public void printFramesDocument(String title, HtmlConfiguration configuration, - HtmlTree body) throws DocFileIOException { - Content htmlDocType = configuration.isOutputHtml5() - ? DocType.HTML5 - : DocType.TRANSITIONAL; - Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); - Content head = new HtmlTree(HtmlTag.HEAD); - head.addContent(getGeneratedBy(!configuration.notimestamp)); - Content windowTitle = HtmlTree.TITLE(new StringContent(title)); - head.addContent(windowTitle); - Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE, configuration.charset); - head.addContent(meta); - head.addContent(getStyleSheetProperties(configuration)); - head.addContent(getFramesJavaScript()); - Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), - head, body); - Content htmlDocument = new HtmlDocument(htmlDocType, - htmlComment, htmlTree); - write(htmlDocument); - } - - /** * Returns a link to the stylesheet file. * * @param configuration the configuration for this doclet