1 19 24 25 package org.netbeans.modules.j2ee.sun.ide.editors; 26 27 import java.util.ResourceBundle ; 28 import org.netbeans.modules.j2ee.sun.ide.editors.ui.DDTableModelEditor; 29 30 import org.netbeans.modules.j2ee.sun.ide.editors.NameValuePair; 31 32 36 public class NameValuePairEditor extends javax.swing.JPanel implements DDTableModelEditor { 37 38 static final ResourceBundle bundle = 39 ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/editors/Bundle"); 40 41 42 public NameValuePairEditor() { 43 initComponents(); 44 getAccessibleContext().setAccessibleName(bundle.getString("LBL_NameValuePairEditorName")); getAccessibleContext().setAccessibleDescription(bundle.getString("LBL_NameValuePairEditorDescription")); 48 nameField.getAccessibleContext().setAccessibleDescription(bundle.getString("colHdrParamName")); valueField.getAccessibleContext().setAccessibleDescription(bundle.getString("colHdrParamValue")); } 52 53 58 private void initComponents() { 59 java.awt.GridBagConstraints gridBagConstraints; 60 61 iLabel1 = new javax.swing.JLabel (); 62 nameField = new javax.swing.JTextField (); 63 iLabel3 = new javax.swing.JLabel (); 66 valueField = new javax.swing.JTextField (); 67 68 setLayout(new java.awt.GridBagLayout ()); 69 70 iLabel1.setForeground(java.awt.Color.black); 71 iLabel1.setText(bundle.getString("colHdrParamName")); iLabel1.setLabelFor(nameField); 73 iLabel1.setDisplayedMnemonic(bundle.getString("colHdrParamName_Mnemonic").charAt(0)); gridBagConstraints = new java.awt.GridBagConstraints (); 75 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 76 add(iLabel1, gridBagConstraints); 77 78 nameField.setColumns(40); 79 nameField.setText("jTextField1"); nameField.addActionListener(new java.awt.event.ActionListener () { 81 public void actionPerformed(java.awt.event.ActionEvent evt) { 82 nameFieldActionPerformed(evt); 83 } 84 }); 85 86 gridBagConstraints = new java.awt.GridBagConstraints (); 87 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 88 add(nameField, gridBagConstraints); 89 90 114 115 iLabel3.setForeground(java.awt.Color.black); 116 iLabel3.setText(bundle.getString("colHdrParamValue")); iLabel3.setLabelFor(valueField); 118 iLabel3.setDisplayedMnemonic(bundle.getString("colHdrParamValue_Mnemonic").charAt(0)); gridBagConstraints = new java.awt.GridBagConstraints (); 120 gridBagConstraints.gridx = 0; 121 gridBagConstraints.gridy = 1; 123 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 124 add(iLabel3, gridBagConstraints); 125 126 valueField.setColumns(40); 127 valueField.setText("jTextField3"); valueField.addActionListener(new java.awt.event.ActionListener () { 129 public void actionPerformed(java.awt.event.ActionEvent evt) { 130 valueFieldActionPerformed(evt); 131 } 132 }); 133 134 gridBagConstraints = new java.awt.GridBagConstraints (); 135 gridBagConstraints.gridx = 1; 136 gridBagConstraints.gridy = 1; 138 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 139 add(valueField, gridBagConstraints); 140 141 } 142 143 private void valueFieldActionPerformed(java.awt.event.ActionEvent evt) { } 147 private void nameFieldActionPerformed(java.awt.event.ActionEvent evt) { } 151 154 155 public javax.swing.JPanel getPanel() { 156 return this; 157 } 158 159 public java.lang.Object getValue() { 160 NameValuePair retVal = new NameValuePair(); 161 retVal.setParamName((String )nameField.getText()); 162 retVal.setParamValue((String )valueField.getText()); 164 return retVal; 165 } 166 167 public void setValue(java.lang.Object obj) { 168 NameValuePair inVal; 169 try { 170 inVal = (NameValuePair) obj; 171 nameField.setText(inVal.getParamName()); 172 valueField.setText(inVal.getParamValue()); 174 }catch (ClassCastException cce) { 175 } 176 } 177 178 private javax.swing.JLabel iLabel3; 180 private javax.swing.JTextField nameField; 182 private javax.swing.JTextField valueField; 183 private javax.swing.JLabel iLabel2; 184 private javax.swing.JLabel iLabel1; 185 187 } 188 | Popular Tags |