KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > tools > modules > CmsModulesEditParameters


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/modules/CmsModulesEditParameters.java,v $
3  * Date : $Date: 2005/06/23 11:11:38 $
4  * Version: $Revision: 1.5 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.workplace.tools.modules;
33
34 import org.opencms.jsp.CmsJspActionElement;
35 import org.opencms.widgets.CmsInputWidget;
36 import org.opencms.workplace.CmsWidgetDialogParameter;
37
38 import javax.servlet.http.HttpServletRequest JavaDoc;
39 import javax.servlet.http.HttpServletResponse JavaDoc;
40 import javax.servlet.jsp.PageContext JavaDoc;
41
42 /**
43  * Edit class to edit module parameters.<p>
44  *
45  * @author Michael Emmerich
46  *
47  * @version $Revision: 1.5 $
48  *
49  * @since 6.0.0
50  */

51 public class CmsModulesEditParameters extends CmsModulesEditBase {
52
53     /**
54      * Public constructor with JSP action element.<p>
55      *
56      * @param jsp an initialized JSP action element
57      */

58     public CmsModulesEditParameters(CmsJspActionElement jsp) {
59
60         super(jsp);
61     }
62
63     /**
64      * Public constructor with JSP variables.<p>
65      *
66      * @param context the JSP page context
67      * @param req the JSP request
68      * @param res the JSP response
69      */

70     public CmsModulesEditParameters(PageContext JavaDoc context, HttpServletRequest JavaDoc req, HttpServletResponse JavaDoc res) {
71
72         this(new CmsJspActionElement(context, req, res));
73     }
74
75     /**
76      * Creates the dialog HTML for all defined widgets of the named dialog (page).<p>
77      *
78      * @param dialog the dialog (page) to get the HTML for
79      * @return the dialog HTML for all defined widgets of the named dialog (page)
80      */

81     protected String JavaDoc createDialogHtml(String JavaDoc dialog) {
82
83         StringBuffer JavaDoc result = new StringBuffer JavaDoc(1024);
84
85         // create table
86
result.append(createWidgetTableStart());
87
88         // show error header once if there were validation errors
89
result.append(createWidgetErrorHeader());
90
91         if (dialog.equals(PAGES[0])) {
92             result.append(dialogBlockStart(key("label.parameter")));
93             result.append(createWidgetTableStart());
94             result.append(createDialogRowsHtml(0, 0));
95             result.append(createWidgetTableEnd());
96             result.append(dialogBlockEnd());
97         }
98         // close table
99
result.append(createWidgetTableEnd());
100
101         return result.toString();
102     }
103
104     /**
105      * Creates the list of widgets for this dialog.<p>
106      */

107     protected void defineWidgets() {
108
109         initModule();
110
111         addWidget(new CmsWidgetDialogParameter(m_module, "parameters", PAGES[0], new CmsInputWidget()));
112
113     }
114
115 }
116
Popular Tags