1 52 53 package com.lowagie.text.rtf.text; 54 55 import java.io.ByteArrayOutputStream ; 56 import java.io.IOException ; 57 import java.io.OutputStream ; 58 import java.util.ArrayList ; 59 60 import com.lowagie.text.rtf.RtfAddableElement; 61 62 79 public class RtfTabGroup extends RtfAddableElement { 80 83 private ArrayList tabs = null; 84 85 88 public RtfTabGroup() { 89 this.tabs = new ArrayList (); 90 } 91 92 97 public RtfTabGroup(ArrayList tabs) { 98 this.tabs = new ArrayList (); 99 for(int i = 0; i < tabs.size(); i++) { 100 if(tabs.get(i) instanceof RtfTab) { 101 this.tabs.add(tabs.get(i)); 102 } 103 } 104 } 105 106 111 public void add(RtfTab tab) { 112 this.tabs.add(tab); 113 } 114 115 120 public byte[] write() 121 { 122 ByteArrayOutputStream result = new ByteArrayOutputStream (); 123 try { 124 writeContent(result); 125 } catch(IOException ioe) { 126 ioe.printStackTrace(); 127 } 128 return result.toByteArray(); 129 } 130 133 public void writeContent(final OutputStream result) throws IOException 134 { 135 for(int i = 0; i < this.tabs.size(); i++) { 136 RtfTab rt = (RtfTab) this.tabs.get(i); 137 rt.writeContent(result); 139 } 140 } 141 142 } 143 | Popular Tags |