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

changeset 1410
bfec2a1cc869
parent 1383
b980e8e6aabf
child 1417
522a1ee72340
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Nov 14 17:23:10 2012 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Thu Nov 15 09:18:36 2012 -0800
     1.3 @@ -82,7 +82,7 @@
     1.4      /**
     1.5       * The global configuration information for this run.
     1.6       */
     1.7 -    public ConfigurationImpl configuration;
     1.8 +    public final ConfigurationImpl configuration;
     1.9  
    1.10      /**
    1.11       * To check whether annotation heading is printed or not.
    1.12 @@ -302,7 +302,7 @@
    1.13       */
    1.14      public void printHtmlDocument(String[] metakeywords, boolean includeScript,
    1.15              Content body) throws IOException {
    1.16 -        Content htmlDocType = DocType.Transitional();
    1.17 +        Content htmlDocType = DocType.TRANSITIONAL;
    1.18          Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
    1.19          Content head = new HtmlTree(HtmlTag.HEAD);
    1.20          if (!configuration.notimestamp) {
    1.21 @@ -835,7 +835,7 @@
    1.22              String tableSummary, String[] tableHeader, Content contentTree) {
    1.23          if (deprPkgs.size() > 0) {
    1.24              Content table = HtmlTree.TABLE(0, 3, 0, tableSummary,
    1.25 -                    getTableCaption(configuration().getText(headingKey)));
    1.26 +                    getTableCaption(configuration.getText(headingKey)));
    1.27              table.addContent(getSummaryTableHeader(tableHeader, "col"));
    1.28              Content tbody = new HtmlTree(HtmlTag.TBODY);
    1.29              for (int i = 0; i < deprPkgs.size(); i++) {
    1.30 @@ -1079,7 +1079,7 @@
    1.31       * @return a content tree for the link
    1.32       */
    1.33      public Content getQualifiedClassLink(int context, ClassDoc cd) {
    1.34 -        return new RawHtml(getLink(new LinkInfoImpl(context, cd,
    1.35 +        return new RawHtml(getLink(new LinkInfoImpl(configuration, context, cd,
    1.36                  configuration.getClassName(cd), "")));
    1.37      }
    1.38  
    1.39 @@ -1110,7 +1110,8 @@
    1.40          if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
    1.41              classlink = getPkgName(cd);
    1.42          }
    1.43 -        classlink += getLink(new LinkInfoImpl(context, cd, cd.name(), isStrong));
    1.44 +        classlink += getLink(new LinkInfoImpl(configuration,
    1.45 +                context, cd, cd.name(), isStrong));
    1.46          return classlink;
    1.47      }
    1.48  
    1.49 @@ -1130,7 +1131,7 @@
    1.50          if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
    1.51              contentTree.addContent(getPkgName(cd));
    1.52          }
    1.53 -        contentTree.addContent(new RawHtml(getLink(new LinkInfoImpl(
    1.54 +        contentTree.addContent(new RawHtml(getLink(new LinkInfoImpl(configuration,
    1.55                  context, cd, cd.name(), isStrong))));
    1.56      }
    1.57  
    1.58 @@ -1187,14 +1188,14 @@
    1.59      public String getDocLink(int context, ClassDoc classDoc, MemberDoc doc,
    1.60          String label, boolean strong) {
    1.61          if (! (doc.isIncluded() ||
    1.62 -            Util.isLinkable(classDoc, configuration()))) {
    1.63 +            Util.isLinkable(classDoc, configuration))) {
    1.64              return label;
    1.65          } else if (doc instanceof ExecutableMemberDoc) {
    1.66              ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
    1.67 -            return getLink(new LinkInfoImpl(context, classDoc,
    1.68 +            return getLink(new LinkInfoImpl(configuration, context, classDoc,
    1.69                  getAnchor(emd), label, strong));
    1.70          } else if (doc instanceof MemberDoc) {
    1.71 -            return getLink(new LinkInfoImpl(context, classDoc,
    1.72 +            return getLink(new LinkInfoImpl(configuration, context, classDoc,
    1.73                  doc.name(), label, strong));
    1.74          } else {
    1.75              return label;
    1.76 @@ -1215,14 +1216,14 @@
    1.77      public Content getDocLink(int context, ClassDoc classDoc, MemberDoc doc,
    1.78          String label) {
    1.79          if (! (doc.isIncluded() ||
    1.80 -            Util.isLinkable(classDoc, configuration()))) {
    1.81 +            Util.isLinkable(classDoc, configuration))) {
    1.82              return new StringContent(label);
    1.83          } else if (doc instanceof ExecutableMemberDoc) {
    1.84              ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
    1.85 -            return new RawHtml(getLink(new LinkInfoImpl(context, classDoc,
    1.86 +            return new RawHtml(getLink(new LinkInfoImpl(configuration, context, classDoc,
    1.87                  getAnchor(emd), label, false)));
    1.88          } else if (doc instanceof MemberDoc) {
    1.89 -            return new RawHtml(getLink(new LinkInfoImpl(context, classDoc,
    1.90 +            return new RawHtml(getLink(new LinkInfoImpl(configuration, context, classDoc,
    1.91                  doc.name(), label, false)));
    1.92          } else {
    1.93              return new StringContent(label);
    1.94 @@ -1302,7 +1303,7 @@
    1.95              if (label.isEmpty()) {
    1.96                  label = plainOrCodeText(plain, refClass.name());
    1.97              }
    1.98 -            return getLink(new LinkInfoImpl(refClass, label));
    1.99 +            return getLink(new LinkInfoImpl(configuration, refClass, label));
   1.100          } else if (refMem == null) {
   1.101              // Must be a member reference since refClass is not null and refMemName is not null.
   1.102              // However, refMem is null, so this referenced member does not exist.
   1.103 @@ -1313,7 +1314,7 @@
   1.104              ClassDoc containing = refMem.containingClass();
   1.105              if (see.text().trim().startsWith("#") &&
   1.106                  ! (containing.isPublic() ||
   1.107 -                Util.isLinkable(containing, configuration()))) {
   1.108 +                Util.isLinkable(containing, configuration))) {
   1.109                  // Since the link is relative and the holder is not even being
   1.110                  // documented, this must be an inherited link.  Redirect it.
   1.111                  // The current class either overrides the referenced member or
   1.112 @@ -1502,7 +1503,7 @@
   1.113                  StringBuilder textBuff = new StringBuilder();
   1.114                  while (lines.hasMoreTokens()) {
   1.115                      StringBuilder line = new StringBuilder(lines.nextToken());
   1.116 -                    Util.replaceTabs(configuration.sourcetab, line);
   1.117 +                    Util.replaceTabs(configuration, line);
   1.118                      textBuff.append(line.toString());
   1.119                  }
   1.120                  result.append(textBuff);
   1.121 @@ -1784,7 +1785,7 @@
   1.122                  continue;
   1.123              }
   1.124              annotation = new StringBuilder();
   1.125 -            LinkInfoImpl linkInfo = new LinkInfoImpl(
   1.126 +            LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
   1.127                  LinkInfoImpl.CONTEXT_ANNOTATION, annotationDoc);
   1.128              linkInfo.label = "@" + annotationDoc.name();
   1.129              annotation.append(getLink(linkInfo));
   1.130 @@ -1835,7 +1836,7 @@
   1.131          if (annotationValue.value() instanceof Type) {
   1.132              Type type = (Type) annotationValue.value();
   1.133              if (type.asClassDoc() != null) {
   1.134 -                LinkInfoImpl linkInfo = new LinkInfoImpl(
   1.135 +                LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
   1.136                      LinkInfoImpl.CONTEXT_ANNOTATION, type);
   1.137                      linkInfo.label = (type.asClassDoc().isIncluded() ?
   1.138                          type.typeName() :

mercurial