< prev index next >

src/java.desktop/share/classes/javax/swing/text/html/FormView.java

Print this page




  29 import java.awt.*;
  30 import java.awt.event.*;
  31 import java.util.*;
  32 import javax.swing.*;
  33 import javax.swing.event.*;
  34 import javax.swing.text.*;
  35 
  36 /**
  37  * Component decorator that implements the view interface
  38  * for form elements, &lt;input&gt;, &lt;textarea&gt;,
  39  * and &lt;select&gt;.  The model for the component is stored
  40  * as an attribute of the element (using StyleConstants.ModelAttribute),
  41  * and is used to build the component of the view.  The type
  42  * of the model is assumed to of the type that would be set by
  43  * <code>HTMLDocument.HTMLReader.FormAction</code>.  If there are
  44  * multiple views mapped over the document, they will share the
  45  * embedded component models.
  46  * <p>
  47  * The following table shows what components get built
  48  * by this view.
  49  * <table summary="shows what components get built by this view">




  50  * <tr>
  51  *   <th>Element Type</th>
  52  *   <th>Component built</th>
  53  * </tr>


  54  * <tr>
  55  *   <td>input, type button</td>
  56  *   <td>JButton</td>
  57  * </tr>
  58  * <tr>
  59  *   <td>input, type checkbox</td>
  60  *   <td>JCheckBox</td>
  61  * </tr>
  62  * <tr>
  63  *   <td>input, type image</td>
  64  *   <td>JButton</td>
  65  * </tr>
  66  * <tr>
  67  *   <td>input, type password</td>
  68  *   <td>JPasswordField</td>
  69  * </tr>
  70  * <tr>
  71  *   <td>input, type radio</td>
  72  *   <td>JRadioButton</td>
  73  * </tr>


  82  * <tr>
  83  *   <td>input, type text</td>
  84  *   <td>JTextField</td>
  85  * </tr>
  86  * <tr>
  87  *   <td>select, size &gt; 1 or multiple attribute defined</td>
  88  *   <td>JList in a JScrollPane</td>
  89  * </tr>
  90  * <tr>
  91  *   <td>select, size unspecified or 1</td>
  92  *   <td>JComboBox</td>
  93  * </tr>
  94  * <tr>
  95  *   <td>textarea</td>
  96  *   <td>JTextArea in a JScrollPane</td>
  97  * </tr>
  98  * <tr>
  99  *   <td>input, type file</td>
 100  *   <td>JTextField</td>
 101  * </tr>

 102  * </table>
 103  *
 104  * @author Timothy Prinzing
 105  * @author Sunita Mani
 106  */
 107 public class FormView extends ComponentView implements ActionListener {
 108 
 109     /**
 110      * If a value attribute is not specified for a FORM input element
 111      * of type "submit", then this default string is used.
 112      *
 113      * @deprecated As of 1.3, value now comes from UIManager property
 114      *             FormView.submitButtonText
 115      */
 116     @Deprecated
 117     public static final String SUBMIT = new String("Submit Query");
 118     /**
 119      * If a value attribute is not specified for a FORM input element
 120      * of type "reset", then this default string is used.
 121      *




  29 import java.awt.*;
  30 import java.awt.event.*;
  31 import java.util.*;
  32 import javax.swing.*;
  33 import javax.swing.event.*;
  34 import javax.swing.text.*;
  35 
  36 /**
  37  * Component decorator that implements the view interface
  38  * for form elements, &lt;input&gt;, &lt;textarea&gt;,
  39  * and &lt;select&gt;.  The model for the component is stored
  40  * as an attribute of the element (using StyleConstants.ModelAttribute),
  41  * and is used to build the component of the view.  The type
  42  * of the model is assumed to of the type that would be set by
  43  * <code>HTMLDocument.HTMLReader.FormAction</code>.  If there are
  44  * multiple views mapped over the document, they will share the
  45  * embedded component models.
  46  * <p>
  47  * The following table shows what components get built
  48  * by this view.
  49  *
  50  * <table class="striped">
  51  * <caption style="display:none">shows what components get built by this view
  52  * </caption>
  53  * <thead>
  54  * <tr>
  55  *   <th>Element Type</th>
  56  *   <th>Component built</th>
  57  * </tr>
  58  * </thead>
  59  * <tbody>
  60  * <tr>
  61  *   <td>input, type button</td>
  62  *   <td>JButton</td>
  63  * </tr>
  64  * <tr>
  65  *   <td>input, type checkbox</td>
  66  *   <td>JCheckBox</td>
  67  * </tr>
  68  * <tr>
  69  *   <td>input, type image</td>
  70  *   <td>JButton</td>
  71  * </tr>
  72  * <tr>
  73  *   <td>input, type password</td>
  74  *   <td>JPasswordField</td>
  75  * </tr>
  76  * <tr>
  77  *   <td>input, type radio</td>
  78  *   <td>JRadioButton</td>
  79  * </tr>


  88  * <tr>
  89  *   <td>input, type text</td>
  90  *   <td>JTextField</td>
  91  * </tr>
  92  * <tr>
  93  *   <td>select, size &gt; 1 or multiple attribute defined</td>
  94  *   <td>JList in a JScrollPane</td>
  95  * </tr>
  96  * <tr>
  97  *   <td>select, size unspecified or 1</td>
  98  *   <td>JComboBox</td>
  99  * </tr>
 100  * <tr>
 101  *   <td>textarea</td>
 102  *   <td>JTextArea in a JScrollPane</td>
 103  * </tr>
 104  * <tr>
 105  *   <td>input, type file</td>
 106  *   <td>JTextField</td>
 107  * </tr>
 108  * </tbody>
 109  * </table>
 110  *
 111  * @author Timothy Prinzing
 112  * @author Sunita Mani
 113  */
 114 public class FormView extends ComponentView implements ActionListener {
 115 
 116     /**
 117      * If a value attribute is not specified for a FORM input element
 118      * of type "submit", then this default string is used.
 119      *
 120      * @deprecated As of 1.3, value now comes from UIManager property
 121      *             FormView.submitButtonText
 122      */
 123     @Deprecated
 124     public static final String SUBMIT = new String("Submit Query");
 125     /**
 126      * If a value attribute is not specified for a FORM input element
 127      * of type "reset", then this default string is used.
 128      *


< prev index next >