1 13 package info.magnolia.cms.gui.dialog; 14 15 import info.magnolia.cms.gui.misc.CssConstants; 16 17 import org.apache.commons.lang.StringUtils; 18 19 20 24 public class DialogLine { 25 26 29 protected DialogLine() { 30 } 31 32 public String getHtml() { 33 return this.getHtml(0, 2, 0); 34 } 35 36 public String getHtml(int colspanLine) { 37 return this.getHtml(0, colspanLine, 0); 38 } 39 40 public String getHtml(int colspanBeforeLine, int colspanLine) { 41 return this.getHtml(colspanBeforeLine, colspanLine, 0); 42 } 43 44 public String getHtml(int colspanBeforeLine, int colspanLine, int colspanAfterLine) { 45 String pre = StringUtils.EMPTY; 46 String post = StringUtils.EMPTY; 47 if (colspanBeforeLine != 0) { 48 pre = "<td colspan=\"" + colspanBeforeLine + "\"></td>"; } 50 if (colspanAfterLine != 0) { 51 pre = "<td colspan=\"" + colspanAfterLine + "\"></td>"; } 53 return "<tr>" + pre 55 + "<td colspan=\"" + colspanLine 57 + "\" class=\"" + CssConstants.CSSCLASS_BOXLINE 59 + "\"></td>" + post 61 + "</tr>"; } 63 64 public String getHtml(String width) { 65 StringBuffer html = new StringBuffer (); 66 html.append("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:" + width + ";\">"); html.append(this.getHtml(1)); 68 html.append("</table>"); return html.toString(); 70 } 71 } 72 | Popular Tags |