KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > gui > dialog > DialogEdit


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2006 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.gui.dialog;
14
15 import info.magnolia.cms.gui.control.Edit;
16 import info.magnolia.cms.gui.misc.CssConstants;
17
18 import java.io.IOException JavaDoc;
19 import java.io.Writer JavaDoc;
20
21 import javax.jcr.PropertyType;
22
23
24 /**
25  * @author Vinzenz Wyser
26  * @version 2.0
27  */

28 public class DialogEdit extends DialogBox {
29
30     /**
31      * Empty constructor should only be used by DialogFactory.
32      */

33     protected DialogEdit() {
34     }
35
36     /**
37      * @see info.magnolia.cms.gui.dialog.DialogControl#drawHtml(Writer)
38      */

39     public void drawHtml(Writer JavaDoc out) throws IOException JavaDoc {
40         Edit control = new Edit(this.getName(), this.getValue());
41         control.setType(this.getConfigValue("type", PropertyType.TYPENAME_STRING)); //$NON-NLS-1$
42
if (this.getConfigValue("saveInfo").equals("false")) { //$NON-NLS-1$ //$NON-NLS-2$
43
control.setSaveInfo(false);
44         }
45         control.setCssClass(CssConstants.CSSCLASS_EDIT);
46         control.setRows(this.getConfigValue("rows", "1")); //$NON-NLS-1$ //$NON-NLS-2$
47
control.setCssStyles("width", this.getConfigValue("width", "100%")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
48
if (this.getConfigValue("onchange", null) != null) { //$NON-NLS-1$
49
control.setEvent("onchange", this.getConfigValue("onchange")); //$NON-NLS-1$ //$NON-NLS-2$
50
}
51         this.drawHtmlPre(out);
52         out.write(control.getHtml());
53         this.drawHtmlPost(out);
54     }
55
56 }
57
Popular Tags