01: /*
02: * Copyright (c) 2001 - 2005 ivata limited.
03: * All rights reserved.
04: * -----------------------------------------------------------------------------
05: * ivata masks may be redistributed under the GNU General Public
06: * License as published by the Free Software Foundation;
07: * version 2 of the License.
08: *
09: * 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.4 2005/10/03 10:17:25 colinmacleod
32: * Fixed some style and javadoc issues.
33: *
34: * Revision 1.3 2005/10/02 14:06:32 colinmacleod
35: * Added/improved log4j logging.
36: *
37: * Revision 1.2 2005/04/09 18:04:17 colinmacleod
38: * Changed copyright text to GPL v2 explicitly.
39: *
40: * Revision 1.1 2005/01/19 12:47:27 colinmacleod
41: * First version of hidden field writer.
42: *
43: * -----------------------------------------------------------------------------
44: */
45: package com.ivata.mask.web.field.hidden;
46:
47: import com.ivata.mask.field.Field;
48: import com.ivata.mask.field.FieldValueConvertor;
49: import com.ivata.mask.web.field.text.TextFieldWriter;
50: import com.ivata.mask.web.format.HTMLFormatter;
51:
52: /**
53: * <p>
54: * This writer is used to display fields as
55: * <code><input type="hidden"...></code>, when they are
56: * hidden from display.
57: * </p>
58: *
59: * @since ivata masks 0.5 (20005-01-14)
60: * @author Colin MacLeod
61: * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
62: * @version $Revision: 1.4 $
63: */
64: public class HiddenFieldWriter extends TextFieldWriter {
65: /**
66: * <p>
67: * Construct a hidden field writer.
68: * </p>
69: *
70: * @param fieldParam
71: * defines the field to be displayed.
72: * @param convertorParam
73: * converts objects into strings for display.
74: * @param formatterParam
75: * <copyDoc>Refer to {@link #getFormatter}.</copyDoc>
76: */
77: public HiddenFieldWriter(final Field fieldParam,
78: final FieldValueConvertor convertorParam,
79: final HTMLFormatter formatterParam) {
80: super (fieldParam, convertorParam, formatterParam);
81: getAttributesWriter().setAttribute("type", "hidden");
82: }
83: }
|