KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > widgets > I_CmsWidget


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/widgets/I_CmsWidget.java,v $
3  * Date : $Date: 2006/03/27 14:52:20 $
4  * Version: $Revision: 1.9 $
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.widgets;
33
34 import org.opencms.file.CmsObject;
35
36 import java.util.Map JavaDoc;
37
38 /**
39  * Describes an editor widget for use in the OpenCms workplace.<p>
40  *
41  * @author Alexander Kandzior
42  *
43  * @version $Revision: 1.9 $
44  *
45  * @since 6.0.0
46  */

47 public interface I_CmsWidget {
48
49     /**
50      * Returns the configuration string.<p>
51      *
52      * This can be used to enable / disable certain widget features that should not always be available,
53      * or to pass specific initialization information to the widget.
54      * It depends on the widget implementation on how this information is used.<p>
55      *
56      * @return the configuration string
57      */

58     String JavaDoc getConfiguration();
59
60     /**
61      * Generates the html to include at the end of the dialog for this widget.<p>
62      *
63      * The "help bubble" text div's are added using this method.<p>
64      *
65      * @param cms the current users OpenCms context
66      * @param widgetDialog the dialog where the widget is used on
67      * @param param the widget parameter to generate the widget for
68      *
69      * @return the html to include at the end of the dialog for this widget
70      */

71     String JavaDoc getDialogHtmlEnd(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param);
72
73     /**
74      * Generates the necessary JavaScript inclusion code for this widget.<p>
75      *
76      * @param cms the current users OpenCms context
77      * @param widgetDialog the dialog where the widget is used on
78      *
79      * @return the JavaScript inclusion code
80      */

81     String JavaDoc getDialogIncludes(CmsObject cms, I_CmsWidgetDialog widgetDialog);
82
83     /**
84      * Generates the initialisation method JavaScript code for this widget.<p>
85      *
86      * @param cms the current users OpenCms context
87      * @param widgetDialog the dialog where the widget is used on
88      *
89      * @return the initialisation method JavaScript code
90      */

91     String JavaDoc getDialogInitCall(CmsObject cms, I_CmsWidgetDialog widgetDialog);
92
93     /**
94      * Generates the initialization method JavaScript code for this widget.<p>
95      *
96      * @param cms an initialized instance of a CmsObject
97      * @param widgetDialog the dialog where the widget is used on
98      *
99      * @return the initialization method JavaScript code
100      */

101     String JavaDoc getDialogInitMethod(CmsObject cms, I_CmsWidgetDialog widgetDialog);
102
103     /**
104      * Generates the widget HTML for the provided widget parameter.<p>
105      *
106      * @param cms an initialized instance of a CmsObject
107      * @param widgetDialog the dialog where the widget is used on
108      * @param param the widget parameter to generate the widget for
109      *
110      * @return the widget HTML for the provided widget parameter
111      */

112     String JavaDoc getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param);
113
114     /**
115      * Creates the HTML code for the help bubble for this widget.<p>
116      *
117      * @param cms the current users OpenCms context
118      * @param widgetDialog the dialog where the widget is used on
119      * @param param the widget parameter to generate the widget for
120      *
121      * @return the HTML code for the help bubble for this widget
122      */

123     String JavaDoc getHelpBubble(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param);
124
125     /**
126      * Creates a HTML &lt;div&gt; containing the help text for this widget.<p>
127      *
128      * @param widgetDialog the dialog where the widget is used on
129      * @param value the value to create the help bubble for
130      *
131      * @return a HTML &lt;div&gt; containing the help text for this widget
132      */

133     String JavaDoc getHelpText(I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter value);
134
135     /**
136      * Returns the <code>{@link I_CmsWidgetParameter#getStringValue(CmsObject)}</code>
137      * processed according to the output rules of this widget and the given widget dialog.<p>
138      *
139      * @param cms the current users OpenCms context
140      * @param widgetDialog the dialog where the widget is used on
141      * @param param the widget parameter to generate the widget for
142      *
143      * @return the <code>{@link I_CmsWidgetParameter#getStringValue(CmsObject)}</code>
144      * processed according to the output rules of this widget
145      *
146      * @see I_CmsWidgetParameter#getStringValue(CmsObject)
147      * @see org.opencms.xml.types.I_CmsXmlContentValue#getStringValue(CmsObject)
148      */

149     String JavaDoc getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param);
150
151     /**
152      * Creates a duplicate of this widget instance.<p>
153      *
154      * @return a duplicate of this widget instance
155      */

156     I_CmsWidget newInstance();
157
158     /**
159      * Sets the configuration of this widget.<p>
160      *
161      * This can be used to enable / disable certain widget features that should not always be available,
162      * or to pass specific initialization information to the widget.
163      * It depends on the widget implementation on how this information is used.<p>
164      *
165      * @param configuration the configuration to set
166      */

167     void setConfiguration(String JavaDoc configuration);
168
169     /**
170      * Sets the value of in the given widget parameter by reading the "right"
171      * value from the offered map of parameters.<p>
172      *
173      * @param cms the current users OpenCms context
174      * @param formParameters the map of parameters to get the value from
175      * @param widgetDialog the dialog where the widget is used on
176      * @param param the widget parameter to generate the widget for
177      */

178     void setEditorValue(CmsObject cms, Map JavaDoc formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param);
179 }
Popular Tags