1 52 53 package com.lowagie.text.rtf; 54 55 import java.io.IOException ; 56 import java.io.OutputStream ; 57 58 import com.lowagie.text.Chunk; 59 import com.lowagie.text.Font; 60 import com.lowagie.text.rtf.document.RtfDocument; 61 62 72 public abstract class RtfAddableElement extends Chunk implements RtfBasicElement { 73 74 77 protected RtfDocument doc = null; 78 81 protected boolean inTable = false; 82 85 protected boolean inHeader = false; 86 87 91 public RtfAddableElement() { 92 super("", new Font()); 93 } 94 95 100 public abstract byte[] write(); 101 102 106 public void writeContent(OutputStream out) throws IOException 107 { 108 byte[] content = write(); 109 out.write(content); 110 } 111 112 115 public void setRtfDocument(RtfDocument doc) { 116 this.doc = doc; 117 } 118 119 122 public void setInTable(boolean inTable) { 123 this.inTable = inTable; 124 } 125 126 129 public void setInHeader(boolean inHeader) { 130 this.inHeader = inHeader; 131 } 132 133 140 public byte[] intToByteArray(int i) { 141 return Integer.toString(i).getBytes(); 142 } 143 144 147 public boolean isEmpty() { 148 return false; 149 } 150 } 151 | Popular Tags |