1 5 package net.mlw.vlh.web.tag.support; 6 7 import net.mlw.vlh.ValueListInfo; 8 9 14 public abstract class AbstractHTMLDisplayProvider implements DisplayProvider 15 { 16 17 public boolean doesIncludeBodyContent() 18 { 19 return true; 20 } 21 22 28 public String emphase(String text, String emphasisPattern, String style) 29 { 30 if (emphasisPattern == null) 31 return text; 32 33 StringBuffer replacement = new StringBuffer ("<span class='" + style + "Emphase'>"); 34 replacement.append(emphasisPattern); 35 replacement.append("</span>"); 36 return text.replaceAll(emphasisPattern, replacement.toString()); 37 } 38 39 44 public String getHeaderRowPostProcess() 45 { 46 return "</tr>"; 47 } 48 49 54 public String getHeaderRowPreProcess() 55 { 56 return "\n<tr>"; 57 } 58 59 public String getMimeType() 60 { 61 return null; 62 } 63 64 public String getRowPostProcess() 65 { 66 return "</tr>"; 67 } 68 69 public String getRowPreProcess(Attributes attributes) 70 { 71 return (attributes == null) ? "\n<tr>" : "\n<tr " + attributes.getCellAttributesAsString() + ">"; 72 } 73 74 public String getNestedHeaderPreProcess(ColumnInfo columnInfo, ValueListInfo info) 75 { 76 return (columnInfo.getAttributes() == null) ? "<table width=\"100%\">" : "<table width=\"100%\" " + columnInfo.getAttributes() + ">"; 77 } 78 79 public String getNestedHeaderPostProcess() 80 { 81 return "</table>"; 82 } 83 } 84 | Popular Tags |