1 13 package info.magnolia.cms.gui.control; 14 15 import info.magnolia.cms.core.Content; 16 17 18 22 public class Edit extends ControlImpl { 23 24 String rows = "1"; 26 public Edit() { 27 } 28 29 public Edit(String name, String value) { 30 super(name, value); 31 } 32 33 public Edit(String name, Content websiteNode) { 34 super(name, websiteNode); 35 } 36 37 public void setRows(String s) { 38 this.rows = s; 39 } 40 41 public String getRows() { 42 return this.rows; 43 } 44 45 public String getHtml() { 46 StringBuffer html = new StringBuffer (); 47 String id = this.getId(); 48 if (id == null) { 49 id = this.getName(); 50 } 51 if (this.getRows().equals("1")) { html.append("<input type=\"text\""); html.append(" name=\"" + this.getName() + "\""); html.append(" id=\"" + id + "\""); html.append(" value=\"" + ControlImpl.escapeHTML(this.getValue()) + "\""); html.append(getHtmlEvents()); 57 html.append(this.getHtmlCssClass()); 58 html.append(this.getHtmlCssStyles()); 59 html.append(" />"); } 61 else { 62 html.append("<textarea"); html.append(" name=\"" + this.getName() + "\""); html.append(" id=\"" + id + "\""); html.append(" rows=\"" + this.getRows() + "\""); html.append(this.getHtmlCssClass()); 67 html.append(this.getHtmlCssStyles()); 68 html.append(getHtmlEvents()); 69 html.append(">"); html.append(this.getValue()); 71 html.append("</textarea>"); } 73 if (this.getSaveInfo()) { 74 html.append(this.getHtmlSaveInfo()); 75 } 76 return html.toString(); 77 } 78 } 79 | Popular Tags |