langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java
changeset 40587 1c355ea550ed
parent 40303 96a1226aca18
child 45157 f5f796453339
equal deleted inserted replaced
40519:e17429a7e843 40587:1c355ea550ed
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package jdk.javadoc.internal.doclets.formats.html;
    26 package jdk.javadoc.internal.doclets.formats.html;
    27 
    27 
    28 import java.io.*;
       
    29 import java.util.Map;
    28 import java.util.Map;
    30 import java.util.Set;
    29 import java.util.Set;
    31 
    30 
    32 import javax.lang.model.element.ModuleElement;
    31 import javax.lang.model.element.ModuleElement;
    33 import javax.lang.model.element.PackageElement;
    32 import javax.lang.model.element.PackageElement;
    37 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
    36 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
    38 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
    37 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
    39 import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
    38 import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
    40 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
    39 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
    41 import jdk.javadoc.internal.doclets.toolkit.Content;
    40 import jdk.javadoc.internal.doclets.toolkit.Content;
    42 import jdk.javadoc.internal.doclets.toolkit.Messages;
    41 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
    43 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
    42 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
    44 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
    43 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
    45 import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException;
       
    46 
    44 
    47 /**
    45 /**
    48  * Generate the module index for the left-hand frame in the generated output.
    46  * Generate the module index for the left-hand frame in the generated output.
    49  * A click on the module name in this frame will update the page in the top
    47  * A click on the module name in this frame will update the page in the top
    50  * left hand frame with the listing of packages of the clicked module.
    48  * left hand frame with the listing of packages of the clicked module.
    63      *
    61      *
    64      * @param configuration the configuration object
    62      * @param configuration the configuration object
    65      * @param filename Name of the module index file to be generated.
    63      * @param filename Name of the module index file to be generated.
    66      */
    64      */
    67     public ModuleIndexFrameWriter(ConfigurationImpl configuration,
    65     public ModuleIndexFrameWriter(ConfigurationImpl configuration,
    68                                    DocPath filename) throws IOException {
    66                                    DocPath filename) {
    69         super(configuration, filename);
    67         super(configuration, filename);
    70     }
    68     }
    71 
    69 
    72     /**
    70     /**
    73      * Generate the module index file named "module-overview-frame.html".
    71      * Generate the module index file named "module-overview-frame.html".
    74      * @throws DocletAbortException
    72      * @throws DocFileIOException
    75      * @param configuration the configuration object
    73      * @param configuration the configuration object
    76      */
    74      */
    77     public static void generate(ConfigurationImpl configuration) {
    75     public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
    78         ModuleIndexFrameWriter modulegen;
       
    79         DocPath filename = DocPaths.MODULE_OVERVIEW_FRAME;
    76         DocPath filename = DocPaths.MODULE_OVERVIEW_FRAME;
    80         try {
    77         ModuleIndexFrameWriter modulegen = new ModuleIndexFrameWriter(configuration, filename);
    81             modulegen = new ModuleIndexFrameWriter(configuration, filename);
    78         modulegen.buildModuleIndexFile("doclet.Window_Overview", false);
    82             modulegen.buildModuleIndexFile("doclet.Window_Overview", false);
       
    83         } catch (IOException exc) {
       
    84             Messages messages = configuration.getMessages();
       
    85             messages.error("doclet.exception_encountered",
       
    86                         exc.toString(), filename);
       
    87             throw new DocletAbortException(exc);
       
    88         }
       
    89     }
    79     }
    90 
    80 
    91     /**
    81     /**
    92      * {@inheritDoc}
    82      * {@inheritDoc}
    93      */
    83      */