KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > tools > searchindex > A_CmsEmbeddedListDialog


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/searchindex/A_CmsEmbeddedListDialog.java,v $
3  * Date : $Date: 2006/03/27 14:52:21 $
4  * Version: $Revision: 1.2 $
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.searchindex;
33
34 import org.opencms.i18n.CmsMessageContainer;
35 import org.opencms.jsp.CmsJspActionElement;
36 import org.opencms.workplace.list.A_CmsListDialog;
37 import org.opencms.workplace.list.CmsListOrderEnum;
38
39 /**
40  * A list dialog that may be embedded in
41  * the output of other <code>{@link org.opencms.workplace.CmsDialog}</code> instances.<p>
42  *
43  * With std. <code>{@link org.opencms.workplace.list.A_CmsListDialog}</code> this attempt will
44  * result in double gray headers in the workplace. <p>
45  *
46  * <h4>Howto</h4>
47  *
48  * <h5>1. Include content in JSP</h5>
49  * <pre>
50  <%
51  CmsJspActionElement actionElement = new CmsJspActionElement(pageContext, request, response);
52  CmsWidgetDialog wpWidget = new &lt;TYPE&gt;(actionElement);
53
54  // perform the widget actions (write later)
55  wpWidget.displayDialog(true);
56  A_CmsEmbeddedListDialog wpList = new &lt;TYPE&gt;(actionElement);
57  
58  // perform the list actions (write later)
59  wpList.displayDialog(true);
60  // write the content of widget dialog
61  wpWidget.writeDialog();
62  // write the content of list dialog
63  wpList.writeDialog();
64  %>
65  * </pre>
66  *
67  * <h5>2. Include in code of other CmsDialog</h5>
68  <pre>
69  protected String createDialogHtml(String dialog) {
70
71  StringBuffer result = new StringBuffer(1024);
72
73  result.append(createWidgetTableStart());
74  // do your dialog output here....
75  ...
76  result.append(createWidgetTableEnd());
77  // create the list :
78  A_CmsEmbeddedListDialog wpList = new &lt;TYPE&gt;(getJsp());
79  wpList.writeDialog();
80  </pre>
81  *
82  *
83  * @author Achim Westermann
84  *
85  * @version $Revision: 1.2 $
86  *
87  * @since 6.0.0
88  */

89 public abstract class A_CmsEmbeddedListDialog extends A_CmsListDialog {
90
91     /**
92      * Public constructor.<p>
93      *
94      * @param jsp an initialized JSP action element
95      * @param listId the id of the displayed list
96      * @param listName the name of the list
97      * @param sortedColId the a priory sorted column
98      * @param sortOrder the order of the sorted column
99      * @param searchableColId the column to search into
100      */

101     public A_CmsEmbeddedListDialog(
102         CmsJspActionElement jsp,
103         String JavaDoc listId,
104         CmsMessageContainer listName,
105         String JavaDoc sortedColId,
106         CmsListOrderEnum sortOrder,
107         String JavaDoc searchableColId) {
108
109         // TODO: Auto-generated constructor stub
110
super(jsp, listId, listName, sortedColId, sortOrder, searchableColId);
111
112     }
113
114     /**
115      * Overrides the implementation to skip generation of gray header. <p>
116      *
117      * @see org.opencms.workplace.list.A_CmsListDialog#defaultActionHtmlStart()
118      */

119     public String JavaDoc defaultActionHtmlStart() {
120
121         return new StringBuffer JavaDoc(getList().listJs(getLocale())).append(dialogContentStart(getParamTitle())).toString();
122     }
123 }
124
Popular Tags