package jdiff; import java.util.*; import java.io.*; /** * Emit HTML files for the supporting infrastructure for the HTML report. * Examples are stylesheets, help files, frame files. * * See the file LICENSE.txt for copyright details. * @author Matthew Doar, mdoar@pobox.com */ public class HTMLFiles { /** Constructor. */ public HTMLFiles(HTMLReportGenerator h) { h_ = h; } /** The HTMLReportGenerator instance used to write HTML. */ private HTMLReportGenerator h_ = null; /** * Emit the top-level changes.html frames file where everything starts. */ public void emitTopLevelFile(String tln, APIDiff apiDiff) { try { FileOutputStream fos = new FileOutputStream(tln); h_.reportFile = new PrintWriter(fos); // Write out the HTML header h_.writeStartHTMLHeaderWithDate(); // Write out the title String oldAPIName = "Old API"; if (apiDiff.oldAPIName_ != null) oldAPIName = apiDiff.oldAPIName_; String newAPIName = "New API"; if (apiDiff.newAPIName_ != null) newAPIName = apiDiff.newAPIName_; if (h_.windowTitle == null) h_.writeHTMLTitle("API Differences between " + oldAPIName + " and " + newAPIName); else h_.writeHTMLTitle(h_.windowTitle); // Note that the stylesheet is in the same directory h_.writeStyleSheetRef(true); h_.writeText(""); // Note that the top-level frame file doesn't have the BODY tag h_.writeText("
"); h_.writeText("");
h_.writeText("This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.");
h_.writeText("
");
h_.writeText("Link to Non-frame version.");
h_.writeText("