001: /*
002: * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.tools.doclets.formats.html;
027:
028: import com.sun.javadoc.*;
029: import com.sun.tools.doclets.internal.toolkit.util.*;
030:
031: import java.io.*;
032:
033: /**
034: * This abstract class exists to provide functionality needed in the
035: * the formatting of member information. Since AbstractSubWriter and its
036: * subclasses control this, they would be the logical place to put this.
037: * However, because each member type has its own subclass, subclassing
038: * can not be used effectively to change formatting. The concrete
039: * class subclass of this class can be subclassed to change formatting.
040: *
041: * @see AbstractMemberWriter
042: * @see ClassWriterImpl
043: *
044: * @author Robert Field
045: * @author Atul M Dambalkar
046: */
047: public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
048:
049: public SubWriterHolderWriter(ConfigurationImpl configuration,
050: String filename) throws IOException {
051: super (configuration, filename);
052: }
053:
054: public SubWriterHolderWriter(ConfigurationImpl configuration,
055: String path, String filename, String relpath)
056: throws IOException {
057: super (configuration, path, filename, relpath);
058: }
059:
060: public void printTypeSummaryHeader() {
061: tdIndex();
062: font("-1");
063: code();
064: }
065:
066: public void printTypeSummaryFooter() {
067: codeEnd();
068: fontEnd();
069: tdEnd();
070: }
071:
072: public void printSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) {
073: mw.printSummaryAnchor(cd);
074: tableIndexSummary();
075: tableHeaderStart("#CCCCFF");
076: mw.printSummaryLabel(cd);
077: tableHeaderEnd();
078: }
079:
080: public void printTableHeadingBackground(String str) {
081: tableIndexDetail();
082: tableHeaderStart("#CCCCFF", 1);
083: bold(str);
084: tableHeaderEnd();
085: tableEnd();
086: }
087:
088: public void printInheritedSummaryHeader(AbstractMemberWriter mw,
089: ClassDoc cd) {
090: mw.printInheritedSummaryAnchor(cd);
091: tableIndexSummary();
092: tableInheritedHeaderStart("#EEEEFF");
093: mw.printInheritedSummaryLabel(cd);
094: tableInheritedHeaderEnd();
095: trBgcolorStyle("white", "TableRowColor");
096: summaryRow(0);
097: code();
098: }
099:
100: public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
101: tableEnd();
102: space();
103: }
104:
105: public void printInheritedSummaryFooter(AbstractMemberWriter mw,
106: ClassDoc cd) {
107: codeEnd();
108: summaryRowEnd();
109: trEnd();
110: tableEnd();
111: space();
112: }
113:
114: protected void printIndexComment(Doc member) {
115: printIndexComment(member, member.firstSentenceTags());
116: }
117:
118: protected void printIndexComment(Doc member, Tag[] firstSentenceTags) {
119: Tag[] deprs = member.tags("deprecated");
120: if (Util.isDeprecated((ProgramElementDoc) member)) {
121: boldText("doclet.Deprecated");
122: space();
123: if (deprs.length > 0) {
124: printInlineDeprecatedComment(member, deprs[0]);
125: }
126: return;
127: } else {
128: ClassDoc cd = ((ProgramElementDoc) member)
129: .containingClass();
130: if (cd != null && Util.isDeprecated(cd)) {
131: boldText("doclet.Deprecated");
132: space();
133: }
134: }
135: printSummaryComment(member, firstSentenceTags);
136: }
137:
138: public void printSummaryLinkType(AbstractMemberWriter mw,
139: ProgramElementDoc member) {
140: trBgcolorStyle("white", "TableRowColor");
141: mw.printSummaryType(member);
142: summaryRow(0);
143: code();
144: }
145:
146: public void printSummaryLinkComment(AbstractMemberWriter mw,
147: ProgramElementDoc member) {
148: printSummaryLinkComment(mw, member, member.firstSentenceTags());
149: }
150:
151: public void printSummaryLinkComment(AbstractMemberWriter mw,
152: ProgramElementDoc member, Tag[] firstSentenceTags) {
153: codeEnd();
154: println();
155: br();
156: printNbsps();
157: printIndexComment(member, firstSentenceTags);
158: summaryRowEnd();
159: trEnd();
160: }
161:
162: public void printInheritedSummaryMember(AbstractMemberWriter mw,
163: ClassDoc cd, ProgramElementDoc member, boolean isFirst) {
164: if (!isFirst) {
165: mw.print(", ");
166: }
167: mw.writeInheritedSummaryLink(cd, member);
168: }
169:
170: public void printMemberHeader() {
171: hr();
172: }
173:
174: public void printMemberFooter() {
175: }
176:
177: }
|