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

changeset 1736
74cd21f2c2fe
parent 1735
8ea30d59ac41
child 1737
7a9ef837e57f
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Tue May 14 10:14:51 2013 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Tue May 14 10:14:52 2013 -0700
     1.3 @@ -372,9 +372,9 @@
     1.4                      !configuration.isGeneratedDoc(classes[i])) {
     1.5                      continue;
     1.6                  }
     1.7 -                Content classContent = new RawHtml(getLink(new LinkInfoImpl(
     1.8 +                Content classContent = getLink(new LinkInfoImpl(
     1.9                          configuration, LinkInfoImpl.Kind.PACKAGE, classes[i],
    1.10 -                        false)));
    1.11 +                        false));
    1.12                  Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent);
    1.13                  HtmlTree tr = HtmlTree.TR(tdClass);
    1.14                  if (i%2 == 0)
    1.15 @@ -1109,9 +1109,9 @@
    1.16       *
    1.17       * @return the link for the given class.
    1.18       */
    1.19 -    public String getLink(LinkInfoImpl linkInfo) {
    1.20 +    public Content getLink(LinkInfoImpl linkInfo) {
    1.21          LinkFactoryImpl factory = new LinkFactoryImpl(this);
    1.22 -        String link = factory.getLinkOutput(linkInfo).toString();
    1.23 +        Content link = factory.getLink(linkInfo);
    1.24          displayLength += linkInfo.displayLength;
    1.25          return link;
    1.26      }
    1.27 @@ -1122,9 +1122,9 @@
    1.28       * @param linkInfo the information about the link.
    1.29       * @return the type for the given class.
    1.30       */
    1.31 -    public String getTypeParameterLinks(LinkInfoImpl linkInfo) {
    1.32 +    public Content getTypeParameterLinks(LinkInfoImpl linkInfo) {
    1.33          LinkFactoryImpl factory = new LinkFactoryImpl(this);
    1.34 -        return factory.getTypeParameterLinks(linkInfo, false).toString();
    1.35 +        return factory.getTypeParameterLinks(linkInfo, false);
    1.36      }
    1.37  
    1.38      /*************************************************************
    1.39 @@ -1192,8 +1192,8 @@
    1.40       * @return a content tree for the link
    1.41       */
    1.42      public Content getQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd) {
    1.43 -        return new RawHtml(getLink(new LinkInfoImpl(configuration, context, cd,
    1.44 -                configuration.getClassName(cd), "")));
    1.45 +        return getLink(new LinkInfoImpl(configuration, context, cd,
    1.46 +                configuration.getClassName(cd), ""));
    1.47      }
    1.48  
    1.49      /**
    1.50 @@ -1244,8 +1244,8 @@
    1.51          if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
    1.52              contentTree.addContent(getPkgName(cd));
    1.53          }
    1.54 -        contentTree.addContent(new RawHtml(getLink(new LinkInfoImpl(configuration,
    1.55 -                context, cd, cd.name(), isStrong))));
    1.56 +        contentTree.addContent(getLink(new LinkInfoImpl(configuration,
    1.57 +                context, cd, cd.name(), isStrong)));
    1.58      }
    1.59  
    1.60      /**
    1.61 @@ -1281,8 +1281,8 @@
    1.62       * @param strong true if the link should be strong.
    1.63       * @return the link for the given member.
    1.64       */
    1.65 -    public String getDocLink(LinkInfoImpl.Kind context, MemberDoc doc, String label,
    1.66 -                boolean strong) {
    1.67 +    public Content getDocLink(LinkInfoImpl.Kind context, MemberDoc doc, String label,
    1.68 +            boolean strong) {
    1.69          return getDocLink(context, doc.containingClass(), doc, label, strong);
    1.70      }
    1.71  
    1.72 @@ -1298,8 +1298,8 @@
    1.73       * @param strong true if the link should be strong.
    1.74       * @return the link for the given member.
    1.75       */
    1.76 -    public String getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc,
    1.77 -        String label, boolean strong) {
    1.78 +    public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc,
    1.79 +            String label, boolean strong) {
    1.80          return getDocLink(context, classDoc, doc, label, strong, false);
    1.81      }
    1.82  
    1.83 @@ -1316,11 +1316,11 @@
    1.84       * @param isProperty true if the doc parameter is a JavaFX property.
    1.85       * @return the link for the given member.
    1.86       */
    1.87 -    public String getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc,
    1.88 +    public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc,
    1.89          String label, boolean strong, boolean isProperty) {
    1.90          if (! (doc.isIncluded() ||
    1.91              Util.isLinkable(classDoc, configuration))) {
    1.92 -            return label;
    1.93 +            return new RawHtml(label);
    1.94          } else if (doc instanceof ExecutableMemberDoc) {
    1.95              ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
    1.96              return getLink(new LinkInfoImpl(configuration, context, classDoc,
    1.97 @@ -1329,7 +1329,7 @@
    1.98              return getLink(new LinkInfoImpl(configuration, context, classDoc,
    1.99                  doc.name(), label, strong));
   1.100          } else {
   1.101 -            return label;
   1.102 +            return new RawHtml(label);
   1.103          }
   1.104      }
   1.105  
   1.106 @@ -1351,11 +1351,11 @@
   1.107              return new StringContent(label);
   1.108          } else if (doc instanceof ExecutableMemberDoc) {
   1.109              ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
   1.110 -            return new RawHtml(getLink(new LinkInfoImpl(configuration, context, classDoc,
   1.111 -                getAnchor(emd), label, false)));
   1.112 +            return getLink(new LinkInfoImpl(configuration, context, classDoc,
   1.113 +                getAnchor(emd), label, false));
   1.114          } else if (doc instanceof MemberDoc) {
   1.115 -            return new RawHtml(getLink(new LinkInfoImpl(configuration, context, classDoc,
   1.116 -                doc.name(), label, false)));
   1.117 +            return getLink(new LinkInfoImpl(configuration, context, classDoc,
   1.118 +                doc.name(), label, false));
   1.119          } else {
   1.120              return new StringContent(label);
   1.121          }
   1.122 @@ -1441,7 +1441,7 @@
   1.123              if (label.isEmpty()) {
   1.124                  label = plainOrCodeText(plain, refClass.name());
   1.125              }
   1.126 -            return getLink(new LinkInfoImpl(configuration, refClass, label));
   1.127 +            return getLink(new LinkInfoImpl(configuration, refClass, label)).toString();
   1.128          } else if (refMem == null) {
   1.129              // Must be a member reference since refClass is not null and refMemName is not null.
   1.130              // However, refMem is null, so this referenced member does not exist.
   1.131 @@ -1481,7 +1481,7 @@
   1.132              text = plainOrCodeText(plain, Util.escapeHtmlChars(refMemName));
   1.133  
   1.134              return getDocLink(LinkInfoImpl.Kind.SEE_TAG, containing,
   1.135 -                refMem, (label.isEmpty() ? text: label), false);
   1.136 +                refMem, (label.isEmpty() ? text: label), false).toString();
   1.137          }
   1.138      }
   1.139  
   1.140 @@ -2147,7 +2147,7 @@
   1.141                      linkInfo.label = (type.asClassDoc().isIncluded() ?
   1.142                          type.typeName() :
   1.143                          type.qualifiedTypeName()) + type.dimension() + ".class";
   1.144 -                return getLink(linkInfo);
   1.145 +                return getLink(linkInfo).toString();
   1.146              } else {
   1.147                  return type.typeName() + type.dimension() + ".class";
   1.148              }
   1.149 @@ -2163,7 +2163,7 @@
   1.150          } else if (annotationValue.value() instanceof MemberDoc) {
   1.151              return getDocLink(LinkInfoImpl.Kind.ANNOTATION,
   1.152                  (MemberDoc) annotationValue.value(),
   1.153 -                ((MemberDoc) annotationValue.value()).name(), false);
   1.154 +                ((MemberDoc) annotationValue.value()).name(), false).toString();
   1.155           } else {
   1.156              return annotationValue.toString();
   1.157           }

mercurial