1) Added missing strings for italic, underline and strike through.
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.wiki / src / net / sourceforge / phpeclipse / wiki / renderer / AbstractContentRenderer.java
index 4c86952..88f36b1 100644 (file)
@@ -1,15 +1,11 @@
 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;
 
@@ -122,8 +118,8 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
 
   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() + "\"/>");
 
@@ -134,7 +130,7 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
     //    }
     //    appendStyle();
 
-    buffer.append("</head><body>\n");
+    buf.append("</head><body>\n");
   }
 
   private void appendContents() {
@@ -174,8 +170,8 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
     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 {
@@ -321,7 +317,7 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
 
   protected abstract boolean isHeader(String line);
 
-  protected abstract void appendHeader(String line);
+//  protected abstract void appendHeader(String line);
 
   protected abstract boolean isList(String line);
 
@@ -402,15 +398,15 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
     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
@@ -418,7 +414,7 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
    * @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