1 19 20 package org.netbeans.modules.web.wizards; 21 22 26 public class AttrDialog extends javax.swing.JPanel { 27 28 29 public AttrDialog() { 30 initComponents(); 31 } 32 33 public AttrDialog(String attrName, String attrType, boolean required, boolean rtexpr) { 34 initComponents(); 35 jTextField1.setText(attrName); 36 jComboBox1.setSelectedItem(attrType); 37 jCheckBox1.setSelected(required); 38 if (rtexpr) jRadioButton1.setSelected(true); 39 else jRadioButton2.setSelected(true); 40 41 42 } 43 public String getAttrName(){ 44 return jTextField1.getText().trim(); 45 } 46 public String getAttrType(){ 47 return (String )jComboBox1.getSelectedItem(); 48 } 49 public boolean isRequired(){ 50 return jCheckBox1.isSelected(); 51 } 52 public boolean isRtexpr(){ 53 return jRadioButton1.isSelected(); 54 } 55 56 javax.swing.JTextField getAttrNameTF() { 57 return jTextField1; 58 } 59 60 65 private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; 67 68 buttonGroup1 = new javax.swing.ButtonGroup (); 69 jLabel1 = new javax.swing.JLabel (); 70 jLabel2 = new javax.swing.JLabel (); 71 jTextField1 = new javax.swing.JTextField (); 72 jComboBox1 = new javax.swing.JComboBox (); 73 jCheckBox1 = new javax.swing.JCheckBox (); 74 jPanel1 = new javax.swing.JPanel (); 75 jRadioButton1 = new javax.swing.JRadioButton (); 76 jRadioButton2 = new javax.swing.JRadioButton (); 77 78 setLayout(new java.awt.GridBagLayout ()); 79 80 getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_DESC_AttrDialog")); 81 jLabel1.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrName_mnem").charAt(0)); 82 jLabel1.setLabelFor(jTextField1); 83 jLabel1.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "LBL_AttrName")); 84 gridBagConstraints = new java.awt.GridBagConstraints (); 85 gridBagConstraints.gridx = 0; 86 gridBagConstraints.gridy = 0; 87 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 88 gridBagConstraints.weightx = 1.0; 89 gridBagConstraints.insets = new java.awt.Insets (6, 6, 6, 0); 90 add(jLabel1, gridBagConstraints); 91 92 jLabel2.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrType_mnem").charAt(0)); 93 jLabel2.setLabelFor(jComboBox1); 94 jLabel2.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "LBL_AttrType")); 95 gridBagConstraints = new java.awt.GridBagConstraints (); 96 gridBagConstraints.gridx = 0; 97 gridBagConstraints.gridy = 1; 98 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 99 gridBagConstraints.insets = new java.awt.Insets (0, 6, 6, 0); 100 add(jLabel2, gridBagConstraints); 101 102 gridBagConstraints = new java.awt.GridBagConstraints (); 103 gridBagConstraints.gridx = 1; 104 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 105 gridBagConstraints.weightx = 1.0; 106 gridBagConstraints.insets = new java.awt.Insets (6, 6, 6, 0); 107 add(jTextField1, gridBagConstraints); 108 jTextField1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("LBL_AttrName")); 109 110 jComboBox1.setEditable(true); 111 jComboBox1.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "java.lang.String", "boolean", "char", "byte", "short", "int", "long", "float", "double", "java.lang.Boolean", "java.lang.Character", "java.lang.Byte", "java.lang.Short", "java.lang.Integer", "java.lang.Long", "java.lang.Float", "java.lang.Double", "java.lang.Object" })); 112 gridBagConstraints = new java.awt.GridBagConstraints (); 113 gridBagConstraints.gridx = 1; 114 gridBagConstraints.gridy = 1; 115 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 116 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 117 gridBagConstraints.weightx = 1.0; 118 gridBagConstraints.insets = new java.awt.Insets (0, 6, 6, 0); 119 add(jComboBox1, gridBagConstraints); 120 jComboBox1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("LBL_AttrType")); 121 122 jCheckBox1.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrRequired_mnem").charAt(0)); 123 jCheckBox1.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "OPT_attrRequired")); 124 gridBagConstraints = new java.awt.GridBagConstraints (); 125 gridBagConstraints.gridx = 1; 126 gridBagConstraints.gridy = 2; 127 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 128 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 129 gridBagConstraints.insets = new java.awt.Insets (0, 6, 6, 0); 130 add(jCheckBox1, gridBagConstraints); 131 jCheckBox1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("OPT_attrRequired")); 132 133 gridBagConstraints = new java.awt.GridBagConstraints (); 134 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 135 gridBagConstraints.weightx = 3.0; 136 add(jPanel1, gridBagConstraints); 137 138 jRadioButton1.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrRequestTime_mnem").charAt(0)); 139 jRadioButton1.setSelected(true); 140 jRadioButton1.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "OPT_attrRequestTime")); 141 buttonGroup1.add(jRadioButton1); 142 gridBagConstraints = new java.awt.GridBagConstraints (); 143 gridBagConstraints.gridx = 1; 144 gridBagConstraints.gridy = 3; 145 gridBagConstraints.gridwidth = 2; 146 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 147 gridBagConstraints.insets = new java.awt.Insets (0, 6, 0, 6); 148 add(jRadioButton1, gridBagConstraints); 149 jRadioButton1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("OPT_attrRequestTime")); 150 151 jRadioButton2.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrJspTranslationTime_mnem").charAt(0)); 152 jRadioButton2.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "OPT_attrTranslationTime")); 153 buttonGroup1.add(jRadioButton2); 154 gridBagConstraints = new java.awt.GridBagConstraints (); 155 gridBagConstraints.gridx = 1; 156 gridBagConstraints.gridy = 4; 157 gridBagConstraints.gridwidth = 2; 158 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 159 gridBagConstraints.insets = new java.awt.Insets (0, 6, 6, 6); 160 add(jRadioButton2, gridBagConstraints); 161 jRadioButton2.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("OPT_attrTranslationTime")); 162 163 } 165 166 private javax.swing.ButtonGroup buttonGroup1; 168 private javax.swing.JCheckBox jCheckBox1; 169 private javax.swing.JComboBox jComboBox1; 170 private javax.swing.JLabel jLabel1; 171 private javax.swing.JLabel jLabel2; 172 private javax.swing.JPanel jPanel1; 173 private javax.swing.JRadioButton jRadioButton1; 174 private javax.swing.JRadioButton jRadioButton2; 175 private javax.swing.JTextField jTextField1; 176 178 } 179 | Popular Tags |