/** {@inheritDoc} */
 public Content getPackageHeader(String heading) {
   String pkgName = packageDoc.name();
   Content bodyTree = getBody(true, getWindowTitle(pkgName));
   addTop(bodyTree);
   addNavLinks(true, bodyTree);
   HtmlTree div = new HtmlTree(HtmlTag.DIV);
   div.addStyle(HtmlStyle.header);
   Content profileContent = new StringContent(profileName);
   Content profileNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, profileContent);
   div.addContent(profileNameDiv);
   Content annotationContent = new HtmlTree(HtmlTag.P);
   addAnnotationInfo(packageDoc, annotationContent);
   div.addContent(annotationContent);
   Content tHeading =
       HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, HtmlStyle.title, packageLabel);
   tHeading.addContent(getSpace());
   Content packageHead = new RawHtml(heading);
   tHeading.addContent(packageHead);
   div.addContent(tHeading);
   addDeprecationInfo(div);
   if (packageDoc.inlineTags().length > 0 && !configuration.nocomment) {
     HtmlTree docSummaryDiv = new HtmlTree(HtmlTag.DIV);
     docSummaryDiv.addStyle(HtmlStyle.docSummary);
     addSummaryComment(packageDoc, docSummaryDiv);
     div.addContent(docSummaryDiv);
     Content space = getSpace();
     Content descLink =
         getHyperLink(getDocLink(SectionName.PACKAGE_DESCRIPTION), descriptionLabel, "", "");
     Content descPara = new HtmlTree(HtmlTag.P, seeLabel, space, descLink);
     div.addContent(descPara);
   }
   bodyTree.addContent(div);
   return bodyTree;
 }
 /** {@inheritDoc} */
 public Content getHeader(String header) {
   String pkgname =
       (annotationType.containingPackage() != null)
           ? annotationType.containingPackage().name()
           : "";
   String clname = annotationType.name();
   Content bodyTree = getBody(true, getWindowTitle(clname));
   addTop(bodyTree);
   addNavLinks(true, bodyTree);
   bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
   HtmlTree div = new HtmlTree(HtmlTag.DIV);
   div.addStyle(HtmlStyle.header);
   if (pkgname.length() > 0) {
     Content pkgNameContent = new StringContent(pkgname);
     Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
     div.addContent(pkgNameDiv);
   }
   LinkInfoImpl linkInfo =
       new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_HEADER, annotationType);
   Content headerContent = new StringContent(header);
   Content heading =
       HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, HtmlStyle.title, headerContent);
   heading.addContent(getTypeParameterLinks(linkInfo));
   div.addContent(heading);
   bodyTree.addContent(div);
   return bodyTree;
 }
Ejemplo n.º 3
0
 /**
  * Add specific class kind listing. Also add label to the listing.
  *
  * @param arr Array of specific class kinds, namely Class or Interface or Exception or Error
  * @param labelContent content tree of the label to be added
  * @param contentTree the content tree to which the class kind listing will be added
  */
 protected void addClassKindListing(ClassDoc[] arr, Content labelContent, Content contentTree) {
   arr = Util.filterOutPrivateClasses(arr, configuration.javafx);
   if (arr.length > 0) {
     Arrays.sort(arr);
     boolean printedHeader = false;
     HtmlTree ul = new HtmlTree(HtmlTag.UL);
     ul.setTitle(labelContent);
     for (int i = 0; i < arr.length; i++) {
       if (documentedClasses != null && !documentedClasses.contains(arr[i])) {
         continue;
       }
       if (!Util.isCoreClass(arr[i]) || !configuration.isGeneratedDoc(arr[i])) {
         continue;
       }
       if (!printedHeader) {
         Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, labelContent);
         contentTree.addContent(heading);
         printedHeader = true;
       }
       Content arr_i_name = new StringContent(arr[i].name());
       if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name);
       Content link =
           getLink(
               new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i])
                   .label(arr_i_name)
                   .target("classFrame"));
       Content li = HtmlTree.LI(link);
       ul.addContent(li);
     }
     contentTree.addContent(ul);
   }
 }
Ejemplo n.º 4
0
 /**
  * Add comment for each element in the index. If the element is deprecated and it has
  * a @deprecated tag, use that comment. Else if the containing class for this element is
  * deprecated, then add the word "Deprecated." at the start and then print the normal comment.
  *
  * @param element Index element
  * @param contentTree the content tree to which the comment will be added
  */
 protected void addComment(ProgramElementDoc element, Content contentTree) {
   Tag[] tags;
   Content span = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
   HtmlTree div = new HtmlTree(HtmlTag.DIV);
   div.addStyle(HtmlStyle.block);
   if (Util.isDeprecated(element)) {
     div.addContent(span);
     if ((tags = element.tags("deprecated")).length > 0)
       addInlineDeprecatedComment(element, tags[0], div);
     contentTree.addContent(div);
   } else {
     ClassDoc cont = element.containingClass();
     while (cont != null) {
       if (Util.isDeprecated(cont)) {
         div.addContent(span);
         contentTree.addContent(div);
         break;
       }
       cont = cont.containingClass();
     }
     addSummaryComment(element, contentTree);
   }
 }
 /**
  * Add the package deprecation information to the documentation tree.
  *
  * @param div the content tree to which the deprecation information will be added
  */
 public void addDeprecationInfo(Content div) {
   Tag[] deprs = packageDoc.tags("deprecated");
   if (Util.isDeprecated(packageDoc)) {
     HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
     deprDiv.addStyle(HtmlStyle.deprecatedContent);
     Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
     deprDiv.addContent(deprPhrase);
     if (deprs.length > 0) {
       Tag[] commentTags = deprs[0].inlineTags();
       if (commentTags.length > 0) {
         addInlineDeprecatedComment(packageDoc, deprs[0], deprDiv);
       }
     }
     div.addContent(deprDiv);
   }
 }