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

PackageTreeWriter

public class PackageTreeWriter extends AbstractTreeWriter
Class to generate Tree page for a package. The name of the file generated is "package-tree.html" and it is generated in the respective package directory.
author
Atul M Dambalkar

Fields Summary
protected PackageDoc
packagedoc
Package for which tree is to be generated.
protected PackageDoc
prev
The previous package name in the alpha-order list.
protected PackageDoc
next
The next package name in the alpha-order list.
Constructors Summary
public PackageTreeWriter(String path, String filename, PackageDoc packagedoc, PackageDoc prev, PackageDoc next, boolean noDeprecated)
Constructor.

        super(path, filename, 
              new ClassTree(packagedoc.allClasses(), noDeprecated), packagedoc);
        this.packagedoc = packagedoc;
        this.prev = prev;
        this.next = next;
    
Methods Summary
public static voidgenerate(com.sun.javadoc.PackageDoc pkg, com.sun.javadoc.PackageDoc prev, com.sun.javadoc.PackageDoc next, boolean noDeprecated)
Construct a PackageTreeWriter object and then use it to generate the package tree page.

param
pkg Package for which tree file is to be generated.
param
prev Previous package in the alpha-ordered list.
param
next Next package in the alpha-ordered list.
param
noDeprecated If true, do not generate any information for deprecated classe or interfaces.

        PackageTreeWriter packgen;
        String path = DirectoryManager.getDirectoryPath(pkg);
        String filename = "package-tree.html";
        try {
            packgen = new PackageTreeWriter(path, filename, pkg, 
                                            prev, next, noDeprecated);
            packgen.generatePackageTreeFile();
            packgen.close();
        } catch (IOException exc) {
            Standard.configuration().standardmessage.
                error("doclet.exception_encountered", 
                       exc.toString(), filename);
            throw new DocletAbortException();
        }
    
protected voidgeneratePackageTreeFile()
Generate a separate tree file for each package.

        printHeader(getText("doclet.Window_Package_Class_Hierarchy", 
                             Standard.configuration().windowtitle,
                             packagedoc.name()));
        printPackageTreeHeader();

        if (Standard.configuration().packages.length > 1) {
            printLinkToMainTree();
        }

        generateTree(classtree.baseclasses(), "doclet.Class_Hierarchy"); 
        generateTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy"); 

        printPackageTreeFooter();
        printBottom();
        printBodyHtmlEnd();
    
protected voidnavLinkNext()
Link for the next package tree file.

        if (next == null) {
            navLinkNext(null);
        } else {
            String path = DirectoryManager.getRelativePath(packagedoc.name(),
                                                           next.name());
            navLinkNext(path + "package-tree.html");
        }
    
protected voidnavLinkPackage()
Link to the package summary page for the package of this tree.

        navCellStart();
        printHyperLink("package-summary.html", "", getText("doclet.Package"),
                        true, "NavBarFont1");
        navCellEnd();
    
protected voidnavLinkPrevious()
Link for the previous package tree file.

        if (prev == null) {
            navLinkPrevious(null);
        } else {
            String path = DirectoryManager.getRelativePath(packagedoc.name(),
                                                           prev.name());
            navLinkPrevious(path + "package-tree.html");
        }
    
protected voidprintLinkToMainTree()
Generate a link to the tree for all the packages.

        dl();
        dt();
        boldText("doclet.Package_Hierarchies");
        dd();
        navLinkMainTree(getText("doclet.All_Packages"));
        dlEnd();
        hr();
    
protected voidprintPackageTreeFooter()
Print the navigation bar footer for the package tree file.

        hr();
        navLinks(false);
    
protected voidprintPackageTreeHeader()
Print the navigation bar header for the package tree file.

        navLinks(true);
        hr();
        center();
        h2(getText("doclet.Hierarchy_For_Package", packagedoc.name()));
        centerEnd();