src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
changeset 53562 0d9dee001667
parent 52644 43efb4ca6d6c
child 53866 880baf6db17b
equal deleted inserted replaced
53561:3f4b89a17892 53562:0d9dee001667
   201      * Defaults to false; can be set to true by --frames; can be set to false by --no-frames; last one wins.
   201      * Defaults to false; can be set to true by --frames; can be set to false by --no-frames; last one wins.
   202      */
   202      */
   203     public boolean frames = false;
   203     public boolean frames = false;
   204 
   204 
   205     /**
   205     /**
   206      * This is the HTML version of the generated pages.
       
   207      * The default value is determined later.
       
   208      */
       
   209     public HtmlVersion htmlVersion = null;
       
   210 
       
   211     /**
       
   212      * Collected set of doclint options
   206      * Collected set of doclint options
   213      */
   207      */
   214     public Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>();
   208     public Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>();
   215 
   209 
   216     public final Resources resources;
   210     public final Resources resources;
   299 
   293 
   300     protected boolean validateOptions() {
   294     protected boolean validateOptions() {
   301         // check shared options
   295         // check shared options
   302         if (!generalValidOptions()) {
   296         if (!generalValidOptions()) {
   303             return false;
   297             return false;
   304         }
       
   305 
       
   306         if (htmlVersion == null) {
       
   307             htmlVersion = HtmlVersion.HTML5;
       
   308         }
   298         }
   309 
   299 
   310         // check if helpfile exists
   300         // check if helpfile exists
   311         if (!helpfile.isEmpty()) {
   301         if (!helpfile.isEmpty()) {
   312             DocFile help = DocFile.createFileForInput(this, helpfile);
   302             DocFile help = DocFile.createFileForInput(this, helpfile);
   363         }
   353         }
   364         docPaths = new DocPaths(utils, useModuleDirectories);
   354         docPaths = new DocPaths(utils, useModuleDirectories);
   365         setCreateOverview();
   355         setCreateOverview();
   366         setTopFile(docEnv);
   356         setTopFile(docEnv);
   367         workArounds.initDocLint(doclintOpts.values(), tagletManager.getAllTagletNames(),
   357         workArounds.initDocLint(doclintOpts.values(), tagletManager.getAllTagletNames(),
   368                 Utils.toLowerCase(htmlVersion.name()));
   358                 Utils.toLowerCase(HtmlVersion.HTML5.name()));
   369         return true;
   359         return true;
   370     }
       
   371 
       
   372     /**
       
   373      * Return true if the generated output is HTML5.
       
   374      */
       
   375     public boolean isOutputHtml5() {
       
   376         return htmlVersion == HtmlVersion.HTML5;
       
   377     }
       
   378 
       
   379     /**
       
   380      * Return true if the tag is allowed for this specific version of HTML.
       
   381      */
       
   382     public boolean allowTag(HtmlTag htmlTag) {
       
   383         return htmlTag.allowTag(this.htmlVersion);
       
   384     }
   360     }
   385 
   361 
   386     /**
   362     /**
   387      * Decide the page which will appear first in the right-hand frame. It will
   363      * Decide the page which will appear first in the right-hand frame. It will
   388      * be "overview-summary.html" if "-overview" option is used or no
   364      * be "overview-summary.html" if "-overview" option is used or no
   586                     }
   562                     }
   587                     helpfile = args.get(0);
   563                     helpfile = args.get(0);
   588                     return true;
   564                     return true;
   589                 }
   565                 }
   590             },
   566             },
   591             new Option(resources, "-html4") {
       
   592                 @Override
       
   593                 public boolean process(String opt,  List<String> args) {
       
   594                     reporter.print(WARNING, resources.getText("doclet.HTML_4_specified", helpfile));
       
   595                     htmlVersion = HtmlVersion.HTML4;
       
   596                     return true;
       
   597                 }
       
   598             },
       
   599             new Option(resources, "-html5") {
   567             new Option(resources, "-html5") {
   600                 @Override
   568                 @Override
   601                 public boolean process(String opt,  List<String> args) {
   569                 public boolean process(String opt,  List<String> args) {
   602                     htmlVersion = HtmlVersion.HTML5;
       
   603                     return true;
   570                     return true;
   604                 }
   571                 }
   605             },
   572             },
   606             new Option(resources, "-nohelp") {
   573             new Option(resources, "-nohelp") {
   607                 @Override
   574                 @Override