KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > list > CmsListItemDetails


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/list/CmsListItemDetails.java,v $
3  * Date : $Date: 2005/06/23 11:11:43 $
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.workplace.list;
33
34 import org.opencms.i18n.CmsMessageContainer;
35
36 /**
37  * For adding detail information to the list items add an instance
38  * of this class to the list metadata and fill the data like an
39  * additional column.<p>
40  *
41  * For detail contents you may use HTML code.<p>
42  *
43  * @author Michael Moossen
44  *
45  * @version $Revision: 1.9 $
46  *
47  * @since 6.0.0
48  */

49 public class CmsListItemDetails extends CmsListColumnDefinition {
50
51     /** Id of the first column to include. */
52     private String JavaDoc m_atColumn;
53
54     /** Action for hidding the details. */
55     private I_CmsListAction m_hideAction;
56
57     /** Action for showing the details. */
58     private I_CmsListAction m_showAction;
59
60     /**
61      * Default constructor.<p>
62      *
63      * @param id the unique id
64      */

65     public CmsListItemDetails(String JavaDoc id) {
66
67         super(id);
68         // set default actions
69
setAlign(CmsListColumnAlignEnum.ALIGN_LEFT);
70         m_hideAction = new CmsListIndependentAction(id);
71         m_hideAction.setIconPath(A_CmsListDialog.ICON_DETAILS_HIDE);
72         m_showAction = new CmsListIndependentAction(id);
73         m_showAction.setIconPath(A_CmsListDialog.ICON_DETAILS_SHOW);
74     }
75
76     /**
77      * Returns the current active action.<p>
78      *
79      * @return the current active action
80      */

81     public I_CmsListAction getAction() {
82
83         return isVisible() ? m_hideAction : m_showAction;
84     }
85
86     /**
87      * Returns the id of the first column to include.<p>
88      *
89      * @return the id of the first column to include
90      */

91     public String JavaDoc getAtColumn() {
92
93         return m_atColumn;
94     }
95
96     /**
97      * Sets the id of the first column to include.<p>
98      *
99      * @param atColumn the id of the first column to set
100      */

101     public void setAtColumn(String JavaDoc atColumn) {
102
103         m_atColumn = atColumn;
104     }
105
106     /**
107      * Sets the hide details Action.<p>
108      *
109      * @param hideAction the hide details Action to set
110      */

111     public void setHideAction(I_CmsListAction hideAction) {
112
113         m_hideAction = hideAction;
114     }
115
116     /**
117      * Sets the help text of the hide action.<p>
118      *
119      * @param hideActionHelp the help text of the hide action
120      */

121     public void setHideActionHelpText(CmsMessageContainer hideActionHelp) {
122
123         m_hideAction.setHelpText(hideActionHelp);
124     }
125
126     /**
127      * Sets the name of the hide action.<p>
128      *
129      * @param hideActionName the name of the hide action
130      */

131     public void setHideActionName(CmsMessageContainer hideActionName) {
132
133         m_hideAction.setName(hideActionName);
134     }
135
136     /**
137      * Sets the id of the list.<p>
138      *
139      * @param listId the id of the list
140      */

141     public void setListId(String JavaDoc listId) {
142
143         m_hideAction.setListId(listId);
144         m_showAction.setListId(listId);
145     }
146
147     /**
148      * Sets the show details Action.<p>
149      *
150      * @param showAction the showdetails Action to set
151      */

152     public void setShowAction(I_CmsListAction showAction) {
153
154         m_showAction = showAction;
155     }
156
157     /**
158      * Sets the help text of the show action.<p>
159      *
160      * @param showActionHelp the help text of the show action
161      */

162     public void setShowActionHelpText(CmsMessageContainer showActionHelp) {
163
164         m_showAction.setHelpText(showActionHelp);
165     }
166
167     /**
168      * Sets the name of the show action.<p>
169      *
170      * @param showActionName the name of the show action
171      */

172     public void setShowActionName(CmsMessageContainer showActionName) {
173
174         m_showAction.setName(showActionName);
175     }
176 }
177
Popular Tags