FileDocCategorySizeDatePackage
PackageFrameWriter.javaAPI DocExample5392Wed Apr 19 11:17:12 BST 2000com.sun.tools.doclets.standard

PackageFrameWriter

public class PackageFrameWriter extends AbstractPackageWriter
Class to generate file for each package contents in the left-hand bottom frame. This will list all the Class Kinds in the package. A click on any class-kind will update the right-hand frame with the clicked class-kind page.
author
Atul M Dambalkar

Fields Summary
Constructors Summary
public PackageFrameWriter(String path, String filename, PackageDoc packagedoc)
Constructor to construct PackageFrameWriter object and to generate "package-frame.html" file in the respective package directory. For example for package "java.lang" this will generate file "package-frame.html" file in the "java/lang" directory. It will also create "java/lang" directory in the current or the destination directory if it doesen't exist.

param
path Directories in this path will be created if they are not already there.
param
filename Name of the package summary file to be generated, "package-frame.html".
param
packagedoc PackageDoc under consideration.

        super(path, filename, packagedoc);
    
Methods Summary
public static voidgenerate(com.sun.javadoc.PackageDoc pkg)
Generate a package summary page for the left-hand bottom frame. Construct the PackageFrameWriter object and then uses it generate the file.

param
pkg The package for which "pacakge-frame.html" is to be generated.

        PackageFrameWriter packgen;
        String path = DirectoryManager.getDirectoryPath(pkg);
        String filename = "package-frame" + ".html";
        try {
            packgen = new PackageFrameWriter(path, filename, pkg);
            packgen.generatePackageFile();
            packgen.close();
        } catch (IOException exc) {
            Standard.configuration().standardmessage.
                    error("doclet.exception_encountered", 
                           exc.toString(), filename);
            throw new DocletAbortException();
        }
    
protected voidgenerateClassKindListing(com.sun.javadoc.ClassDoc[] arr, java.lang.String label)
Generate 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
label Label for the listing

        if(arr.length > 0) {
            Arrays.sort(arr);    
            printPackageTableHeader();
            fontSizeStyle("+1", "FrameHeadingFont");
            print(label);
            fontEnd();
            println(" ");
            fontStyle("FrameItemFont");
            for (int i = 0; i < arr.length; i++) {
                if (!Util.isCoreClass(arr[i]) || !isGeneratedDoc(arr[i])) {
                    continue;
                }
                br();
                printTargetClassLink(arr[i], "classFrame");
            }
            fontEnd();
            printPackageTableFooter();
            println();
        }
    
protected voidgenerateClassListing()
Generate 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.

        generateClassKindListing(packagedoc.interfaces(), 
                                 getText("doclet.Interfaces"));
        generateClassKindListing(packagedoc.ordinaryClasses(),
                                 getText("doclet.Classes"));
        generateClassKindListing(packagedoc.exceptions(),
                                 getText("doclet.Exceptions"));
        generateClassKindListing(packagedoc.errors(),
                                 getText("doclet.Errors"));
    
protected voidprintPackageDescription()
Do nothing. Package Description is not generted in this page.

    
protected voidprintPackageFooter()
Do nothing. No footer is generated for this page.

        
    
protected voidprintPackageHeader(java.lang.String heading)
Print the package link at the top of the class kind listing. Clicking this link, package-summary page will appear in the right hand frame.

param
heading Top Heading to be used for the class kind listing.

        fontSizeStyle("+1", "FrameTitleFont");
        printTargetPackageLink(packagedoc, "classFrame", heading);
        fontEnd();
    
protected voidprintPackageTableFooter()
Closing Html tags for table of class kind listing.

        tdEnd();
        trEnd();
        tableEnd();
    
protected voidprintPackageTableHeader()
The table for the class kind listing.

        table();
        tr();
        tdNowrap();