34 import javax.swing.text.*; 35 36 /** 37 * Component decorator that implements the view interface 38 * for form elements, <input>, <textarea>, 39 * and <select>. 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>Shows what components get built by this view</caption> 52 * <thead> 53 * <tr> 54 * <th>Element Type</th> 55 * <th>Component built</th> 56 * </tr> 57 * </thead> 58 * <tbody> 59 * <tr> 60 * <td>input, type button</td> 61 * <td>JButton</td> 62 * </tr> 63 * <tr> 64 * <td>input, type checkbox</td> 65 * <td>JCheckBox</td> 66 * </tr> 67 * <tr> 68 * <td>input, type image</td> 69 * <td>JButton</td> 70 * </tr> 71 * <tr> 72 * <td>input, type password</td> 73 * <td>JPasswordField</td> 74 * </tr> 75 * <tr> 76 * <td>input, type radio</td> 77 * <td>JRadioButton</td> 78 * </tr> 79 * <tr> 80 * <td>input, type reset</td> 81 * <td>JButton</td> 82 * </tr> 83 * <tr> 84 * <td>input, type submit</td> 85 * <td>JButton</td> 86 * </tr> 87 * <tr> 88 * <td>input, type text</td> 89 * <td>JTextField</td> 90 * </tr> 91 * <tr> 92 * <td>select, size > 1 or multiple attribute defined</td> 93 * <td>JList in a JScrollPane</td> 94 * </tr> 95 * <tr> 96 * <td>select, size unspecified or 1</td> 97 * <td>JComboBox</td> 98 * </tr> 99 * <tr> 100 * <td>textarea</td> 101 * <td>JTextArea in a JScrollPane</td> 102 * </tr> 103 * <tr> 104 * <td>input, type file</td> 105 * <td>JTextField</td> 106 * </tr> 107 * </tbody> 108 * </table> 109 * 110 * @author Timothy Prinzing 111 * @author Sunita Mani 112 */ 113 public class FormView extends ComponentView implements ActionListener { 114 115 /** 116 * If a value attribute is not specified for a FORM input element 117 * of type "submit", then this default string is used. 118 * 119 * @deprecated As of 1.3, value now comes from UIManager property 120 * FormView.submitButtonText 121 */ 122 @Deprecated 123 public static final String SUBMIT = new String("Submit Query"); 124 /** 125 * If a value attribute is not specified for a FORM input element 126 * of type "reset", then this default string is used. | 34 import javax.swing.text.*; 35 36 /** 37 * Component decorator that implements the view interface 38 * for form elements, <input>, <textarea>, 39 * and <select>. 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>Shows what components get built by this view</caption> 52 * <thead> 53 * <tr> 54 * <th scope="col">Element Type 55 * <th scope="col">Component built 56 * </thead> 57 * <tbody> 58 * <tr> 59 * <th scope="row">input, type button 60 * <td>JButton 61 * <tr> 62 * <th scope="row">input, type checkbox 63 * <td>JCheckBox 64 * <tr> 65 * <th scope="row">input, type image 66 * <td>JButton 67 * <tr> 68 * <th scope="row">input, type password 69 * <td>JPasswordField 70 * <tr> 71 * <th scope="row">input, type radio 72 * <td>JRadioButton 73 * <tr> 74 * <th scope="row">input, type reset 75 * <td>JButton 76 * <tr> 77 * <th scope="row">input, type submit 78 * <td>JButton 79 * <tr> 80 * <th scope="row">input, type text 81 * <td>JTextField 82 * <tr> 83 * <th scope="row">select, size > 1 or multiple attribute defined 84 * <td>JList in a JScrollPane 85 * <tr> 86 * <th scope="row">select, size unspecified or 1 87 * <td>JComboBox 88 * <tr> 89 * <th scope="row">textarea 90 * <td>JTextArea in a JScrollPane 91 * <tr> 92 * <th scope="row">input, type file 93 * <td>JTextField 94 * </tbody> 95 * </table> 96 * 97 * @author Timothy Prinzing 98 * @author Sunita Mani 99 */ 100 public class FormView extends ComponentView implements ActionListener { 101 102 /** 103 * If a value attribute is not specified for a FORM input element 104 * of type "submit", then this default string is used. 105 * 106 * @deprecated As of 1.3, value now comes from UIManager property 107 * FormView.submitButtonText 108 */ 109 @Deprecated 110 public static final String SUBMIT = new String("Submit Query"); 111 /** 112 * If a value attribute is not specified for a FORM input element 113 * of type "reset", then this default string is used. |