/[classpath]/gjdoc/src/gnu/classpath/tools/doclets/htmldoclet/HtmlPage.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/doclets/htmldoclet/HtmlPage.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by julian, Mon May 23 20:43:15 2005 UTC revision 1.18 by julian, Mon May 23 21:54:09 2005 UTC
# Line 52  public class HtmlPage Line 52  public class HtmlPage
52     private PrintWriter out;     private PrintWriter out;
53     private String pathToRoot;     private String pathToRoot;
54     private String docType;     private String docType;
55       private String baseUrl;
56       private File rootDir;
57    
58     public static final String DOCTYPE_FRAMESET = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">";     public static final String DOCTYPE_FRAMESET = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">";
59    
60     public HtmlPage(File file, String pathToRoot, String encoding)     public HtmlPage(File file, String pathToRoot, String encoding, String baseUrl, File rootDir)
61        throws IOException        throws IOException
62     {     {
63        this(file, pathToRoot, encoding, "<!DOCTYPE html PUBLIC \"-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN\" \"" + pathToRoot + "/resources/xhtml11-target10.dtd\">");        this(file, pathToRoot, encoding, baseUrl, rootDir, "<!DOCTYPE html PUBLIC \"-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN\" \"" + pathToRoot + "/resources/xhtml11-target10.dtd\">");
64     }     }
65    
66     public HtmlPage(File file, String pathToRoot, String encoding, String docType)     public HtmlPage(File file, String pathToRoot, String encoding, String baseUrl, File rootDir, String docType)
67        throws IOException        throws IOException
68     {     {
69        this.file = file;        this.file = file;
# Line 77  public class HtmlPage Line 79  public class HtmlPage
79        this.out = new PrintWriter(new BufferedWriter(writer));        this.out = new PrintWriter(new BufferedWriter(writer));
80        this.pathToRoot = pathToRoot;        this.pathToRoot = pathToRoot;
81        this.docType = docType;        this.docType = docType;
82          this.baseUrl = baseUrl;
83          this.rootDir = rootDir;
84     }     }
85    
86     public void beginElement(String elementName)     public void beginElement(String elementName)
# Line 266  public class HtmlPage Line 270  public class HtmlPage
270     }     }
271    
272     public void beginPage(String title, String charset, Map stylesheets)     public void beginPage(String title, String charset, Map stylesheets)
273          throws IOException
274     {     {
275        beginPage(title, charset, Collections.EMPTY_SET, stylesheets);        beginPage(title, charset, Collections.EMPTY_SET, stylesheets);
276     }     }
277    
278     public void beginPage(String title, String charset,     public void beginPage(String title, String charset,
279                           Collection keywords, Map stylesheets)                           Collection keywords, Map stylesheets)
280          throws IOException
281     {     {
282        print("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\n");        print("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\n");
283        print(docType);        print(docType);
# Line 280  public class HtmlPage Line 286  public class HtmlPage
286        beginElement("title");        beginElement("title");
287        print(title);        print(title);
288        endElement("title");        endElement("title");
289          if (null != baseUrl && baseUrl.length() > 0) {
290             StringBuffer url = new StringBuffer();
291             url.append(baseUrl);
292             if ('/' == url.charAt(url.length() - 1)) {
293                url.delete(url.length() - 1, url.length());
294             }
295             url.append(file.getCanonicalPath().substring(rootDir.getCanonicalPath().length()));
296             atomicElement("base",
297                           new String[] { "href" },
298                           new String[] { url.toString() });
299          }
300        beginElement("script",        beginElement("script",
301                      new String[] { "src", "type" },                      new String[] { "src", "type" },
302                      new String[] { pathToRoot + "/resources/gjdoc.js", "text/javascript" });                      new String[] { pathToRoot + "/resources/gjdoc.js", "text/javascript" });

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26