1 13 package info.magnolia.cms.gui.dialog; 14 15 import info.magnolia.cms.gui.control.ControlImpl; 16 import info.magnolia.cms.gui.control.Password; 17 import info.magnolia.cms.gui.misc.CssConstants; 18 19 import java.io.IOException ; 20 import java.io.Writer ; 21 22 import org.apache.commons.lang.StringUtils; 23 24 25 29 public class DialogPassword extends DialogBox { 30 31 34 protected DialogPassword() { 35 } 36 37 40 public void drawHtml(Writer out) throws IOException { 41 Password control = new Password(this.getName(), this.getValue()); 42 if (this.getConfigValue("saveInfo").equals("false")) { control.setSaveInfo(false); 44 } 45 control.setCssClass(CssConstants.CSSCLASS_EDIT); 46 control.setCssStyles("width", this.getConfigValue("width", "100%")); control.setEncoding(ControlImpl.ENCODING_BASE64); 48 if (this.getConfigValue("onchange", null) != null) { control.setEvent("onchange", this.getConfigValue("onchange")); } 51 this.drawHtmlPre(out); 52 out.write(control.getHtml()); 53 if (this.getConfigValue("verification", "true").equals("true")) { Password control2 = new Password(this.getName() + "_verification", StringUtils.EMPTY); control2.setSaveInfo(false); 58 control2.setCssClass(CssConstants.CSSCLASS_EDIT); 59 control2.setCssStyles("width", this.getConfigValue("width", "100%")); control2.setEvent("onchange", "mgnlDialogPasswordVerify('" + this.getName() + "')"); out.write("<div class=\"" + CssConstants.CSSCLASS_DESCRIPTION 66 + "\">" + getMessage("dialog.password.verify") + "</div>"); out.write(control2.getHtml()); 70 } 71 this.drawHtmlPost(out); 72 } 73 } 74 | Popular Tags |