src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java

changeset 1737
7a9ef837e57f
parent 1735
8ea30d59ac41
child 1738
6ea964c78845
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java	Tue May 14 10:14:52 2013 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java	Tue May 14 10:14:52 2013 -0700
     1.3 @@ -27,6 +27,9 @@
     1.4  package com.sun.tools.doclets.formats.html;
     1.5  
     1.6  import com.sun.javadoc.*;
     1.7 +import com.sun.tools.doclets.formats.html.markup.ContentBuilder;
     1.8 +import com.sun.tools.doclets.formats.html.markup.StringContent;
     1.9 +import com.sun.tools.doclets.internal.toolkit.Content;
    1.10  import com.sun.tools.doclets.internal.toolkit.util.*;
    1.11  import com.sun.tools.doclets.internal.toolkit.util.links.*;
    1.12  
    1.13 @@ -222,7 +225,7 @@
    1.14      /**
    1.15       * String style of text defined in style sheet.
    1.16       */
    1.17 -    public String styleName ="";
    1.18 +    public String styleName = "";
    1.19  
    1.20      /**
    1.21       * The value of the target.
    1.22 @@ -239,7 +242,7 @@
    1.23       * @param target     the value of the target attribute.
    1.24       */
    1.25      public LinkInfoImpl(ConfigurationImpl configuration,
    1.26 -            Kind context, ClassDoc classDoc, String label, String target) {
    1.27 +            Kind context, ClassDoc classDoc, Content label, String target) {
    1.28          this.configuration = configuration;
    1.29          this.classDoc = classDoc;
    1.30          this.label = label;
    1.31 @@ -248,6 +251,13 @@
    1.32      }
    1.33  
    1.34      /**
    1.35 +     * {@inherotDoc}
    1.36 +     */
    1.37 +    protected Content newContent() {
    1.38 +        return new ContentBuilder();
    1.39 +    }
    1.40 +
    1.41 +    /**
    1.42       * Construct a LinkInfo object.
    1.43       *
    1.44       * @param configuration the configuration data for the doclet
    1.45 @@ -259,7 +269,7 @@
    1.46       * @param styleName  String style of text defined in style sheet.
    1.47       */
    1.48      public LinkInfoImpl(ConfigurationImpl configuration,
    1.49 -            Kind context, ClassDoc classDoc, String where, String label,
    1.50 +            Kind context, ClassDoc classDoc, String where, Content label,
    1.51              boolean isStrong, String styleName) {
    1.52          this.configuration = configuration;
    1.53          this.classDoc = classDoc;
    1.54 @@ -277,17 +287,45 @@
    1.55       * @param context    the context of the link.
    1.56       * @param classDoc   the class to link to.
    1.57       * @param where      the value of the marker #.
    1.58 -     * @param label      the label for the link.
    1.59 +     * @param label      the plain-text label for the link.
    1.60       * @param isStrong       true if the link should be strong.
    1.61       */
    1.62      public LinkInfoImpl(ConfigurationImpl configuration,
    1.63              Kind context, ClassDoc classDoc, String where, String label,
    1.64              boolean isStrong) {
    1.65 +        this(configuration, context, classDoc, where, new StringContent(label),
    1.66 +                isStrong, "");
    1.67 +    }
    1.68 +
    1.69 +    /**
    1.70 +     * Construct a LinkInfo object.
    1.71 +     *
    1.72 +     * @param configuration the configuration data for the doclet
    1.73 +     * @param context    the context of the link.
    1.74 +     * @param classDoc   the class to link to.
    1.75 +     * @param where      the value of the marker #.
    1.76 +     * @param label      the label for the link.
    1.77 +     * @param isStrong       true if the link should be strong.
    1.78 +     */
    1.79 +    public LinkInfoImpl(ConfigurationImpl configuration,
    1.80 +            Kind context, ClassDoc classDoc, String where, Content label,
    1.81 +            boolean isStrong) {
    1.82 +        this(configuration, context, classDoc, where, label,
    1.83 +                isStrong, "");
    1.84 +    }
    1.85 +
    1.86 +    /**
    1.87 +     * Construct a LinkInfo object.
    1.88 +     *
    1.89 +     * @param configuration the configuration data for the doclet
    1.90 +     * @param classDoc   the class to link to.
    1.91 +     * @param label      the label for the link.
    1.92 +     */
    1.93 +    public LinkInfoImpl(ConfigurationImpl configuration,
    1.94 +            ClassDoc classDoc, Content label) {
    1.95          this.configuration = configuration;
    1.96          this.classDoc = classDoc;
    1.97 -        this.where = where;
    1.98          this.label = label;
    1.99 -        this.isStrong = isStrong;
   1.100          setContext(context);
   1.101      }
   1.102  
   1.103 @@ -302,7 +340,7 @@
   1.104              ClassDoc classDoc, String label) {
   1.105          this.configuration = configuration;
   1.106          this.classDoc = classDoc;
   1.107 -        this.label = label;
   1.108 +        this.label = new StringContent(label);
   1.109          setContext(context);
   1.110      }
   1.111  
   1.112 @@ -375,11 +413,26 @@
   1.113       * @param configuration the configuration data for the doclet
   1.114       * @param context    the context of the link.
   1.115       * @param type       the class to link to.
   1.116 +     * @param label      plain-text label for the link.
   1.117 +     * @param isStrong     true if the link should be strong.
   1.118 +     */
   1.119 +    public LinkInfoImpl(ConfigurationImpl configuration,
   1.120 +            Kind context, Type type, String label,
   1.121 +            boolean isStrong) {
   1.122 +        this(configuration, context, type, new StringContent(label), isStrong);
   1.123 +    }
   1.124 +
   1.125 +    /**
   1.126 +     * Construct a LinkInfo object.
   1.127 +     *
   1.128 +     * @param configuration the configuration data for the doclet
   1.129 +     * @param context    the context of the link.
   1.130 +     * @param type       the class to link to.
   1.131       * @param label      the label for the link.
   1.132       * @param isStrong     true if the link should be strong.
   1.133       */
   1.134      public LinkInfoImpl(ConfigurationImpl configuration,
   1.135 -            Kind context, Type type, String label,
   1.136 +            Kind context, Type type, Content label,
   1.137              boolean isStrong) {
   1.138          this.configuration = configuration;
   1.139          this.type = type;
   1.140 @@ -394,11 +447,26 @@
   1.141       * @param configuration the configuration data for the doclet
   1.142       * @param context    the context of the link.
   1.143       * @param classDoc   the class to link to.
   1.144 +     * @param label      plain-text label for the link.
   1.145 +     * @param isStrong       true if the link should be strong.
   1.146 +     */
   1.147 +    public LinkInfoImpl(ConfigurationImpl configuration,
   1.148 +            Kind context, ClassDoc classDoc, String label,
   1.149 +            boolean isStrong) {
   1.150 +        this(configuration, context, classDoc, new StringContent(label), isStrong);
   1.151 +    }
   1.152 +
   1.153 +    /**
   1.154 +     * Construct a LinkInfo object.
   1.155 +     *
   1.156 +     * @param configuration the configuration data for the doclet
   1.157 +     * @param context    the context of the link.
   1.158 +     * @param classDoc   the class to link to.
   1.159       * @param label      the label for the link.
   1.160       * @param isStrong       true if the link should be strong.
   1.161       */
   1.162      public LinkInfoImpl(ConfigurationImpl configuration,
   1.163 -            Kind context, ClassDoc classDoc, String label,
   1.164 +            Kind context, ClassDoc classDoc, Content label,
   1.165              boolean isStrong) {
   1.166          this.configuration = configuration;
   1.167          this.classDoc = classDoc;

mercurial