home *** CD-ROM | disk | FTP | other *** search
/ Internet News 1999 October / INEWS_10_CD.ISO / pc / jdk / jdk1.2.2 / docs / tooldocs / javadoc / source / standard / PackageIndexFrameWriter.java < prev    next >
Encoding:
Java Source  |  1999-09-19  |  4.1 KB  |  151 lines

  1. /*
  2.  * @(#)PackageIndexFrameWriter.java    1.12 98/08/18
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package com.sun.tools.doclets.standard;
  16.  
  17. import com.sun.tools.doclets.*;
  18. import com.sun.javadoc.*;
  19. import java.io.*;
  20. import java.lang.*;
  21. import java.util.*;
  22.  
  23. /**
  24.  * Generate the package index for the left-hand frame in the generated output.
  25.  * A click on the package name in this frame will update the page in the bottom
  26.  * left hand frame with the listing of contents of the clicked package.
  27.  *
  28.  * @author Atul M Dambalkar 
  29.  */
  30. public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
  31.  
  32.     /**
  33.      * Construct the PackageIndexFrameWriter object. 
  34.      *
  35.      * @param filename Name of the package index file to be generated.
  36.      */ 
  37.     public PackageIndexFrameWriter(String filename) throws IOException {
  38.         super(filename);
  39.     }
  40.  
  41.     /**
  42.      * Generate the package index file named "overview-frame.html".
  43.      */
  44.     public static void generate() throws DocletAbortException {
  45.         PackageIndexFrameWriter packgen;
  46.         String filename = "overview-frame.html";
  47.         try {
  48.             packgen = new PackageIndexFrameWriter(filename);
  49.             packgen.generatePackageIndexFile();
  50.             packgen.close();
  51.         } catch (IOException exc) {
  52.  Standard.configuration().standardmessage.error("doclet.exception_encountered", 
  53.                                                  exc.toString(), filename);
  54.             throw new DocletAbortException();
  55.         }
  56.     }
  57.  
  58.     /**
  59.      * Print each package name on separate rows.
  60.      *
  61.      * @param pd PackageDoc 
  62.      */
  63.     protected void printIndexRow(PackageDoc pd) {
  64.         fontStyle("FrameItemFont");
  65.         printTargetHyperLink(pathString(pd, "package-frame.html"), 
  66.                              "packageFrame", pd.name());
  67.         fontEnd();
  68.         br();
  69.     }
  70.  
  71.     /**
  72.      * Print the "-header" in bold format, at top of the page. There is 
  73.      * actually no navigation bar for this page.
  74.      */
  75.     protected void printNavigationBarHeader() {
  76.         if (Standard.configuration().header != null) {
  77.             printTableHeader();
  78.             fontSizeStyle("+1", "FrameTitleFont");
  79.             bold(Standard.configuration().header);
  80.             fontEnd();
  81.             printTableFooter();
  82.         }
  83.     }
  84.  
  85.     /**
  86.      * Do nothing as there is no overview information in this page.
  87.      */
  88.     protected void printOverviewHeader() {
  89.     }
  90.  
  91.     /**
  92.      * Print Html "table" tag for the package index format.
  93.      * 
  94.      * @param text Text string will not be used in this method.
  95.      */
  96.     protected void printIndexHeader(String text) {
  97.         printTableHeader();
  98.     }
  99.  
  100.     /**
  101.      * Print Html closing "table" tag at the end of the package index.
  102.      */   
  103.     protected void printIndexFooter() {
  104.         printTableFooter();
  105.     }
  106.  
  107.     /**
  108.      * Print "All Classes" link at the top of the left-hand frame page.
  109.      */
  110.     protected void printAllClassesPackagesLink() {
  111.         fontStyle("FrameItemFont");
  112.         printTargetHyperLink("allclasses-frame.html", "packageFrame", 
  113.                               getText("doclet.All_Classes"));
  114.         fontEnd();
  115.         p();
  116.         fontSizeStyle("+1", "FrameHeadingFont");
  117.         printText("doclet.Packages");
  118.         fontEnd();
  119.         br();
  120.     }
  121.  
  122.     /**
  123.      * Just print some space, since there is no navigation bar for this page.
  124.      */
  125.     protected void printNavigationBarFooter() {
  126.         p();
  127.         space();
  128.     }
  129.  
  130.     /**
  131.      * Print Html closing tags for the table for package index.
  132.      */
  133.     protected void printTableFooter() {
  134.         tdEnd();
  135.         trEnd();
  136.         tableEnd();
  137.     }
  138.  
  139.     /**
  140.      * Print Html tags for the table for package index.
  141.      */
  142.     protected void printTableHeader() {
  143.         table();
  144.         tr();
  145.         tdNowrap();
  146.     }
  147. }
  148.  
  149.  
  150.  
  151.