1 51 package org.apache.fop.fo.flow; 52 53 import org.apache.fop.fo.*; 55 import org.apache.fop.layout.*; 56 import org.apache.fop.apps.FOPException; 57 58 public class ListItemLabel extends FObj { 59 60 public static class Maker extends FObj.Maker { 61 public FObj make(FObj parent, PropertyList propertyList, 62 String systemId, int line, int column) 63 throws FOPException { 64 return new ListItemLabel(parent, propertyList, 65 systemId, line, column); 66 } 67 68 } 69 70 public static FObj.Maker maker() { 71 return new ListItemLabel.Maker(); 72 } 73 74 public ListItemLabel(FObj parent, PropertyList propertyList, 75 String systemId, int line, int column) { 76 super(parent, propertyList, systemId, line, column); 77 } 78 79 public String getName() { 80 return "fo:list-item-label"; 81 } 82 83 public int layout(Area area) throws FOPException { 84 int numChildren = this.children.size(); 85 86 if (numChildren != 1) { 87 throw new FOPException("list-item-label must have exactly one block in this version of FOP", systemId, line, column); 88 } 89 90 AccessibilityProps mAccProps = propMgr.getAccessibilityProps(); 92 93 96 String id = this.properties.get("id").getString(); 98 try { 99 area.getIDReferences().initializeID(id, area); 100 } 101 catch(FOPException e) { 102 if (!e.isLocationSet()) { 103 e.setLocation(systemId, line, column); 104 } 105 throw e; 106 } 107 108 Block block = (Block)children.get(0); 109 110 116 117 int status; 118 status = block.layout(area); 119 area.addDisplaySpace(-block.getAreaHeight()); 120 return status; 121 } 122 123 } 124 | Popular Tags |