1 19 20 package org.netbeans.modules.j2ee.ddloaders.web.multiview; 21 22 import org.openide.util.NbBundle; 23 24 31 public class EnvEntryPanel extends javax.swing.JPanel { 32 33 34 public EnvEntryPanel() { 35 initComponents(); 36 org.netbeans.modules.xml.multiview.Utils.makeTextAreaLikeTextField(descriptionTA, nameTF); 37 } 38 39 void setEnvEntryName(String name) { 40 nameTF.setText(name); 41 } 42 43 void setEnvEntryType(String type) { 44 typeCB.setSelectedItem(type); 45 } 46 47 void setEnvEntryValue(String val) { 48 valueTF.setText(val); 49 } 50 51 void setDescription(String val) { 52 descriptionTA.setText(val); 53 } 54 55 String getEnvEntryName() { 56 return nameTF.getText(); 57 } 58 59 String getEnvEntryType() { 60 return (String )typeCB.getSelectedItem(); 61 } 62 63 String getEnvEntryValue() { 64 return valueTF.getText(); 65 } 66 67 String getDescription() { 68 return descriptionTA.getText(); 69 } 70 71 javax.swing.JTextField getNameTF() { 72 return nameTF; 73 } 74 75 80 private void initComponents() { 82 java.awt.GridBagConstraints gridBagConstraints; 83 84 buttonGroup1 = new javax.swing.ButtonGroup (); 85 nameLabel = new javax.swing.JLabel (); 86 nameTF = new javax.swing.JTextField (); 87 typeLabel = new javax.swing.JLabel (); 88 typeCB = new javax.swing.JComboBox (); 89 valueLabel = new javax.swing.JLabel (); 90 valueTF = new javax.swing.JTextField (); 91 descriptionLabel = new javax.swing.JLabel (); 92 descriptionTA = new javax.swing.JTextArea (); 93 94 setLayout(new java.awt.GridBagLayout ()); 95 96 nameLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryName_mnem").charAt(0)); 97 nameLabel.setLabelFor(nameTF); 98 nameLabel.setText(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryName")); 99 gridBagConstraints = new java.awt.GridBagConstraints (); 100 gridBagConstraints.gridx = 0; 101 gridBagConstraints.gridy = 0; 102 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 103 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 104 add(nameLabel, gridBagConstraints); 105 106 nameTF.setColumns(20); 107 gridBagConstraints = new java.awt.GridBagConstraints (); 108 gridBagConstraints.gridx = 1; 109 gridBagConstraints.gridy = 0; 110 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 111 gridBagConstraints.weightx = 1.0; 112 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 113 add(nameTF, gridBagConstraints); 114 115 typeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryType_mnem").charAt(0)); 116 typeLabel.setLabelFor(typeCB); 117 typeLabel.setText(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryType")); 118 gridBagConstraints = new java.awt.GridBagConstraints (); 119 gridBagConstraints.gridx = 0; 120 gridBagConstraints.gridy = 1; 121 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 122 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 123 add(typeLabel, gridBagConstraints); 124 125 typeCB.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "java.lang.String", "java.lang.Boolean", "java.lang.Character", "java.lang.Integer", "java.lang.Byte", "java.lang.Short", "java.lang.Long", "java.lang.Float", "java.lang.Double" })); 126 gridBagConstraints = new java.awt.GridBagConstraints (); 127 gridBagConstraints.gridx = 1; 128 gridBagConstraints.gridy = 1; 129 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 130 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 131 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 132 add(typeCB, gridBagConstraints); 133 134 valueLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryValue_mnem").charAt(0)); 135 valueLabel.setLabelFor(valueTF); 136 valueLabel.setText(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryValue")); 137 gridBagConstraints = new java.awt.GridBagConstraints (); 138 gridBagConstraints.gridx = 0; 139 gridBagConstraints.gridy = 2; 140 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 141 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 142 add(valueLabel, gridBagConstraints); 143 144 gridBagConstraints = new java.awt.GridBagConstraints (); 145 gridBagConstraints.gridx = 1; 146 gridBagConstraints.gridy = 2; 147 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 148 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 149 add(valueTF, gridBagConstraints); 150 151 descriptionLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_description_mnem").charAt(0)); 152 descriptionLabel.setLabelFor(descriptionTA); 153 descriptionLabel.setText(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_description")); 154 gridBagConstraints = new java.awt.GridBagConstraints (); 155 gridBagConstraints.gridx = 0; 156 gridBagConstraints.gridy = 3; 157 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 158 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 159 add(descriptionLabel, gridBagConstraints); 160 161 descriptionTA.setRows(3); 162 gridBagConstraints = new java.awt.GridBagConstraints (); 163 gridBagConstraints.gridx = 1; 164 gridBagConstraints.gridy = 3; 165 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 166 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 167 add(descriptionTA, gridBagConstraints); 168 169 } 170 172 173 private javax.swing.ButtonGroup buttonGroup1; 175 private javax.swing.JLabel descriptionLabel; 176 private javax.swing.JTextArea descriptionTA; 177 private javax.swing.JLabel nameLabel; 178 private javax.swing.JTextField nameTF; 179 private javax.swing.JComboBox typeCB; 180 private javax.swing.JLabel typeLabel; 181 private javax.swing.JLabel valueLabel; 182 private javax.swing.JTextField valueTF; 183 185 } 186 | Popular Tags |