package net.sourceforge.phpeclipse.wiki.renderer;
import java.io.IOException;
-import java.util.StringTokenizer;
import net.sourceforge.phpeclipse.wiki.editor.WikiEditor;
import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
-import net.sourceforge.phpeclipse.wiki.preferences.Util;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
protected abstract void initialise();
- protected void appendHeader() throws IOException {
- buffer.append("<html><head>");
+ protected void appendHeader(StringBuffer buf) throws IOException {
+ buf.append("<html><head>");
// String basePath = Util.getMiscProjectsPreferenceValue(fProject, WikiConstants.HTML_OUTPUT_PATH);
// buffer.append("<base href=\"" + basePath + "/" + fProject.getName() + "\"/>");
// }
// appendStyle();
- buffer.append("</head><body>\n");
+ buf.append("</head><body>\n");
}
private void appendContents() {
return lineNumber < editor.getDocument().getNumberOfLines();
}
- protected void appendFooter() {
- buffer.append("\n</body></html>");
+ protected void appendFooter(StringBuffer buf) {
+ buf.append("\n</body></html>");
}
// protected void appendStyle() throws IOException {
protected abstract boolean isHeader(String line);
- protected abstract void appendHeader(String line);
+// protected abstract void appendHeader(String line);
protected abstract boolean isList(String line);
return "<table>";
}
- public void forEachHeader(IDocument document, StructureClosure closure) throws BadLocationException {
- for (int i = 0; i < document.getNumberOfLines(); i++) {
- String line = getLine(document, i);
- if (isHeader(line)) {
- String header = getHeaderText(line);
- closure.acceptHeader(header, document.getLineOffset(i));
- }
- }
- }
+// public void forEachHeader(IDocument document, StructureClosure closure) throws BadLocationException {
+// for (int i = 0; i < document.getNumberOfLines(); i++) {
+// String line = getLine(document, i);
+// if (isHeader(line)) {
+// String header = getHeaderText(line);
+// closure.acceptHeader(header, document.getLineOffset(i));
+// }
+// }
+// }
/**
* Get the header from a line with header markup
* @param line
* guaranteed to be a valid header as defined by b {@link #isHeader(String) isHeader(String)}
*/
- protected abstract String getHeaderText(String line);
+// protected abstract String getHeaderText(String line);
/**
* @param project