1 17 18 19 20 package org.apache.fop.render.rtf.rtflib.rtfdoc; 21 22 28 29 import java.io.Writer ; 30 import java.io.IOException ; 31 32 35 public class RtfParagraphKeepTogether extends RtfContainer { 36 37 38 public static final int STATUS_NULL = 0; 39 40 public static final int STATUS_OPEN_PARAGRAPH = 1; 41 42 public static final int STATUS_CLOSE_PARAGRAPH = 2; 43 44 private int status = STATUS_NULL; 45 46 47 48 RtfParagraphKeepTogether(IRtfParagraphContainer parent, Writer w) throws IOException { 49 super((RtfContainer)parent, w); 50 } 51 52 56 protected void writeRtfContent() throws IOException { 57 58 if (status == STATUS_OPEN_PARAGRAPH) { 61 writeControlWord("pard"); 62 writeControlWord("par"); 63 writeControlWord("keepn"); 64 writeGroupMark(true); 65 status = STATUS_NULL; 66 } 67 68 69 if (status == STATUS_CLOSE_PARAGRAPH) { 70 writeGroupMark(false); 71 status = STATUS_NULL; 72 } 73 74 } 75 76 77 81 public void setStatus(int status) { 82 this.status = status; 83 } 84 85 88 public boolean isEmpty() { 89 return false; 90 } 91 92 } 93 | Popular Tags |