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

Sun, 11 Apr 2010 23:24:24 -0700

author
yhuang
date
Sun, 11 Apr 2010 23:24:24 -0700
changeset 539
06e06ec0d6f2
parent 243
edd944553131
child 554
9d9f26857129
permissions
-rw-r--r--

6875904: Java 7 message synchronization 1
Reviewed-by: ogino, faryad

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
bpatel@243 46 * @author Bhavesh Patel (Modified)
duke@1 47 */
duke@1 48 public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
duke@1 49
duke@1 50 public SubWriterHolderWriter(ConfigurationImpl configuration,
duke@1 51 String filename) throws IOException {
duke@1 52 super(configuration, filename);
duke@1 53 }
duke@1 54
duke@1 55
duke@1 56 public SubWriterHolderWriter(ConfigurationImpl configuration,
duke@1 57 String path, String filename, String relpath)
duke@1 58 throws IOException {
duke@1 59 super(configuration, path, filename, relpath);
duke@1 60 }
duke@1 61
duke@1 62 public void printTypeSummaryHeader() {
duke@1 63 tdIndex();
duke@1 64 font("-1");
duke@1 65 code();
duke@1 66 }
duke@1 67
duke@1 68 public void printTypeSummaryFooter() {
duke@1 69 codeEnd();
duke@1 70 fontEnd();
duke@1 71 tdEnd();
duke@1 72 }
duke@1 73
duke@1 74 public void printSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) {
duke@1 75 mw.printSummaryAnchor(cd);
bpatel@243 76 mw.printTableSummary();
bpatel@243 77 tableCaptionStart();
bpatel@243 78 mw.printSummaryLabel();
bpatel@243 79 tableCaptionEnd();
bpatel@243 80 mw.printSummaryTableHeader(cd);
duke@1 81 }
duke@1 82
duke@1 83 public void printTableHeadingBackground(String str) {
duke@1 84 tableIndexDetail();
duke@1 85 tableHeaderStart("#CCCCFF", 1);
bpatel@182 86 strong(str);
duke@1 87 tableHeaderEnd();
duke@1 88 tableEnd();
duke@1 89 }
duke@1 90
duke@1 91 public void printInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) {
duke@1 92 mw.printInheritedSummaryAnchor(cd);
duke@1 93 tableIndexSummary();
duke@1 94 tableInheritedHeaderStart("#EEEEFF");
duke@1 95 mw.printInheritedSummaryLabel(cd);
duke@1 96 tableInheritedHeaderEnd();
duke@1 97 trBgcolorStyle("white", "TableRowColor");
duke@1 98 summaryRow(0);
duke@1 99 code();
duke@1 100 }
duke@1 101
duke@1 102 public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
duke@1 103 tableEnd();
duke@1 104 space();
duke@1 105 }
duke@1 106
duke@1 107 public void printInheritedSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
duke@1 108 codeEnd();
duke@1 109 summaryRowEnd();
duke@1 110 trEnd();
duke@1 111 tableEnd();
duke@1 112 space();
duke@1 113 }
duke@1 114
duke@1 115 protected void printIndexComment(Doc member) {
duke@1 116 printIndexComment(member, member.firstSentenceTags());
duke@1 117 }
duke@1 118
duke@1 119 protected void printIndexComment(Doc member, Tag[] firstSentenceTags) {
duke@1 120 Tag[] deprs = member.tags("deprecated");
duke@1 121 if (Util.isDeprecated((ProgramElementDoc) member)) {
bpatel@182 122 strongText("doclet.Deprecated");
duke@1 123 space();
duke@1 124 if (deprs.length > 0) {
duke@1 125 printInlineDeprecatedComment(member, deprs[0]);
duke@1 126 }
duke@1 127 return;
duke@1 128 } else {
duke@1 129 ClassDoc cd = ((ProgramElementDoc)member).containingClass();
duke@1 130 if (cd != null && Util.isDeprecated(cd)) {
bpatel@182 131 strongText("doclet.Deprecated"); space();
duke@1 132 }
duke@1 133 }
duke@1 134 printSummaryComment(member, firstSentenceTags);
duke@1 135 }
duke@1 136
duke@1 137 public void printSummaryLinkType(AbstractMemberWriter mw,
duke@1 138 ProgramElementDoc member) {
duke@1 139 trBgcolorStyle("white", "TableRowColor");
duke@1 140 mw.printSummaryType(member);
duke@1 141 summaryRow(0);
duke@1 142 code();
duke@1 143 }
duke@1 144
duke@1 145 public void printSummaryLinkComment(AbstractMemberWriter mw,
duke@1 146 ProgramElementDoc member) {
duke@1 147 printSummaryLinkComment(mw, member, member.firstSentenceTags());
duke@1 148 }
duke@1 149
duke@1 150 public void printSummaryLinkComment(AbstractMemberWriter mw,
duke@1 151 ProgramElementDoc member,
duke@1 152 Tag[] firstSentenceTags) {
duke@1 153 codeEnd();
duke@1 154 println();
duke@1 155 br();
duke@1 156 printNbsps();
duke@1 157 printIndexComment(member, firstSentenceTags);
duke@1 158 summaryRowEnd();
duke@1 159 trEnd();
duke@1 160 }
duke@1 161
duke@1 162 public void printInheritedSummaryMember(AbstractMemberWriter mw, ClassDoc cd,
duke@1 163 ProgramElementDoc member, boolean isFirst) {
duke@1 164 if (! isFirst) {
duke@1 165 mw.print(", ");
duke@1 166 }
duke@1 167 mw.writeInheritedSummaryLink(cd, member);
duke@1 168 }
duke@1 169
duke@1 170 public void printMemberHeader() {
duke@1 171 hr();
duke@1 172 }
duke@1 173
duke@1 174 public void printMemberFooter() {
duke@1 175 }
duke@1 176
duke@1 177 }

mercurial