Sat, 01 Dec 2007 00:00:00 +0000
Initial load
1 /*
2 * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
26 package com.sun.tools.doclets.formats.html;
28 import com.sun.tools.doclets.internal.toolkit.util.*;
30 import java.io.*;
32 /**
33 * Writes the style sheet for the doclet output.
34 *
35 * @author Atul M Dambalkar
36 */
37 public class StylesheetWriter extends HtmlDocletWriter {
39 /**
40 * Constructor.
41 */
42 public StylesheetWriter(ConfigurationImpl configuration,
43 String filename) throws IOException {
44 super(configuration, filename);
45 }
47 /**
48 * Generate the style file contents.
49 * @throws DocletAbortException
50 */
51 public static void generate(ConfigurationImpl configuration) {
52 StylesheetWriter stylegen;
53 String filename = "";
54 try {
55 filename = "stylesheet.css";
56 stylegen = new StylesheetWriter(configuration, filename);
57 stylegen.generateStyleFile();
58 stylegen.close();
59 } catch (IOException exc) {
60 configuration.standardmessage.error(
61 "doclet.exception_encountered",
62 exc.toString(), filename);
63 throw new DocletAbortException();
64 }
65 }
67 /**
68 * Generate the style file contents.
69 */
70 protected void generateStyleFile() {
71 print("/* "); printText("doclet.Style_line_1"); println(" */");
72 println("");
74 print("/* "); printText("doclet.Style_line_2"); println(" */");
75 println("");
77 print("/* "); printText("doclet.Style_line_3"); println(" */");
78 println("body { background-color: #FFFFFF; color:#000000 }");
79 println("");
81 print("/* "); printText("doclet.Style_Headings"); println(" */");
82 println("h1 { font-size: 145% }");
83 println("");
85 print("/* "); printText("doclet.Style_line_4"); println(" */");
86 print(".TableHeadingColor { background: #CCCCFF; color:#000000 }");
87 print(" /* "); printText("doclet.Style_line_5"); println(" */");
88 print(".TableSubHeadingColor { background: #EEEEFF; color:#000000 }");
89 print(" /* "); printText("doclet.Style_line_6"); println(" */");
90 print(".TableRowColor { background: #FFFFFF; color:#000000 }");
91 print(" /* "); printText("doclet.Style_line_7"); println(" */");
92 println("");
94 print("/* "); printText("doclet.Style_line_8"); println(" */");
95 println(".FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
96 println(".FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
97 println(".FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
98 println("");
100 // Removed doclet.Style_line_9 as no longer needed
102 print("/* "); printText("doclet.Style_line_10"); println(" */");
103 print(".NavBarCell1 { background-color:#EEEEFF; color:#000000}");
104 print(" /* "); printText("doclet.Style_line_6"); println(" */");
105 print(".NavBarCell1Rev { background-color:#00008B; color:#FFFFFF}");
106 print(" /* "); printText("doclet.Style_line_11"); println(" */");
108 print(".NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;");
109 println("color:#000000;}");
110 print(".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;");
111 println("color:#FFFFFF;}");
112 println("");
114 print(".NavBarCell2 { font-family: Arial, Helvetica, sans-serif; ");
115 println("background-color:#FFFFFF; color:#000000}");
116 print(".NavBarCell3 { font-family: Arial, Helvetica, sans-serif; ");
117 println("background-color:#FFFFFF; color:#000000}");
118 println("");
120 }
122 }