94 /** |
92 /** |
95 * Generate the constants in the "index.html" file. Print the frame details |
93 * Generate the constants in the "index.html" file. Print the frame details |
96 * as well as warning if browser is not supporting the Html frames. |
94 * as well as warning if browser is not supporting the Html frames. |
97 */ |
95 */ |
98 protected void generateFrameFile() throws IOException { |
96 protected void generateFrameFile() throws IOException { |
99 Content frameset = getFrameDetails(); |
97 Content frame = getFrameDetails(); |
|
98 HtmlTree body = new HtmlTree(HtmlTag.BODY); |
|
99 body.addContent(frame); |
100 if (configuration.windowtitle.length() > 0) { |
100 if (configuration.windowtitle.length() > 0) { |
101 printFramesetDocument(configuration.windowtitle, configuration.notimestamp, |
101 printFramesDocument(configuration.windowtitle, configuration, |
102 frameset); |
102 body); |
103 } else { |
103 } else { |
104 printFramesetDocument(configuration.getText("doclet.Generated_Docs_Untitled"), |
104 printFramesDocument(configuration.getText("doclet.Generated_Docs_Untitled"), |
105 configuration.notimestamp, frameset); |
105 configuration, body); |
106 } |
106 } |
107 } |
|
108 |
|
109 /** |
|
110 * Add the code for issueing the warning for a non-frame capable web |
|
111 * client. Also provide links to the non-frame version documentation. |
|
112 * |
|
113 * @param contentTree the content tree to which the non-frames information will be added |
|
114 */ |
|
115 protected void addFrameWarning(Content contentTree) { |
|
116 Content noframes = new HtmlTree(HtmlTag.NOFRAMES); |
|
117 Content noScript = HtmlTree.NOSCRIPT( |
|
118 HtmlTree.DIV(getResource("doclet.No_Script_Message"))); |
|
119 noframes.addContent(noScript); |
|
120 Content noframesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
|
121 getResource("doclet.Frame_Alert")); |
|
122 noframes.addContent(noframesHead); |
|
123 Content p = HtmlTree.P(getResource("doclet.Frame_Warning_Message", |
|
124 getHyperLink(configuration.topFile, |
|
125 configuration.getText("doclet.Non_Frame_Version")))); |
|
126 noframes.addContent(p); |
|
127 contentTree.addContent(noframes); |
|
128 } |
107 } |
129 |
108 |
130 /** |
109 /** |
131 * Get the frame sizes and their contents. |
110 * Get the frame sizes and their contents. |
132 * |
111 * |
133 * @return a content tree for the frame details |
112 * @return a content tree for the frame details |
134 */ |
113 */ |
135 protected Content getFrameDetails() { |
114 protected Content getFrameDetails() { |
136 HtmlTree frameset = HtmlTree.FRAMESET("20%,80%", null, "Documentation frame", |
115 HtmlTree leftContainerDiv = new HtmlTree(HtmlTag.DIV); |
137 "top.loadFrames()"); |
116 HtmlTree rightContainerDiv = new HtmlTree(HtmlTag.DIV); |
|
117 leftContainerDiv.addStyle(HtmlStyle.leftContainer); |
|
118 rightContainerDiv.addStyle(HtmlStyle.rightContainer); |
138 if (noOfPackages <= 1) { |
119 if (noOfPackages <= 1) { |
139 addAllClassesFrameTag(frameset); |
120 addAllClassesFrameTag(leftContainerDiv); |
140 } else if (noOfPackages > 1) { |
121 } else if (noOfPackages > 1) { |
141 HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames", |
122 addAllPackagesFrameTag(leftContainerDiv); |
142 "top.loadFrames()"); |
123 addAllClassesFrameTag(leftContainerDiv); |
143 addAllPackagesFrameTag(leftFrameset); |
|
144 addAllClassesFrameTag(leftFrameset); |
|
145 frameset.addContent(leftFrameset); |
|
146 } |
124 } |
147 addClassFrameTag(frameset); |
125 addClassFrameTag(rightContainerDiv); |
148 addFrameWarning(frameset); |
126 HtmlTree mainContainer = HtmlTree.DIV(HtmlStyle.mainContainer, leftContainerDiv); |
149 return frameset; |
127 mainContainer.addContent(rightContainerDiv); |
|
128 return mainContainer; |
150 } |
129 } |
151 |
130 |
152 /** |
131 /** |
153 * Add the FRAME tag for the frame that lists all packages. |
132 * Add the IFRAME tag for the frame that lists all packages. |
154 * |
133 * |
155 * @param contentTree the content tree to which the information will be added |
134 * @param contentTree the content tree to which the information will be added |
156 */ |
135 */ |
157 private void addAllPackagesFrameTag(Content contentTree) { |
136 private void addAllPackagesFrameTag(Content contentTree) { |
158 HtmlTree frame = HtmlTree.FRAME(DocPaths.OVERVIEW_FRAME.getPath(), |
137 HtmlTree frame = HtmlTree.IFRAME(DocPaths.OVERVIEW_FRAME.getPath(), |
159 "packageListFrame", configuration.getText("doclet.All_Packages")); |
138 "packageListFrame", configuration.getText("doclet.All_Packages")); |
160 contentTree.addContent(frame); |
139 HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame); |
|
140 contentTree.addContent(leftTop); |
161 } |
141 } |
162 |
142 |
163 /** |
143 /** |
164 * Add the FRAME tag for the frame that lists all classes. |
144 * Add the IFRAME tag for the frame that lists all classes. |
165 * |
145 * |
166 * @param contentTree the content tree to which the information will be added |
146 * @param contentTree the content tree to which the information will be added |
167 */ |
147 */ |
168 private void addAllClassesFrameTag(Content contentTree) { |
148 private void addAllClassesFrameTag(Content contentTree) { |
169 HtmlTree frame = HtmlTree.FRAME(DocPaths.ALLCLASSES_FRAME.getPath(), |
149 HtmlTree frame = HtmlTree.IFRAME(DocPaths.ALLCLASSES_FRAME.getPath(), |
170 "packageFrame", configuration.getText("doclet.All_classes_and_interfaces")); |
150 "packageFrame", configuration.getText("doclet.All_classes_and_interfaces")); |
171 contentTree.addContent(frame); |
151 HtmlTree leftBottom = HtmlTree.DIV(HtmlStyle.leftBottom, frame); |
|
152 contentTree.addContent(leftBottom); |
172 } |
153 } |
173 |
154 |
174 /** |
155 /** |
175 * Add the FRAME tag for the frame that describes the class in detail. |
156 * Add the IFRAME tag for the frame that describes the class in detail. |
176 * |
157 * |
177 * @param contentTree the content tree to which the information will be added |
158 * @param contentTree the content tree to which the information will be added |
178 */ |
159 */ |
179 private void addClassFrameTag(Content contentTree) { |
160 private void addClassFrameTag(Content contentTree) { |
180 HtmlTree frame = HtmlTree.FRAME(configuration.topFile.getPath(), "classFrame", |
161 HtmlTree frame = HtmlTree.IFRAME(configuration.topFile.getPath(), "classFrame", |
181 configuration.getText("doclet.Package_class_and_interface_descriptions"), |
162 configuration.getText("doclet.Package_class_and_interface_descriptions")); |
182 SCROLL_YES); |
163 frame.addStyle(HtmlStyle.rightIframe); |
183 contentTree.addContent(frame); |
164 contentTree.addContent(frame); |
184 } |
165 } |
185 } |
166 } |