1 17 18 19 20 package org.apache.fop.render.rtf.rtflib.rtfdoc; 21 22 28 29 import java.io.Writer ; 30 import java.util.Iterator ; 31 import java.io.IOException ; 32 33 36 public class RtfJforCmd extends RtfContainer { 37 38 private static final String PARA_KEEP_ON = "para-keep:on"; 39 private static final String PARA_KEEP_OFF = "para-keep:off"; 40 41 private final RtfAttributes attrib; 42 private ParagraphKeeptogetherContext paragraphKeeptogetherContext; 43 44 45 46 RtfJforCmd(RtfContainer parent, Writer w, RtfAttributes attrs) throws IOException { 47 super((RtfContainer)parent, w); 48 attrib = attrs; 49 paragraphKeeptogetherContext = ParagraphKeeptogetherContext.getInstance(); 50 } 51 52 53 57 public boolean isEmpty() { 58 return true; 59 } 60 61 65 public void process() { 66 for (Iterator it = attrib.nameIterator(); it.hasNext();) { 67 final String cmd = (String )it.next(); 68 69 if (cmd.equals(PARA_KEEP_ON)) { 70 ParagraphKeeptogetherContext.keepTogetherOpen(); 71 } else if (cmd.equals(PARA_KEEP_OFF)) { 72 ParagraphKeeptogetherContext.keepTogetherClose(); 73 } else { 74 } 77 78 } 79 80 81 } 82 83 } 84 | Popular Tags |