001 // Copyright (c) 2001 Hursh Jain (http://www.mollypages.org)
002 // The Molly framework is freely distributable under the terms of an
003 // MIT-style license. For details, see the molly pages web site at:
004 // http://www.mollypages.org/. Use, modify, have fun !
005
006 package fc.web.forms;
007
008 import javax.servlet.*;
009 import javax.servlet.http.*;
010 import java.io.*;
011 import java.util.*;
012 import java.util.regex.*;
013
014 import fc.jdbc.*;
015 import fc.io.*;
016 import fc.util.*;
017
018 /**
019 Represents a HTML form's radio element.
020
021 @author hursh jain
022 **/
023 public final class Radio extends Choice
024 {
025 /**
026 Creates a new radio object.
027
028 @param name the field name
029 @param value the value of this choice item
030 @param selected <tt>true</tt> if this choice is
031 originally selected
032 **/
033 public Radio(String name, String value, boolean selected)
034 {
035 super(name, value, selected);
036 }
037
038 /**
039 Constructs a new unselected radio with the specified value
040 and HTML text.
041
042 @param name the name of this choice
043 @param value the value of this choice item
044 **/
045 public Radio(String name, String value) {
046 this(name, value, false);
047 }
048
049 /**
050 Constructs a new unselected radio with no separate
051 value attribute
052
053 @param name the name of this choice
054 **/
055 public Radio(String name) {
056 this(name, null, false);
057 }
058
059 public Field.Type getType() {
060 return Field.Type.RADIO;
061 }
062
063 } //~class Radio