src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java

Thu, 02 Oct 2008 19:58:40 -0700

author
xdono
date
Thu, 02 Oct 2008 19:58:40 -0700
changeset 117
24a47c3062fe
parent 1
9a66ca7c79fa
child 182
47a62d8d98b4
permissions
-rw-r--r--

6754988: Update copyright year
Summary: Update for files that have been modified starting July 2008
Reviewed-by: ohair, tbell

duke@1 1 /*
duke@1 2 * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation. Sun designates this
duke@1 8 * particular file as subject to the "Classpath" exception as provided
duke@1 9 * by Sun in the LICENSE file that accompanied this code.
duke@1 10 *
duke@1 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 * accompanied this code).
duke@1 16 *
duke@1 17 * You should have received a copy of the GNU General Public License version
duke@1 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 *
duke@1 21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@1 22 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@1 23 * have any questions.
duke@1 24 */
duke@1 25
duke@1 26 package com.sun.tools.doclets.formats.html;
duke@1 27
duke@1 28 import com.sun.javadoc.*;
duke@1 29 import com.sun.tools.doclets.internal.toolkit.util.*;
duke@1 30
duke@1 31 import java.io.*;
duke@1 32
duke@1 33 /**
duke@1 34 * This abstract class exists to provide functionality needed in the
duke@1 35 * the formatting of member information. Since AbstractSubWriter and its
duke@1 36 * subclasses control this, they would be the logical place to put this.
duke@1 37 * However, because each member type has its own subclass, subclassing
duke@1 38 * can not be used effectively to change formatting. The concrete
duke@1 39 * class subclass of this class can be subclassed to change formatting.
duke@1 40 *
duke@1 41 * @see AbstractMemberWriter
duke@1 42 * @see ClassWriterImpl
duke@1 43 *
duke@1 44 * @author Robert Field
duke@1 45 * @author Atul M Dambalkar
duke@1 46 */
duke@1 47 public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
duke@1 48
duke@1 49 public SubWriterHolderWriter(ConfigurationImpl configuration,
duke@1 50 String filename) throws IOException {
duke@1 51 super(configuration, filename);
duke@1 52 }
duke@1 53
duke@1 54
duke@1 55 public SubWriterHolderWriter(ConfigurationImpl configuration,
duke@1 56 String path, String filename, String relpath)
duke@1 57 throws IOException {
duke@1 58 super(configuration, path, filename, relpath);
duke@1 59 }
duke@1 60
duke@1 61 public void printTypeSummaryHeader() {
duke@1 62 tdIndex();
duke@1 63 font("-1");
duke@1 64 code();
duke@1 65 }
duke@1 66
duke@1 67 public void printTypeSummaryFooter() {
duke@1 68 codeEnd();
duke@1 69 fontEnd();
duke@1 70 tdEnd();
duke@1 71 }
duke@1 72
duke@1 73 public void printSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) {
duke@1 74 mw.printSummaryAnchor(cd);
duke@1 75 tableIndexSummary();
duke@1 76 tableHeaderStart("#CCCCFF");
duke@1 77 mw.printSummaryLabel(cd);
duke@1 78 tableHeaderEnd();
duke@1 79 }
duke@1 80
duke@1 81 public void printTableHeadingBackground(String str) {
duke@1 82 tableIndexDetail();
duke@1 83 tableHeaderStart("#CCCCFF", 1);
duke@1 84 bold(str);
duke@1 85 tableHeaderEnd();
duke@1 86 tableEnd();
duke@1 87 }
duke@1 88
duke@1 89 public void printInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) {
duke@1 90 mw.printInheritedSummaryAnchor(cd);
duke@1 91 tableIndexSummary();
duke@1 92 tableInheritedHeaderStart("#EEEEFF");
duke@1 93 mw.printInheritedSummaryLabel(cd);
duke@1 94 tableInheritedHeaderEnd();
duke@1 95 trBgcolorStyle("white", "TableRowColor");
duke@1 96 summaryRow(0);
duke@1 97 code();
duke@1 98 }
duke@1 99
duke@1 100 public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
duke@1 101 tableEnd();
duke@1 102 space();
duke@1 103 }
duke@1 104
duke@1 105 public void printInheritedSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
duke@1 106 codeEnd();
duke@1 107 summaryRowEnd();
duke@1 108 trEnd();
duke@1 109 tableEnd();
duke@1 110 space();
duke@1 111 }
duke@1 112
duke@1 113 protected void printIndexComment(Doc member) {
duke@1 114 printIndexComment(member, member.firstSentenceTags());
duke@1 115 }
duke@1 116
duke@1 117 protected void printIndexComment(Doc member, Tag[] firstSentenceTags) {
duke@1 118 Tag[] deprs = member.tags("deprecated");
duke@1 119 if (Util.isDeprecated((ProgramElementDoc) member)) {
duke@1 120 boldText("doclet.Deprecated");
duke@1 121 space();
duke@1 122 if (deprs.length > 0) {
duke@1 123 printInlineDeprecatedComment(member, deprs[0]);
duke@1 124 }
duke@1 125 return;
duke@1 126 } else {
duke@1 127 ClassDoc cd = ((ProgramElementDoc)member).containingClass();
duke@1 128 if (cd != null && Util.isDeprecated(cd)) {
duke@1 129 boldText("doclet.Deprecated"); space();
duke@1 130 }
duke@1 131 }
duke@1 132 printSummaryComment(member, firstSentenceTags);
duke@1 133 }
duke@1 134
duke@1 135 public void printSummaryLinkType(AbstractMemberWriter mw,
duke@1 136 ProgramElementDoc member) {
duke@1 137 trBgcolorStyle("white", "TableRowColor");
duke@1 138 mw.printSummaryType(member);
duke@1 139 summaryRow(0);
duke@1 140 code();
duke@1 141 }
duke@1 142
duke@1 143 public void printSummaryLinkComment(AbstractMemberWriter mw,
duke@1 144 ProgramElementDoc member) {
duke@1 145 printSummaryLinkComment(mw, member, member.firstSentenceTags());
duke@1 146 }
duke@1 147
duke@1 148 public void printSummaryLinkComment(AbstractMemberWriter mw,
duke@1 149 ProgramElementDoc member,
duke@1 150 Tag[] firstSentenceTags) {
duke@1 151 codeEnd();
duke@1 152 println();
duke@1 153 br();
duke@1 154 printNbsps();
duke@1 155 printIndexComment(member, firstSentenceTags);
duke@1 156 summaryRowEnd();
duke@1 157 trEnd();
duke@1 158 }
duke@1 159
duke@1 160 public void printInheritedSummaryMember(AbstractMemberWriter mw, ClassDoc cd,
duke@1 161 ProgramElementDoc member, boolean isFirst) {
duke@1 162 if (! isFirst) {
duke@1 163 mw.print(", ");
duke@1 164 }
duke@1 165 mw.writeInheritedSummaryLink(cd, member);
duke@1 166 }
duke@1 167
duke@1 168 public void printMemberHeader() {
duke@1 169 hr();
duke@1 170 }
duke@1 171
duke@1 172 public void printMemberFooter() {
duke@1 173 }
duke@1 174
duke@1 175 }

mercurial