1 17 18 19 20 21 package org.apache.fop.render.rtf.rtflib.rtfdoc; 22 23 import java.io.Writer ; 25 import java.io.IOException ; 26 27 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun; 29 30 34 public class RtfFootnote extends RtfContainer 35 implements IRtfTextrunContainer, IRtfListContainer { 36 RtfTextrun textrunInline = null; 37 RtfContainer body = null; 38 RtfList list = null; 39 boolean bBody = false; 40 41 42 RtfFootnote(RtfContainer parent, Writer w) throws IOException { 43 super(parent, w); 44 textrunInline = new RtfTextrun(this, writer, null); 45 body = new RtfContainer(this, writer); 46 } 47 48 public RtfTextrun getTextrun() throws IOException { 49 if (bBody) { 50 RtfTextrun textrun = RtfTextrun.getTextrun(body, writer, null); 51 textrun.setSuppressLastPar(true); 52 53 return textrun; 54 } else { 55 return textrunInline; 56 } 57 } 58 59 63 protected void writeRtfContent() throws IOException { 64 textrunInline.writeRtfContent(); 65 66 writeGroupMark(true); 67 writeControlWord("footnote"); 68 writeControlWord("ftnalt"); 69 70 body.writeRtfContent(); 71 72 writeGroupMark(false); 73 } 74 75 public RtfList newList(RtfAttributes attrs) throws IOException { 76 if (list != null) { 77 list.close(); 78 } 79 80 list = new RtfList(body, writer, attrs); 81 82 return list; 83 } 84 85 public void startBody() { 86 bBody = true; 87 } 88 89 public void endBody() { 90 bBody = false; 91 } 92 } 93 | Popular Tags |