1 19 20 package org.netbeans.modules.j2ee.ddloaders.web.multiview; 21 22 29 public class EjbRefPanel extends javax.swing.JPanel { 30 31 32 public EjbRefPanel() { 33 initComponents(); 34 org.netbeans.modules.xml.multiview.Utils.makeTextAreaLikeTextField(descriptionTA, nameTF); 35 } 36 37 void setEjbName(String name) { 38 nameTF.setText(name); 39 } 40 41 void setBeanType(String value) { 42 beanTypeCB.setSelectedItem(value); 43 } 44 45 void setInterfaceType(String value) { 46 interfaceTypeCB.setSelectedItem(value); 47 } 48 49 void setHome(String value) { 50 homeTF.setText(value); 51 } 52 53 void setInterface(String value) { 54 interfaceTF.setText(value); 55 } 56 57 void setLink(String value) { 58 linkTF.setText(value); 59 } 60 61 void setDescription(String value) { 62 descriptionTA.setText(value); 63 } 64 65 String getEjbName() { 66 return nameTF.getText(); 67 } 68 69 String getBeanType() { 70 return (String )beanTypeCB.getSelectedItem(); 71 } 72 73 String getInterfaceType() { 74 return (String )interfaceTypeCB.getSelectedItem(); 75 } 76 77 String getHome() { 78 return homeTF.getText(); 79 } 80 81 String getInterface() { 82 return interfaceTF.getText(); 83 } 84 85 String getLink() { 86 return linkTF.getText(); 87 } 88 89 String getDescription() { 90 return descriptionTA.getText(); 91 } 92 93 javax.swing.JTextField getNameTF() { 94 return nameTF; 95 } 96 97 javax.swing.JTextField getHomeTF() { 98 return homeTF; 99 } 100 101 javax.swing.JTextField getInterfaceTF() { 102 return interfaceTF; 103 } 104 105 javax.swing.JComboBox getInterfaceTypeCB() { 106 return interfaceTypeCB; 107 } 108 109 114 private void initComponents() { 116 java.awt.GridBagConstraints gridBagConstraints; 117 118 buttonGroup1 = new javax.swing.ButtonGroup (); 119 nameLabel = new javax.swing.JLabel (); 120 nameTF = new javax.swing.JTextField (); 121 beanTypeLabel = new javax.swing.JLabel (); 122 beanTypeCB = new javax.swing.JComboBox (); 123 interfaceTypeLabel = new javax.swing.JLabel (); 124 interfaceTypeCB = new javax.swing.JComboBox (); 125 homeLabel = new javax.swing.JLabel (); 126 homeTF = new javax.swing.JTextField (); 127 interfaceLabel = new javax.swing.JLabel (); 128 interfaceTF = new javax.swing.JTextField (); 129 linkLabel = new javax.swing.JLabel (); 130 linkTF = new javax.swing.JTextField (); 131 descriptionLabel = new javax.swing.JLabel (); 132 descriptionTA = new javax.swing.JTextArea (); 133 134 setLayout(new java.awt.GridBagLayout ()); 135 136 nameLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbRefName_mnem").charAt(0)); 137 nameLabel.setLabelFor(nameTF); 138 nameLabel.setText(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbRefName")); 139 gridBagConstraints = new java.awt.GridBagConstraints (); 140 gridBagConstraints.gridx = 0; 141 gridBagConstraints.gridy = 0; 142 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 143 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 144 add(nameLabel, gridBagConstraints); 145 146 nameTF.setColumns(30); 147 gridBagConstraints = new java.awt.GridBagConstraints (); 148 gridBagConstraints.gridx = 1; 149 gridBagConstraints.gridy = 0; 150 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 151 gridBagConstraints.weightx = 1.0; 152 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 153 add(nameTF, gridBagConstraints); 154 155 beanTypeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbRefType_mnem").charAt(0)); 156 beanTypeLabel.setLabelFor(beanTypeCB); 157 beanTypeLabel.setText(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbRefType")); 158 gridBagConstraints = new java.awt.GridBagConstraints (); 159 gridBagConstraints.gridx = 0; 160 gridBagConstraints.gridy = 1; 161 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 162 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 163 add(beanTypeLabel, gridBagConstraints); 164 165 beanTypeCB.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "Session", "Entity" })); 166 gridBagConstraints = new java.awt.GridBagConstraints (); 167 gridBagConstraints.gridx = 1; 168 gridBagConstraints.gridy = 1; 169 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 170 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 171 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 172 add(beanTypeCB, gridBagConstraints); 173 174 interfaceTypeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbInterfaceType_mnem").charAt(0)); 175 interfaceTypeLabel.setLabelFor(interfaceTypeCB); 176 interfaceTypeLabel.setText(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbInterfaceType")); 177 gridBagConstraints = new java.awt.GridBagConstraints (); 178 gridBagConstraints.gridx = 0; 179 gridBagConstraints.gridy = 2; 180 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 181 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 182 add(interfaceTypeLabel, gridBagConstraints); 183 184 interfaceTypeCB.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "Remote", "Local" })); 185 interfaceTypeCB.addItemListener(new java.awt.event.ItemListener () { 186 public void itemStateChanged(java.awt.event.ItemEvent evt) { 187 interfaceTypeCBItemStateChanged(evt); 188 } 189 }); 190 191 gridBagConstraints = new java.awt.GridBagConstraints (); 192 gridBagConstraints.gridx = 1; 193 gridBagConstraints.gridy = 2; 194 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 195 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 196 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 197 add(interfaceTypeCB, gridBagConstraints); 198 199 homeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbHome_mnem").charAt(0)); 200 homeLabel.setLabelFor(homeTF); 201 homeLabel.setText(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbHome")); 202 gridBagConstraints = new java.awt.GridBagConstraints (); 203 gridBagConstraints.gridx = 0; 204 gridBagConstraints.gridy = 3; 205 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 206 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 207 add(homeLabel, gridBagConstraints); 208 209 homeTF.setColumns(20); 210 gridBagConstraints = new java.awt.GridBagConstraints (); 211 gridBagConstraints.gridx = 1; 212 gridBagConstraints.gridy = 3; 213 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 214 gridBagConstraints.weightx = 1.0; 215 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 216 add(homeTF, gridBagConstraints); 217 218 interfaceLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbInterface_mnem").charAt(0)); 219 interfaceLabel.setLabelFor(interfaceTF); 220 interfaceLabel.setText(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbRemote")); 221 gridBagConstraints = new java.awt.GridBagConstraints (); 222 gridBagConstraints.gridx = 0; 223 gridBagConstraints.gridy = 4; 224 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 225 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 226 add(interfaceLabel, gridBagConstraints); 227 228 interfaceTF.setColumns(20); 229 gridBagConstraints = new java.awt.GridBagConstraints (); 230 gridBagConstraints.gridx = 1; 231 gridBagConstraints.gridy = 4; 232 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 233 gridBagConstraints.weightx = 1.0; 234 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 235 add(interfaceTF, gridBagConstraints); 236 237 linkLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbLink_mnem").charAt(0)); 238 linkLabel.setLabelFor(linkTF); 239 linkLabel.setText(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbLink")); 240 gridBagConstraints = new java.awt.GridBagConstraints (); 241 gridBagConstraints.gridx = 0; 242 gridBagConstraints.gridy = 5; 243 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 244 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 245 add(linkLabel, gridBagConstraints); 246 247 linkTF.setColumns(20); 248 gridBagConstraints = new java.awt.GridBagConstraints (); 249 gridBagConstraints.gridx = 1; 250 gridBagConstraints.gridy = 5; 251 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 252 gridBagConstraints.weightx = 1.0; 253 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 254 add(linkTF, gridBagConstraints); 255 256 descriptionLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_description_mnem").charAt(0)); 257 descriptionLabel.setLabelFor(descriptionTA); 258 descriptionLabel.setText(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_description")); 259 gridBagConstraints = new java.awt.GridBagConstraints (); 260 gridBagConstraints.gridx = 0; 261 gridBagConstraints.gridy = 6; 262 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 263 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 264 add(descriptionLabel, gridBagConstraints); 265 266 descriptionTA.setRows(3); 267 gridBagConstraints = new java.awt.GridBagConstraints (); 268 gridBagConstraints.gridx = 1; 269 gridBagConstraints.gridy = 6; 270 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 271 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 272 add(descriptionTA, gridBagConstraints); 273 274 } 275 277 private void interfaceTypeCBItemStateChanged(java.awt.event.ItemEvent evt) { if ("Remote".equals(interfaceTypeCB.getSelectedItem())) { interfaceLabel.setText(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbRemote")); 281 } else { 282 interfaceLabel.setText(org.openide.util.NbBundle.getMessage(EjbRefPanel.class, "LBL_EjbLocal")); 283 } 284 } 286 287 private javax.swing.JComboBox beanTypeCB; 289 private javax.swing.JLabel beanTypeLabel; 290 private javax.swing.ButtonGroup buttonGroup1; 291 private javax.swing.JLabel descriptionLabel; 292 private javax.swing.JTextArea descriptionTA; 293 private javax.swing.JLabel homeLabel; 294 private javax.swing.JTextField homeTF; 295 private javax.swing.JLabel interfaceLabel; 296 private javax.swing.JTextField interfaceTF; 297 private javax.swing.JComboBox interfaceTypeCB; 298 private javax.swing.JLabel interfaceTypeLabel; 299 private javax.swing.JLabel linkLabel; 300 private javax.swing.JTextField linkTF; 301 private javax.swing.JLabel nameLabel; 302 private javax.swing.JTextField nameTF; 303 305 } 306 | Popular Tags |