예제 #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);
   }
 }
예제 #2
0
 /**
  * Add the classkind (class, interface, exception), error of the class passed.
  *
  * @param cd the class being documented
  * @param contentTree the content tree to which the class info will be added
  */
 protected void addClassInfo(ClassDoc cd, Content contentTree) {
   contentTree.addContent(
       getResource(
           "doclet.in",
           Util.getTypeName(configuration, cd, false),
           getPackageLink(cd.containingPackage(), Util.getPackageName(cd.containingPackage()))));
 }
예제 #3
0
 /**
  * Add class listing for all the classes in this package. Divide class listing as per the class
  * kind and generate separate listing for Classes, Interfaces, Exceptions and Errors.
  *
  * @param contentTree the content tree to which the listing will be added
  */
 protected void addClassListing(Content contentTree) {
   Configuration config = configuration;
   if (packageDoc.isIncluded()) {
     addClassKindListing(packageDoc.interfaces(), getResource("doclet.Interfaces"), contentTree);
     addClassKindListing(packageDoc.ordinaryClasses(), getResource("doclet.Classes"), contentTree);
     addClassKindListing(packageDoc.enums(), getResource("doclet.Enums"), contentTree);
     addClassKindListing(packageDoc.exceptions(), getResource("doclet.Exceptions"), contentTree);
     addClassKindListing(packageDoc.errors(), getResource("doclet.Errors"), contentTree);
     addClassKindListing(
         packageDoc.annotationTypes(), getResource("doclet.AnnotationTypes"), contentTree);
   } else {
     String name = Util.getPackageName(packageDoc);
     addClassKindListing(
         config.classDocCatalog.interfaces(name), getResource("doclet.Interfaces"), contentTree);
     addClassKindListing(
         config.classDocCatalog.ordinaryClasses(name), getResource("doclet.Classes"), contentTree);
     addClassKindListing(
         config.classDocCatalog.enums(name), getResource("doclet.Enums"), contentTree);
     addClassKindListing(
         config.classDocCatalog.exceptions(name), getResource("doclet.Exceptions"), contentTree);
     addClassKindListing(
         config.classDocCatalog.errors(name), getResource("doclet.Errors"), contentTree);
     addClassKindListing(
         config.classDocCatalog.annotationTypes(name),
         getResource("doclet.AnnotationTypes"),
         contentTree);
   }
 }
예제 #4
0
 /**
  * Add one line summary comment for the package.
  *
  * @param pkg the package to be documented
  * @param dlTree the content tree to which the description will be added
  */
 protected void addDescription(PackageDoc pkg, Content dlTree) {
   Content link = getPackageLink(pkg, new StringContent(Util.getPackageName(pkg)));
   Content dt = HtmlTree.DT(link);
   dt.addContent(" - ");
   dt.addContent(getResource("doclet.package"));
   dt.addContent(" " + pkg.name());
   dlTree.addContent(dt);
   Content dd = new HtmlTree(HtmlTag.DD);
   addSummaryComment(pkg, dd);
   dlTree.addContent(dd);
 }