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
006package fc.web.forms;
007
008import javax.servlet.*;
009import javax.servlet.http.*;
010import java.io.*;
011import java.util.*;
012import java.util.regex.*;
013
014import fc.jdbc.*;
015import fc.io.*;
016import fc.util.*;
017
018/** 
019Represents a HTML form's radio element.
020
021@author hursh jain
022**/
023public final class Radio extends Choice
024{
025/** 
026Creates 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**/
033public Radio(String name, String value, boolean selected)
034  {
035  super(name, value, selected);
036  }
037
038/** 
039Constructs a new unselected radio with the specified value 
040and HTML text. 
041
042@param  name    the name of this choice
043@param  value   the value of this choice item
044**/
045public Radio(String name, String value) {
046  this(name, value, false);
047  }
048
049/** 
050Constructs a new unselected radio with no separate 
051value attribute
052
053@param  name    the name of this choice
054**/
055public Radio(String name) {
056  this(name, null, false);
057  }
058
059public Field.Type getType() {
060  return Field.Type.RADIO;
061  }
062
063}          //~class Radio