replaced DocFunction.getPrototype() with DocFunction.getDocPrototype() so that we can implement IPathElement

This commit is contained in:
stefanp 2002-03-07 14:18:20 +00:00
parent 8557f20d21
commit 8bc447ad05
2 changed files with 13 additions and 13 deletions

View file

@ -129,9 +129,9 @@ public class DocHtmlWriter extends PrintWriter {
StringBuffer buf = new StringBuffer (); StringBuffer buf = new StringBuffer ();
buf.append("<CODE><B>"); buf.append("<CODE><B>");
if ( DocRun.getOption("-f").equals("true") ) if ( DocRun.getOption("-f").equals("true") )
buf.append("<a href=\"" + func.getPrototype().getName().toLowerCase()+"/"+func.getDocFileName() + "\">" ); buf.append("<a href=\"" + func.getDocPrototype().getName().toLowerCase()+"/"+func.getDocFileName() + "\">" );
if ( func.isMacro() ) { if ( func.isMacro() ) {
buf.append( func.getPrototype().getName()+"."+func.getName().substring(0,func.getName().length()-6) ); buf.append( func.getDocPrototype().getName()+"."+func.getName().substring(0,func.getName().length()-6) );
} else { } else {
buf.append(func.getName().trim()); buf.append(func.getName().trim());
if( func.isTemplate() || func.isFunction() ) { if( func.isTemplate() || func.isFunction() ) {
@ -161,9 +161,9 @@ public class DocHtmlWriter extends PrintWriter {
String name = tag.getName(); String name = tag.getName();
switch (kind) { switch (kind) {
case DocTag.ARG: case DocTag.ARG:
return( "<b>arg" + i + ":</b> " + text ); return( "<b>Argument " + i + ":</b> " + text );
case DocTag.PARAM: case DocTag.PARAM:
return( "<b>" + name + "</b> " + text ); return( "<b>Parameter " + name + "</b> " + text );
case DocTag.RETURNS: case DocTag.RETURNS:
case DocTag.AUTHOR: case DocTag.AUTHOR:
case DocTag.VERSION: case DocTag.VERSION:
@ -178,7 +178,7 @@ public class DocHtmlWriter extends PrintWriter {
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
StringTokenizer tok = new StringTokenizer (text.trim(),"."); StringTokenizer tok = new StringTokenizer (text.trim(),".");
if ( tok.countTokens()==0 ) return text; if ( tok.countTokens()==0 ) return text;
DocPrototype dp = app.getPrototype( tok.nextToken() ); DocPrototype dp = app.getDocPrototype( tok.nextToken() );
if ( dp==null ) return text; if ( dp==null ) return text;
buf.append("<a href=\"" ); buf.append("<a href=\"" );
DocFunction df = null; DocFunction df = null;
@ -240,7 +240,7 @@ public class DocHtmlWriter extends PrintWriter {
print ( "</DL><h2>" + name.substring(0,1).toUpperCase() + "</h2><dl>"); print ( "</DL><h2>" + name.substring(0,1).toUpperCase() + "</h2><dl>");
curChar = name.substring(0,1).toLowerCase(); curChar = name.substring(0,1).toLowerCase();
} }
print("<DT><a href=\"" + link(dl[i]) + "\">" + dl[i].getName() + "</a> - " + dl[i].getTypeName() + " in <a href=\"" + link(dl[i].getPrototype()) + "\">" + dl[i].getPrototype().getName() + "</a>" ); print("<DT><a href=\"" + link(dl[i]) + "\">" + dl[i].getName() + "</a> - " + dl[i].getTypeName() + " in <a href=\"" + link(dl[i].getDocPrototype()) + "\">" + dl[i].getDocPrototype().getName() + "</a>" );
} }
print("</DL>"); print("</DL>");
} }
@ -249,7 +249,7 @@ public class DocHtmlWriter extends PrintWriter {
if ( pt.getName().equalsIgnoreCase("hopobject") ) if ( pt.getName().equalsIgnoreCase("hopobject") )
return; return;
DocApplication app = pt.getApplication(); DocApplication app = pt.getApplication();
DocPrototype hopobject = (DocPrototype)app.getPrototype("hopobject"); DocPrototype hopobject = (DocPrototype)app.getDocPrototype("hopobject");
if ( hopobject==null || hopobject.countFunctions()==0 ) if ( hopobject==null || hopobject.countFunctions()==0 )
return; return;
print("<TABLE BORDER=1 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>"); print("<TABLE BORDER=1 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>");
@ -283,7 +283,7 @@ public class DocHtmlWriter extends PrintWriter {
} }
public void printFunction(DocFunction func) { public void printFunction(DocFunction func) {
print( "<br><br><small><i>in " + func.getPrototype().getName() + "/" + (new File(func.getLocation())).getName() + ":</i></small>" ); print( "<br><br><small><i>in " + func.getDocPrototype().getName() + "/" + (new File(func.getLocation())).getName() + ":</i></small>" );
print( "<br><pre>"); print( "<br><pre>");
print( HtmlEncoder.encodeAll(func.getSource()) ); print( HtmlEncoder.encodeAll(func.getSource()) );
print( "</pre>" ); print( "</pre>" );
@ -318,7 +318,7 @@ public class DocHtmlWriter extends PrintWriter {
return "prototype_" + docEl.getName() + ".html"; return "prototype_" + docEl.getName() + ".html";
} else if ( docEl.isMethod() ) { } else if ( docEl.isMethod() ) {
DocFunction df = (DocFunction)docEl; DocFunction df = (DocFunction)docEl;
return "prototype_" + df.getPrototype().getName() + ".html#" + df.getName(); return "prototype_" + df.getDocPrototype().getName() + ".html#" + df.getName();
} else { } else {
return ""; return "";
} }

View file

@ -111,12 +111,12 @@ public class DocWriter extends DocHtmlWriter {
DocFunction[] df = app.listFunctions(); DocFunction[] df = app.listFunctions();
for ( int i=0;i<df.length; i++ ) { for ( int i=0;i<df.length; i++ ) {
try { try {
File d = new File ( docDir, df[i].getPrototype().getName().toLowerCase() ); File d = new File ( docDir, df[i].getDocPrototype().getName().toLowerCase() );
if ( !d.exists() ) if ( !d.exists() )
d.mkdir(); d.mkdir();
DocWriter dw = new DocWriter( df[i].getPrototype().getName().toLowerCase() + "/" + df[i].getDocFileName() ); DocWriter dw = new DocWriter( df[i].getDocPrototype().getName().toLowerCase() + "/" + df[i].getDocFileName() );
dw.printHeader( app.getName() + "." + df[i].getPrototype().getName() + "." + df[i].getName() ); dw.printHeader( app.getName() + "." + df[i].getDocPrototype().getName() + "." + df[i].getName() );
dw.printNavBar( app.getName(), df[i].getPrototype(), DocHtmlWriter.METHOD); dw.printNavBar( app.getName(), df[i].getDocPrototype(), DocHtmlWriter.METHOD);
dw.printFunction( df[i] ); dw.printFunction( df[i] );
dw.close(); dw.close();
} catch ( FileNotFoundException e ) { DocRun.log( e.getMessage() ); } } catch ( FileNotFoundException e ) { DocRun.log( e.getMessage() ); }