16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.javadoc.internal.doclets.formats.html.markup;
27
28 import java.util.*;
29
30 import javax.lang.model.element.ModuleElement;
31 import javax.lang.model.element.PackageElement;
32 import javax.lang.model.element.TypeElement;
33
34 import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration;
35 import jdk.javadoc.internal.doclets.formats.html.SectionName;
36 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
37 import jdk.javadoc.internal.doclets.toolkit.Content;
38 import jdk.javadoc.internal.doclets.toolkit.Messages;
39 import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
40 import jdk.javadoc.internal.doclets.toolkit.util.DocLink;
41 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
42 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
43
44
45 /**
46 * Class for the Html Format Code Generation specific to JavaDoc.
47 * This Class contains methods related to the Html Code Generation which
48 * are used by the Sub-Classes in the package jdk.javadoc.internal.tool.standard.
49 *
50 * <p><b>This is NOT part of any supported API.
51 * If you write code that depends on this, you do so at your own risk.
52 * This code and its internal interfaces are subject to change or
53 * deletion without notice.</b>
54 *
55 * @author Atul M Dambalkar
56 * @author Robert Field
59
60 public static final String CONTENT_TYPE = "text/html";
61
62 private final HtmlConfiguration configuration;
63 private final DocPath pathToRoot;
64
65 /**
66 * Constructor. Initializes the destination file name through the super
67 * class HtmlWriter.
68 *
69 * @param configuration the configuration for this doclet
70 * @param filename String file name.
71 */
72 public HtmlDocWriter(HtmlConfiguration configuration, DocPath filename) {
73 super(configuration, filename);
74 this.configuration = configuration;
75 this.pathToRoot = filename.parent().invert();
76 Messages messages = configuration.getMessages();
77 messages.notice("doclet.Generating_0",
78 DocFile.createFileForOutput(configuration, filename).getPath());
79 }
80
81 /**
82 * Accessor for configuration.
83 * @return the configuration for this doclet
84 */
85 public BaseConfiguration configuration() {
86 return configuration;
87 }
88
89 public Content getHyperLink(DocPath link, String label) {
90 return getHyperLink(link, new StringContent(label), false, "", "", "");
91 }
92
93 /**
94 * Get Html Hyper Link Content.
95 *
96 * @param where Position of the link in the file. Character '#' is not
97 * needed.
98 * @param label Tag for the link.
99 * @return a content tree for the hyper link
100 */
101 public Content getHyperLink(String where,
102 Content label) {
103 return getHyperLink(getDocLink(where), label, "", "");
104 }
105
106 /**
|
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.javadoc.internal.doclets.formats.html.markup;
27
28 import java.util.*;
29
30 import javax.lang.model.element.ModuleElement;
31 import javax.lang.model.element.PackageElement;
32 import javax.lang.model.element.TypeElement;
33
34 import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration;
35 import jdk.javadoc.internal.doclets.formats.html.SectionName;
36 import jdk.javadoc.internal.doclets.toolkit.Content;
37 import jdk.javadoc.internal.doclets.toolkit.Messages;
38 import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
39 import jdk.javadoc.internal.doclets.toolkit.util.DocLink;
40 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
41 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
42
43
44 /**
45 * Class for the Html Format Code Generation specific to JavaDoc.
46 * This Class contains methods related to the Html Code Generation which
47 * are used by the Sub-Classes in the package jdk.javadoc.internal.tool.standard.
48 *
49 * <p><b>This is NOT part of any supported API.
50 * If you write code that depends on this, you do so at your own risk.
51 * This code and its internal interfaces are subject to change or
52 * deletion without notice.</b>
53 *
54 * @author Atul M Dambalkar
55 * @author Robert Field
58
59 public static final String CONTENT_TYPE = "text/html";
60
61 private final HtmlConfiguration configuration;
62 private final DocPath pathToRoot;
63
64 /**
65 * Constructor. Initializes the destination file name through the super
66 * class HtmlWriter.
67 *
68 * @param configuration the configuration for this doclet
69 * @param filename String file name.
70 */
71 public HtmlDocWriter(HtmlConfiguration configuration, DocPath filename) {
72 super(configuration, filename);
73 this.configuration = configuration;
74 this.pathToRoot = filename.parent().invert();
75 Messages messages = configuration.getMessages();
76 messages.notice("doclet.Generating_0",
77 DocFile.createFileForOutput(configuration, filename).getPath());
78 }
79
80 public Content getHyperLink(DocPath link, String label) {
81 return getHyperLink(link, new StringContent(label), false, "", "", "");
82 }
83
84 /**
85 * Get Html Hyper Link Content.
86 *
87 * @param where Position of the link in the file. Character '#' is not
88 * needed.
89 * @param label Tag for the link.
90 * @return a content tree for the hyper link
91 */
92 public Content getHyperLink(String where,
93 Content label) {
94 return getHyperLink(getDocLink(where), label, "", "");
95 }
96
97 /**
|