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 import java.util.Date ; 32 import java.util.Random ; 33 34 40 public class RtfList extends RtfContainer { 41 private RtfListItem item; 42 private RtfListTable listTable; 43 private final boolean hasTableParent; 44 private RtfListStyle defaultListStyle; 45 private Integer listTemplateId = null; 46 private Integer listId = null; 47 private static Random listIdGenerator = new Random (0); 48 49 50 RtfList(RtfContainer parent, Writer w, RtfAttributes attr) throws IOException { 51 super((RtfContainer)parent, w, attr); 52 53 listId = new Integer (listIdGenerator.nextInt()); 55 listTemplateId = new Integer (listIdGenerator.nextInt()); 56 57 listTable = getRtfFile().startListTable(attr); 59 listTable.addList(this); 60 61 hasTableParent = this.getParentOfClass(RtfTable.class) != null; 63 64 this.setRtfListStyle(new RtfListStyleBullet()); 65 } 66 67 72 public RtfListItem newListItem() throws IOException { 73 if (item != null) { 74 item.close(); 75 } 76 item = new RtfListItem(this, writer); 77 return item; 78 } 79 80 84 public Integer getListId() { 85 return listId; 86 } 87 88 92 public Integer getListTemplateId() { 93 return listTemplateId; 94 } 95 96 100 public void setRtfListStyle(RtfListStyle ls) { 101 defaultListStyle = ls; 102 } 103 104 108 public RtfListStyle getRtfListStyle() { 109 return defaultListStyle; 110 } 111 112 116 public boolean getHasTableParent() { 117 return hasTableParent; 118 } 119 } | Popular Tags |