1 19 20 package org.netbeans.modules.j2ee.ddloaders.web.multiview; 21 22 29 public class ResRefPanel extends javax.swing.JPanel { 30 31 32 public ResRefPanel() { 33 initComponents(); 34 org.netbeans.modules.xml.multiview.Utils.makeTextAreaLikeTextField(descriptionTA, nameTF); 35 } 36 37 void setResRefName(String name) { 38 nameTF.setText(name); 39 } 40 41 void setResType(String value) { 42 typeCB.setSelectedItem(value); 43 } 44 45 void setResAuth(String value) { 46 authCB.setSelectedItem(value); 47 } 48 49 void setResScope(String value) { 50 scopeCB.setSelectedItem(value); 51 } 52 53 void setDescription(String value) { 54 descriptionTA.setText(value); 55 } 56 57 String getResRefName() { 58 return nameTF.getText(); 59 } 60 61 String getResType() { 62 return (String )typeCB.getEditor().getItem(); 63 } 64 65 String getResAuth() { 66 return (String )authCB.getSelectedItem(); 67 } 68 69 String getResScope() { 70 return (String )scopeCB.getSelectedItem(); 71 } 72 73 String getDescription() { 74 return descriptionTA.getText(); 75 } 76 77 javax.swing.JTextField getNameTF() { 78 return nameTF; 79 } 80 81 javax.swing.JTextField getTypeTF() { 82 return (javax.swing.JTextField )typeCB.getEditor().getEditorComponent(); 83 } 84 85 90 private void initComponents() { 92 java.awt.GridBagConstraints gridBagConstraints; 93 94 buttonGroup1 = new javax.swing.ButtonGroup (); 95 nameLabel = new javax.swing.JLabel (); 96 nameTF = new javax.swing.JTextField (); 97 typeLabel = new javax.swing.JLabel (); 98 typeCB = new javax.swing.JComboBox (); 99 authLabel = new javax.swing.JLabel (); 100 authCB = new javax.swing.JComboBox (); 101 scopeLabel = new javax.swing.JLabel (); 102 scopeCB = new javax.swing.JComboBox (); 103 descriptionLabel = new javax.swing.JLabel (); 104 descriptionTA = new javax.swing.JTextArea (); 105 106 setLayout(new java.awt.GridBagLayout ()); 107 108 nameLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResRefName_mnem").charAt(0)); 109 nameLabel.setLabelFor(nameTF); 110 nameLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResRefName")); 111 gridBagConstraints = new java.awt.GridBagConstraints (); 112 gridBagConstraints.gridx = 0; 113 gridBagConstraints.gridy = 0; 114 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 115 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 116 add(nameLabel, gridBagConstraints); 117 118 nameTF.setColumns(20); 119 gridBagConstraints = new java.awt.GridBagConstraints (); 120 gridBagConstraints.gridx = 1; 121 gridBagConstraints.gridy = 0; 122 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 123 gridBagConstraints.weightx = 1.0; 124 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 125 add(nameTF, gridBagConstraints); 126 127 typeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResType_mnem").charAt(0)); 128 typeLabel.setLabelFor(typeCB); 129 typeLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResType")); 130 gridBagConstraints = new java.awt.GridBagConstraints (); 131 gridBagConstraints.gridx = 0; 132 gridBagConstraints.gridy = 1; 133 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 134 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 135 add(typeLabel, gridBagConstraints); 136 137 typeCB.setEditable(true); 138 typeCB.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "javax.sql.DataSource", "javax.jms.ConnectionFactory", "javax.mail.Session", "java.net.URL" })); 139 gridBagConstraints = new java.awt.GridBagConstraints (); 140 gridBagConstraints.gridx = 1; 141 gridBagConstraints.gridy = 1; 142 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 143 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 144 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 145 add(typeCB, gridBagConstraints); 146 147 authLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResAuth_mnem").charAt(0)); 148 authLabel.setLabelFor(authCB); 149 authLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResAuth")); 150 gridBagConstraints = new java.awt.GridBagConstraints (); 151 gridBagConstraints.gridx = 0; 152 gridBagConstraints.gridy = 2; 153 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 154 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 155 add(authLabel, gridBagConstraints); 156 157 authCB.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "Container", "Application" })); 158 gridBagConstraints = new java.awt.GridBagConstraints (); 159 gridBagConstraints.gridx = 1; 160 gridBagConstraints.gridy = 2; 161 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 162 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 163 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 164 add(authCB, gridBagConstraints); 165 166 scopeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResSharingScope_mnem").charAt(0)); 167 scopeLabel.setLabelFor(scopeCB); 168 scopeLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResSharingScope")); 169 gridBagConstraints = new java.awt.GridBagConstraints (); 170 gridBagConstraints.gridx = 0; 171 gridBagConstraints.gridy = 3; 172 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 173 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 174 add(scopeLabel, gridBagConstraints); 175 176 scopeCB.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "Shareable", "Unshareable" })); 177 gridBagConstraints = new java.awt.GridBagConstraints (); 178 gridBagConstraints.gridx = 1; 179 gridBagConstraints.gridy = 3; 180 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 181 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 182 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 183 add(scopeCB, gridBagConstraints); 184 185 descriptionLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_description_mnem").charAt(0)); 186 descriptionLabel.setLabelFor(descriptionTA); 187 descriptionLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_description")); 188 gridBagConstraints = new java.awt.GridBagConstraints (); 189 gridBagConstraints.gridx = 0; 190 gridBagConstraints.gridy = 4; 191 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 192 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 193 add(descriptionLabel, gridBagConstraints); 194 195 descriptionTA.setRows(3); 196 gridBagConstraints = new java.awt.GridBagConstraints (); 197 gridBagConstraints.gridx = 1; 198 gridBagConstraints.gridy = 4; 199 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 200 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 201 add(descriptionTA, gridBagConstraints); 202 203 } 204 206 207 private javax.swing.JComboBox authCB; 209 private javax.swing.JLabel authLabel; 210 private javax.swing.ButtonGroup buttonGroup1; 211 private javax.swing.JLabel descriptionLabel; 212 private javax.swing.JTextArea descriptionTA; 213 private javax.swing.JLabel nameLabel; 214 private javax.swing.JTextField nameTF; 215 private javax.swing.JComboBox scopeCB; 216 private javax.swing.JLabel scopeLabel; 217 private javax.swing.JComboBox typeCB; 218 private javax.swing.JLabel typeLabel; 219 221 } 222 | Popular Tags |