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 / PackagesFileWriter.java < prev    next >
Encoding:
Java Source  |  1999-09-19  |  2.3 KB  |  85 lines

  1. /*
  2.  * @(#)PackagesFileWriter.java    1.1 98/08/06
  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 java.io.*;
  19. import java.lang.*;
  20. import java.util.*;
  21.  
  22. /**
  23.  * Generate the "packages.html" file for the backward compatibility.
  24.  *
  25.  * @author Atul M Dambalkar
  26.  */
  27. public class PackagesFileWriter extends HtmlStandardWriter {
  28.  
  29.     /**
  30.      * Constructor.
  31.      */
  32.     public PackagesFileWriter(String filename) throws IOException {
  33.         super(filename);
  34.     }
  35.  
  36.     /**
  37.      * Generate the file.
  38.      */
  39.     public static void generate() throws DocletAbortException {
  40.         PackagesFileWriter packgen;
  41.         String filename = "";
  42.         try {
  43.             filename = "packages.html";
  44.             packgen = new PackagesFileWriter(filename);
  45.             packgen.generatePackagesFile();
  46.             packgen.close();
  47.         } catch (IOException exc) {
  48.             Standard.configuration().standardmessage.error(
  49.                 "doclet.exception_encountered",
  50.                 exc.toString(), filename);
  51.             throw new DocletAbortException();
  52.         }
  53.     }
  54.  
  55.     /**
  56.      * Generate the packages file.
  57.      */
  58.     protected void generatePackagesFile() {
  59.         printHeader(getText("doclet.Window_Packages_title",
  60.                             Standard.configuration().windowtitle));
  61.  
  62.         printPackagesFileContents();
  63.  
  64.         printBodyHtmlEnd();
  65.     }
  66.  
  67.     /**
  68.      * Print the pacakges file contents.
  69.      */
  70.     protected void printPackagesFileContents() {
  71.         br(); br(); br();
  72.         center(); 
  73.         printText("doclet.Packages_File_line_1"); 
  74.         printText("doclet.Packages_File_line_2");
  75.         br(); printNbsps();
  76.         printHyperLink("index.html", getText("doclet.Frame_Version"));
  77.         br(); printNbsps();
  78.         printHyperLink(Standard.configuration().topFile,
  79.                        getText("doclet.Non_Frame_Version"));
  80.         centerEnd();
  81.     }
  82.  
  83. }
  84.  
  85.