1 /*
2 * Copyright (c) 2001 - 2005 ivata limited.
3 * All rights reserved.
4 * -----------------------------------------------------------------------------
5 * ivata masks may be redistributed under the GNU General Public
6 * License as published by the Free Software Foundation;
7 * version 2 of the License.
8 *
9 * These programs are free software; you can redistribute them and/or
10 * modify them under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; version 2 of the License.
12 *
13 * These programs are distributed in the hope that they will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 *
17 * See the GNU General Public License in the file LICENSE.txt for more
18 * details.
19 *
20 * If you would like a copy of the GNU General Public License write to
21 *
22 * Free Software Foundation, Inc.
23 * 59 Temple Place - Suite 330
24 * Boston, MA 02111-1307, USA.
25 *
26 *
27 * To arrange commercial support and licensing, contact ivata at
28 * http://www.ivata.com/contact.jsp
29 * -----------------------------------------------------------------------------
30 * $Log: ListForm.java,v $
31 * Revision 1.5 2005/04/09 18:04:18 colinmacleod
32 * Changed copyright text to GPL v2 explicitly.
33 *
34 * Revision 1.4 2005/01/07 08:08:24 colinmacleod
35 * Moved up a version number.
36 * Changed copyright notices to 2005.
37 * Updated the documentation:
38 * - started working on multiproject:site docu.
39 * - changed the logo.
40 * Added checkstyle and fixed LOADS of style issues.
41 * Added separate thirdparty subproject.
42 * Added struts (in web), util and webgui (in webtheme) from ivata op.
43 *
44 * Revision 1.3 2004/12/26 13:24:45 colinmacleod
45 * Removed SSLEXT dependency.
46 *
47 * Revision 1.2 2004/12/23 21:28:32 colinmacleod
48 * Modifications to add ivata op compatibility.
49 *
50 * Revision 1.1.1.1 2004/05/16 20:40:32 colinmacleod
51 * Ready for 0.1 release
52 * -----------------------------------------------------------------------------
53 */
54 package com.ivata.mask.web.struts;
55 import java.util.List;
56 import com.ivata.mask.Mask;
57 /***
58 * <p>
59 * This form references a list of value objects to be displayed.
60 * </p>
61 *
62 * @author Colin MacLeod
63 * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
64 * @since ivata masks 0.1 (2004-05-09)
65 * @version $Revision: 1.5 $
66 */
67 public class ListForm extends MaskForm {
68 /***
69 * <p>
70 * Request attribute under which name this form is stored.
71 * </p>
72 */
73 public static final String REQUEST_ATTRIBUTE = "ListForm";
74 /***
75 * <p>
76 * Contains all value objects to be displayed.
77 * </p>
78 */
79 private List valueObjects;
80 /***
81 * <p>
82 * Create a new mask form for the given value object list and base class.
83 * </p>
84 *
85 * @param valueObjectsParam
86 * all value objects to be displayed.
87 * @param maskParam
88 * Refer to {@link MaskForm#MaskForm}.
89 * @param baseClassParam
90 * Refer to {@link MaskForm#MaskForm}.
91 */
92 public ListForm(final List valueObjectsParam, final Mask maskParam,
93 final Class baseClassParam) {
94 super(maskParam, baseClassParam);
95 this.valueObjects = valueObjectsParam;
96 }
97 /***
98 * <p>
99 * Clear all bean properties to their default state.The difference between
100 * this and <code>reset</code> is that all properties are changed,
101 * regardless of current request state.
102 * </p>
103 *
104 * @see com.ivata.mask.web.struts.MaskForm#clear()
105 */
106 protected void clear() {
107 if (this.valueObjects != null) {
108 this.valueObjects.clear();
109 }
110 }
111 /***
112 * <p>
113 * Contains all value objects to be displayed.
114 * </p>
115 *
116 * @return all value objects to be displayed.
117 */
118 public final List getValueObjects() {
119 return valueObjects;
120 }
121 /***
122 * <p>
123 * Contains all value objects to be displayed.
124 * </p>
125 *
126 * @param valueObjectsParam
127 * all value objects to be displayed.
128 */
129 public final void setValueObjects(final List valueObjectsParam) {
130 valueObjects = valueObjectsParam;
131 }
132 }
133