Ejemplo n.º 1
0
 /**
  * Generate a package summary page for the left-hand bottom frame. Construct the
  * PackageFrameWriter object and then uses it generate the file.
  *
  * @param configuration the current configuration of the doclet.
  * @param packageDoc The package for which "pacakge-frame.html" is to be generated.
  */
 public static void generate(ConfigurationImpl configuration, PackageDoc packageDoc) {
   PackageFrameWriter packgen;
   try {
     packgen = new PackageFrameWriter(configuration, packageDoc);
     String pkgName = Util.getPackageName(packageDoc);
     Content body = packgen.getBody(false, packgen.getWindowTitle(pkgName));
     Content pkgNameContent = new StringContent(pkgName);
     Content heading =
         HtmlTree.HEADING(
             HtmlConstants.TITLE_HEADING,
             HtmlStyle.bar,
             packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent));
     body.addContent(heading);
     HtmlTree div = new HtmlTree(HtmlTag.DIV);
     div.addStyle(HtmlStyle.indexContainer);
     packgen.addClassListing(div);
     body.addContent(div);
     packgen.printHtmlDocument(
         configuration.metakeywords.getMetaKeywords(packageDoc), false, body);
     packgen.close();
   } catch (IOException exc) {
     configuration.standardmessage.error(
         "doclet.exception_encountered", exc.toString(), DocPaths.PACKAGE_FRAME.getPath());
     throw new DocletAbortException(exc);
   }
 }
Ejemplo n.º 2
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);
   }
 }
 /** {@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;
 }
 /** {@inheritDoc} */
 public void addPackageDescription(Content packageContentTree) {
   if (packageDoc.inlineTags().length > 0) {
     packageContentTree.addContent(getMarkerAnchor(SectionName.PACKAGE_DESCRIPTION));
     Content h2Content =
         new StringContent(configuration.getText("doclet.Package_Description", packageDoc.name()));
     packageContentTree.addContent(
         HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, h2Content));
     addInlineComment(packageDoc, packageContentTree);
   }
 }
Ejemplo n.º 6
0
 /**
  * Add the member information for the unicode character along with the list of the members.
  *
  * @param unicode Unicode for which member list information to be generated
  * @param memberlist List of members for the unicode character
  * @param contentTree the content tree to which the information will be added
  */
 protected void addContents(Character uc, List<? extends Doc> memberlist, Content contentTree) {
   String unicode = uc.toString();
   contentTree.addContent(getMarkerAnchorForIndex(unicode));
   Content headContent = new StringContent(unicode);
   Content heading =
       HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, false, HtmlStyle.title, headContent);
   contentTree.addContent(heading);
   int memberListSize = memberlist.size();
   // Display the list only if there are elements to be displayed.
   if (memberListSize > 0) {
     Content dl = new HtmlTree(HtmlTag.DL);
     for (int i = 0; i < memberListSize; i++) {
       Doc element = memberlist.get(i);
       if (element instanceof MemberDoc) {
         addDescription((MemberDoc) element, dl);
       } else if (element instanceof ClassDoc) {
         addDescription((ClassDoc) element, dl);
       } else if (element instanceof PackageDoc) {
         addDescription((PackageDoc) element, dl);
       }
     }
     contentTree.addContent(dl);
   }
 }