KickJava   Java API By Example, From Geeks To Geeks.

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


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.Button;
16
17 import java.io.IOException JavaDoc;
18 import java.io.Writer JavaDoc;
19
20
21 /**
22  * @author Vinzenz Wyser
23  * @version 2.0
24  */

25 public class DialogButton extends DialogBox {
26
27     /**
28      * Empty constructor should only be used by DialogFactory.
29      */

30     protected DialogButton() {
31     }
32
33     /**
34      * @see info.magnolia.cms.gui.dialog.DialogControl#drawHtml(Writer)
35      */

36     public void drawHtml(Writer JavaDoc out) throws IOException JavaDoc {
37         Button control = new Button();
38         String JavaDoc label = getConfigValue("buttonLabel"); //$NON-NLS-1$
39
label = this.getMessage(label);
40         control.setSaveInfo(false);
41         control.setLabel(label);
42         control.setOnclick(this.getConfigValue("onclick")); //$NON-NLS-1$
43
if (this.getConfigValue("small").equals("true")) { //$NON-NLS-1$ //$NON-NLS-2$
44
control.setSmall(true);
45         }
46         this.drawHtmlPre(out);
47         out.write(control.getHtml());
48         this.drawHtmlPost(out);
49     }
50 }
51
Popular Tags