Source Code Cross Referenced for AllClassesFrameWriter.java in  » 6.0-JDK-Modules-com.sun » tools » com » sun » tools » doclets » formats » html » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules com.sun » tools » com.sun.tools.doclets.formats.html 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 1998-2003 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.tools.doclets.internal.toolkit.util.*;
029:        import com.sun.javadoc.*;
030:        import java.io.*;
031:        import java.util.*;
032:
033:        /**
034:         * Generate the file with list of all the classes in this run. This page will be
035:         * used in the left-hand bottom frame, when "All Classes" link is clicked in
036:         * the left-hand top frame. The name of the generated file is
037:         * "allclasses-frame.html".
038:         *
039:         * @author Atul M Dambalkar
040:         * @author Doug Kramer
041:         */
042:        public class AllClassesFrameWriter extends HtmlDocletWriter {
043:
044:            /**
045:             * The name of the output file with frames
046:             */
047:            public static final String OUTPUT_FILE_NAME_FRAMES = "allclasses-frame.html";
048:
049:            /**
050:             * The name of the output file without frames
051:             */
052:            public static final String OUTPUT_FILE_NAME_NOFRAMES = "allclasses-noframe.html";
053:
054:            /**
055:             * Index of all the classes.
056:             */
057:            protected IndexBuilder indexbuilder;
058:
059:            /**
060:             * Construct AllClassesFrameWriter object. Also initilises the indexbuilder
061:             * variable in this class.
062:             * @throws IOException
063:             * @throws DocletAbortException
064:             */
065:            public AllClassesFrameWriter(ConfigurationImpl configuration,
066:                    String filename, IndexBuilder indexbuilder)
067:                    throws IOException {
068:                super (configuration, filename);
069:                this .indexbuilder = indexbuilder;
070:            }
071:
072:            /**
073:             * Create AllClassesFrameWriter object. Then use it to generate the
074:             * "allclasses-frame.html" file. Generate the file in the current or the
075:             * destination directory.
076:             *
077:             * @param indexbuilder IndexBuilder object for all classes index.
078:             * @throws DocletAbortException
079:             */
080:            public static void generate(ConfigurationImpl configuration,
081:                    IndexBuilder indexbuilder) {
082:                AllClassesFrameWriter allclassgen;
083:                String filename = OUTPUT_FILE_NAME_FRAMES;
084:                try {
085:                    allclassgen = new AllClassesFrameWriter(configuration,
086:                            filename, indexbuilder);
087:                    allclassgen.generateAllClassesFile(true);
088:                    allclassgen.close();
089:                    filename = OUTPUT_FILE_NAME_NOFRAMES;
090:                    allclassgen = new AllClassesFrameWriter(configuration,
091:                            filename, indexbuilder);
092:                    allclassgen.generateAllClassesFile(false);
093:                    allclassgen.close();
094:                } catch (IOException exc) {
095:                    configuration.standardmessage.error(
096:                            "doclet.exception_encountered", exc.toString(),
097:                            filename);
098:                    throw new DocletAbortException();
099:                }
100:            }
101:
102:            /**
103:             * Print all the classes in table format in the file.
104:             * @param wantFrames True if we want frames.
105:             */
106:            protected void generateAllClassesFile(boolean wantFrames)
107:                    throws IOException {
108:                String label = configuration.getText("doclet.All_Classes");
109:
110:                printHtmlHeader(label, null, false);
111:
112:                printAllClassesTableHeader();
113:                printAllClasses(wantFrames);
114:                printAllClassesTableFooter();
115:
116:                printBodyHtmlEnd();
117:            }
118:
119:            /**
120:             * Use the sorted index of all the classes and print all the classes.
121:             *
122:             * @param wantFrames True if we want frames.
123:             */
124:            protected void printAllClasses(boolean wantFrames) {
125:                for (int i = 0; i < indexbuilder.elements().length; i++) {
126:                    Character unicode = (Character) ((indexbuilder.elements())[i]);
127:                    generateContents(indexbuilder.getMemberList(unicode),
128:                            wantFrames);
129:                }
130:            }
131:
132:            /**
133:             * Given a list of classes, generate links for each class or interface.
134:             * If the class kind is interface, print it in the italics font. Also all
135:             * links should target the right-hand frame. If clicked on any class name
136:             * in this page, appropriate class page should get opened in the right-hand
137:             * frame.
138:             *
139:             * @param classlist Sorted list of classes.
140:             * @param wantFrames True if we want frames.
141:             */
142:            protected void generateContents(List classlist, boolean wantFrames) {
143:                for (int i = 0; i < classlist.size(); i++) {
144:                    ClassDoc cd = (ClassDoc) (classlist.get(i));
145:                    if (!Util.isCoreClass(cd)) {
146:                        continue;
147:                    }
148:                    String label = italicsClassName(cd, false);
149:                    if (wantFrames) {
150:                        printLink(new LinkInfoImpl(
151:                                LinkInfoImpl.ALL_CLASSES_FRAME, cd, label,
152:                                "classFrame"));
153:                    } else {
154:                        printLink(new LinkInfoImpl(cd, label));
155:                    }
156:                    br();
157:                }
158:            }
159:
160:            /**
161:             * Print the heading "All Classes" and also print Html table tag.
162:             */
163:            protected void printAllClassesTableHeader() {
164:                fontSizeStyle("+1", "FrameHeadingFont");
165:                boldText("doclet.All_Classes");
166:                fontEnd();
167:                br();
168:                table();
169:                tr();
170:                tdNowrap();
171:                fontStyle("FrameItemFont");
172:            }
173:
174:            /**
175:             * Print Html closing table tag.
176:             */
177:            protected void printAllClassesTableFooter() {
178:                fontEnd();
179:                tdEnd();
180:                trEnd();
181:                tableEnd();
182:            }
183:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.