langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java
equal
deleted
inserted
replaced
36 import jdk.javadoc.doclet.Doclet.Option; |
36 import jdk.javadoc.doclet.Doclet.Option; |
37 import jdk.javadoc.doclet.DocletEnvironment; |
37 import jdk.javadoc.doclet.DocletEnvironment; |
38 import jdk.javadoc.doclet.Reporter; |
38 import jdk.javadoc.doclet.Reporter; |
39 import jdk.javadoc.internal.doclets.toolkit.AbstractDoclet; |
39 import jdk.javadoc.internal.doclets.toolkit.AbstractDoclet; |
40 import jdk.javadoc.internal.doclets.toolkit.Configuration; |
40 import jdk.javadoc.internal.doclets.toolkit.Configuration; |
|
41 import jdk.javadoc.internal.doclets.toolkit.Messages; |
41 import jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder; |
42 import jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder; |
42 import jdk.javadoc.internal.doclets.toolkit.util.ClassTree; |
43 import jdk.javadoc.internal.doclets.toolkit.util.ClassTree; |
43 import jdk.javadoc.internal.doclets.toolkit.util.DocFile; |
44 import jdk.javadoc.internal.doclets.toolkit.util.DocFile; |
44 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
45 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
45 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
46 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
66 } |
67 } |
67 |
68 |
68 /** |
69 /** |
69 * The global configuration information for this run. |
70 * The global configuration information for this run. |
70 */ |
71 */ |
71 public final ConfigurationImpl configuration; |
72 private final ConfigurationImpl configuration; |
|
73 |
|
74 private Messages messages; |
72 |
75 |
73 |
76 |
74 private static final DocPath DOCLET_RESOURCES = DocPath |
77 private static final DocPath DOCLET_RESOURCES = DocPath |
75 .create("/jdk/javadoc/internal/doclets/formats/html/resources"); |
78 .create("/jdk/javadoc/internal/doclets/formats/html/resources"); |
76 |
79 |
77 public void init(Locale locale, Reporter reporter) { |
80 public void init(Locale locale, Reporter reporter) { |
78 configuration.reporter = reporter; |
81 configuration.reporter = reporter; |
79 configuration.locale = locale; |
82 configuration.locale = locale; |
|
83 messages = configuration.getMessages(); |
80 } |
84 } |
81 |
85 |
82 /** |
86 /** |
83 * The "start" method as required by Javadoc. |
87 * The "start" method as required by Javadoc. |
84 * |
88 * |
116 SourceToHTMLConverter.convertRoot(configuration, |
120 SourceToHTMLConverter.convertRoot(configuration, |
117 docEnv, DocPaths.SOURCE_OUTPUT); |
121 docEnv, DocPaths.SOURCE_OUTPUT); |
118 } |
122 } |
119 |
123 |
120 if (configuration.topFile.isEmpty()) { |
124 if (configuration.topFile.isEmpty()) { |
121 configuration.standardmessage. |
125 messages.error("doclet.No_Non_Deprecated_Classes_To_Document"); |
122 error("doclet.No_Non_Deprecated_Classes_To_Document"); |
|
123 return; |
126 return; |
124 } |
127 } |
125 boolean nodeprecated = configuration.nodeprecated; |
128 boolean nodeprecated = configuration.nodeprecated; |
126 performCopy(configuration.helpfile); |
129 performCopy(configuration.helpfile); |
127 performCopy(configuration.stylesheetfile); |
130 performCopy(configuration.stylesheetfile); |
349 DocPath path = DocPath.create(fromfile.getName()); |
352 DocPath path = DocPath.create(fromfile.getName()); |
350 DocFile toFile = DocFile.createFileForOutput(configuration, path); |
353 DocFile toFile = DocFile.createFileForOutput(configuration, path); |
351 if (toFile.isSameFile(fromfile)) |
354 if (toFile.isSameFile(fromfile)) |
352 return; |
355 return; |
353 |
356 |
354 configuration.message.notice("doclet.Copying_File_0_To_File_1", |
357 messages.notice("doclet.Copying_File_0_To_File_1", |
355 fromfile.toString(), path.getPath()); |
358 fromfile.toString(), path.getPath()); |
356 toFile.copyFile(fromfile); |
359 toFile.copyFile(fromfile); |
357 } catch (IOException exc) { |
360 } catch (IOException exc) { |
358 configuration.message.error("doclet.perform_copy_exception_encountered", |
361 messages.error("doclet.perform_copy_exception_encountered", |
359 exc.toString()); |
362 exc.toString()); |
360 throw new DocletAbortException(exc); |
363 throw new DocletAbortException(exc); |
361 } |
364 } |
362 } |
365 } |
363 } |
366 } |