KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > frontend > photoalbum > CmsPhotoAlbumStyle


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/frontend/photoalbum/CmsPhotoAlbumStyle.java,v $
3  * Date : $Date: 2006/03/27 14:52:22 $
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.frontend.photoalbum;
33
34 import org.opencms.util.CmsStringUtil;
35
36 /**
37  * Stores the CSS style sheet class names of the HTML element to use for the photo album output pages.<p>
38  *
39  * @author Andreas Zahner
40  *
41  * @version $Revision: 1.2 $
42  *
43  * @since 6.1.3
44  */

45 public class CmsPhotoAlbumStyle {
46
47     /** The CSS class name for the detail image description text cell. */
48     private String JavaDoc m_classDetailImageDescription;
49
50     /** The CSS class name for the detail image title text cell. */
51     private String JavaDoc m_classDetailImageTitle;
52
53     /** The CSS class name for the links on the album pages. */
54     private String JavaDoc m_classLink;
55     
56     /** The CSS class name for the navigation row of the album pages. */
57     private String JavaDoc m_classNavigation;
58
59     /** The CSS class name for the page title of the album pages. */
60     private String JavaDoc m_classPageTitle;
61
62     /** The CSS class name for the thumbnail overview image title cells. */
63     private String JavaDoc m_classThumbImageTitle;
64
65     /** The CSS class name for the thumbnail overview table. */
66     private String JavaDoc m_classThumbTable;
67
68     /** The CSS class name for the thumbnail overview text cells to show above and below the tumbs. */
69     private String JavaDoc m_classThumbText;
70
71     /**
72      * Constructor to get a new instance of the style object.<p>
73      */

74     public CmsPhotoAlbumStyle() {
75
76         // nothing to do here
77
}
78
79     /**
80      * Returns the CSS class name for the detail image description text cell.<p>
81      *
82      * @return the CSS class name for the detail image description text cell
83      */

84     public String JavaDoc getClassDetailImageDescription() {
85
86         return checkStyleClass(m_classDetailImageDescription);
87     }
88
89     /**
90      * Returns the CSS class name for the detail image title text cell.<p>
91      *
92      * @return the CSS class name for the detail image title text cell
93      */

94     public String JavaDoc getClassDetailImageTitle() {
95
96         return checkStyleClass(m_classDetailImageTitle);
97     }
98
99     /**
100      * Returns the CSS class name for the links on the album pages.<p>
101      *
102      * @return the CSS class name for the links on the album pages
103      */

104     public String JavaDoc getClassLink() {
105
106         return checkStyleClass(m_classLink);
107     }
108
109     /**
110      * Returns the CSS class name for the navigation row of the album pages.<p>
111      *
112      * @return the CSS class name for the navigation row of the album pages
113      */

114     public String JavaDoc getClassNavigation() {
115
116         return checkStyleClass(m_classNavigation);
117     }
118
119     /**
120      * Returns the CSS class name for the page title of the album pages.<p>
121      *
122      * @return the CSS class name for the page title of the album pages
123      */

124     public String JavaDoc getClassPageTitle() {
125
126         return checkStyleClass(m_classPageTitle);
127     }
128
129     /**
130      * Returns the CSS class name for the thumbnail overview image title cells.<p>
131      *
132      * @return the CSS class name for the thumbnail overview image title cells
133      */

134     public String JavaDoc getClassThumbImageTitle() {
135
136         return checkStyleClass(m_classThumbImageTitle);
137     }
138
139     /**
140      * Returns the CSS class name for the thumbnail overview table.<p>
141      *
142      * @return the CSS class name for the thumbnail overview table
143      */

144     public String JavaDoc getClassThumbTable() {
145
146         return checkStyleClass(m_classThumbTable);
147     }
148
149     /**
150      * Returns the CSS class name for the thumbnail overview text cells to show above and below the tumbs.<p>
151      *
152      * @return the CSS class name for the thumbnail overview text cells to show above and below the tumbs
153      */

154     public String JavaDoc getClassThumbText() {
155
156         return checkStyleClass(m_classThumbText);
157     }
158
159     /**
160      * Sets the CSS class name for the detail image description text cell.<p>
161      *
162      * @param classDetailImageDescription the CSS class name for the detail image description text cell
163      */

164     public void setClassDetailImageDescription(String JavaDoc classDetailImageDescription) {
165
166         m_classDetailImageDescription = classDetailImageDescription;
167     }
168
169     /**
170      * Sets the CSS class name for the detail image title text cell.<p>
171      *
172      * @param classDetailImageTitle the CSS class name for the detail image title text cell
173      */

174     public void setClassDetailImageTitle(String JavaDoc classDetailImageTitle) {
175
176         m_classDetailImageTitle = classDetailImageTitle;
177     }
178
179     /**
180      * Sets the CSS class name for the links on the album pages.<p>
181      *
182      * @param classLink the CSS class name for the links on the album pages
183      */

184     public void setClassLink(String JavaDoc classLink) {
185
186         m_classLink = classLink;
187     }
188
189     /**
190      * Sets the CSS class name for the navigation row of the album pages.<p>
191      *
192      * @param classNavigation the CSS class name for the navigation row of the album pages
193      */

194     public void setClassNavigation(String JavaDoc classNavigation) {
195
196         m_classNavigation = classNavigation;
197     }
198
199     /**
200      * Sets the CSS class name for the page title of the album pages.<p>
201      *
202      * @param classPageTitle the CSS class name for the page title of the album pages
203      */

204     public void setClassPageTitle(String JavaDoc classPageTitle) {
205
206         m_classPageTitle = classPageTitle;
207     }
208
209     /**
210      * Sets the CSS class name for the thumbnail overview image title cells.<p>
211      *
212      * @param classThumbImageTitle the CSS class name for the thumbnail overview image title cells
213      */

214     public void setClassThumbImageTitle(String JavaDoc classThumbImageTitle) {
215
216         m_classThumbImageTitle = classThumbImageTitle;
217     }
218
219     /**
220      * Sets the CSS class name for the thumbnail overview table.<p>
221      *
222      * @param classThumbTable the CSS class name for the thumbnail overview table
223      */

224     public void setClassThumbTable(String JavaDoc classThumbTable) {
225
226         m_classThumbTable = classThumbTable;
227     }
228
229     /**
230      * Sets the CSS class name for the thumbnail overview text cells to show above and below the tumbs.<p>
231      *
232      * @param classThumbText the CSS class name for the thumbnail overview text cells to show above and below the tumbs
233      */

234     public void setClassThumbText(String JavaDoc classThumbText) {
235
236         m_classThumbText = classThumbText;
237     }
238
239     /**
240      * Checks the value of the specified style class and returns an empty String if the parameter is null.<p>
241      *
242      * @param styleClass the value to check
243      * @return the style class or an empty String if the parameter is null
244      */

245     private String JavaDoc checkStyleClass(String JavaDoc styleClass) {
246
247         if (CmsStringUtil.isEmpty(styleClass)) {
248             return "";
249         }
250         StringBuffer JavaDoc result = new StringBuffer JavaDoc(64);
251         result.append(" class=\"");
252         result.append(styleClass);
253         result.append("\"");
254         return result.toString();
255     }
256
257 }
258
Popular Tags