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: HiddenFieldWriter.java,v $
31 * Revision 1.2 2005/04/09 18:04:17 colinmacleod
32 * Changed copyright text to GPL v2 explicitly.
33 *
34 * Revision 1.1 2005/01/19 12:47:27 colinmacleod
35 * First version of hidden field writer.
36 *
37 * -----------------------------------------------------------------------------
38 */
39 package com.ivata.mask.web.field.hidden;
40 import com.ivata.mask.field.Field;
41 import com.ivata.mask.field.FieldValueConvertor;
42 import com.ivata.mask.web.field.text.TextFieldWriter;
43 import com.ivata.mask.web.format.HTMLFormatter;
44
45 /***
46 * <p>
47 * This writer is used to display fields as
48 * <code><input type="hidden"...></code>, when they are
49 * hidden from display.
50 * </p>
51 *
52 * @since ivata masks 0.5 (20005-01-14)
53 * @author Colin MacLeod
54 * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
55 * @version $Revision: 1.2 $
56 */
57 public class HiddenFieldWriter extends TextFieldWriter {
58 /***
59 * <p>
60 * Construct a hidden field writer.
61 * </p>
62 *
63 * @param fieldParam
64 * defines the field to be displayed.
65 * @param convertorParam
66 * converts objects into strings for display.
67 * @param formatterParam
68 * Refer to {@link #getFormatter}.
69 */
70 public HiddenFieldWriter(final Field fieldParam,
71 final FieldValueConvertor convertorParam,
72 final HTMLFormatter formatterParam) {
73 super (fieldParam, convertorParam, formatterParam);
74 getAttributesWriter().setAttribute("type", "hidden");
75 }
76 }
77