1 19 package org.netbeans.modules.j2ee.websphere6.dd.loaders.ui; 20 21 import org.netbeans.modules.j2ee.websphere6.dd.beans.DDXmiConstants; 22 26 public class CMPConnectionFactory extends javax.swing.JPanel { 27 28 31 public CMPConnectionFactory() { 32 initComponents(); 33 authTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel (DDXmiConstants.CMP_RES_AUTH_TYPES)); 34 35 } 36 37 42 private void initComponents() { 44 java.awt.GridBagConstraints gridBagConstraints; 45 46 factoryCheckBox = new javax.swing.JCheckBox (); 47 nameLabel = new javax.swing.JLabel (); 48 nameField = new javax.swing.JTextField (); 49 typeLabel = new javax.swing.JLabel (); 50 authTypeComboBox = new javax.swing.JComboBox (); 51 jndiLabel = new javax.swing.JLabel (); 52 jndiNameField = new javax.swing.JTextField (); 53 54 setLayout(new java.awt.GridBagLayout ()); 55 56 setPreferredSize(new java.awt.Dimension (150, 22)); 57 factoryCheckBox.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/websphere6/dd/loaders/ui/Bundle").getString("LBL_CMPConnectionFactory")); 58 factoryCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 59 factoryCheckBox.setMargin(new java.awt.Insets (0, 0, 0, 0)); 60 factoryCheckBox.setMinimumSize(new java.awt.Dimension (40, 15)); 61 factoryCheckBox.setPreferredSize(new java.awt.Dimension (150, 15)); 62 factoryCheckBox.addActionListener(new java.awt.event.ActionListener () { 63 public void actionPerformed(java.awt.event.ActionEvent evt) { 64 factoryCheckBoxActionPerformed(evt); 65 } 66 }); 67 68 gridBagConstraints = new java.awt.GridBagConstraints (); 69 gridBagConstraints.gridx = 0; 70 gridBagConstraints.gridy = 0; 71 gridBagConstraints.gridwidth = 3; 72 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 73 gridBagConstraints.ipadx = 20; 74 gridBagConstraints.ipady = 8; 75 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 76 gridBagConstraints.insets = new java.awt.Insets (0, 11, 0, 26); 77 add(factoryCheckBox, gridBagConstraints); 78 79 nameLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); 80 nameLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/websphere6/dd/loaders/ui/Bundle").getString("LBL_Name")); 81 gridBagConstraints = new java.awt.GridBagConstraints (); 82 gridBagConstraints.gridx = 0; 83 gridBagConstraints.gridy = 1; 84 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 85 gridBagConstraints.insets = new java.awt.Insets (5, 14, 0, 6); 86 add(nameLabel, gridBagConstraints); 87 88 gridBagConstraints = new java.awt.GridBagConstraints (); 89 gridBagConstraints.gridx = 2; 90 gridBagConstraints.gridy = 1; 91 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 92 gridBagConstraints.weightx = 1.0; 93 gridBagConstraints.insets = new java.awt.Insets (0, 1, 0, 10); 94 add(nameField, gridBagConstraints); 95 96 typeLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); 97 typeLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/websphere6/dd/loaders/ui/Bundle").getString("LBL_CmpAuthType")); 98 gridBagConstraints = new java.awt.GridBagConstraints (); 99 gridBagConstraints.gridx = 0; 100 gridBagConstraints.gridy = 3; 101 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 102 gridBagConstraints.insets = new java.awt.Insets (5, 14, 0, 6); 103 add(typeLabel, gridBagConstraints); 104 105 authTypeComboBox.setPreferredSize(new java.awt.Dimension (150, 22)); 106 gridBagConstraints = new java.awt.GridBagConstraints (); 107 gridBagConstraints.gridx = 2; 108 gridBagConstraints.gridy = 3; 109 gridBagConstraints.ipadx = 36; 110 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 111 gridBagConstraints.insets = new java.awt.Insets (0, 1, 0, 10); 112 add(authTypeComboBox, gridBagConstraints); 113 114 jndiLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/websphere6/dd/loaders/ui/Bundle").getString("LBL_JndiName")); 115 gridBagConstraints = new java.awt.GridBagConstraints (); 116 gridBagConstraints.gridx = 0; 117 gridBagConstraints.gridy = 2; 118 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 119 gridBagConstraints.insets = new java.awt.Insets (5, 14, 0, 6); 120 add(jndiLabel, gridBagConstraints); 121 122 gridBagConstraints = new java.awt.GridBagConstraints (); 123 gridBagConstraints.gridx = 2; 124 gridBagConstraints.gridy = 2; 125 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 126 gridBagConstraints.weightx = 1.0; 127 gridBagConstraints.insets = new java.awt.Insets (0, 1, 0, 10); 128 add(jndiNameField, gridBagConstraints); 129 130 } 132 private void factoryCheckBoxActionPerformed(java.awt.event.ActionEvent evt) { } 136 137 private javax.swing.JComboBox authTypeComboBox; 139 private javax.swing.JCheckBox factoryCheckBox; 140 private javax.swing.JLabel jndiLabel; 141 private javax.swing.JTextField jndiNameField; 142 private javax.swing.JTextField nameField; 143 private javax.swing.JLabel nameLabel; 144 private javax.swing.JLabel typeLabel; 145 147 public void setEnabledComponents() { 148 boolean state=factoryCheckBox.isSelected(); 149 nameLabel.setEnabled(state); 150 nameField.setEnabled(state); 151 152 jndiLabel.setEnabled(state); 153 jndiNameField.setEnabled(state); 154 155 typeLabel.setEnabled(state); 156 authTypeComboBox.setEnabled(state); 157 } 158 public javax.swing.JComboBox getAuthTypeComboBox(){ 159 return authTypeComboBox; 160 } 161 public javax.swing.JCheckBox getFactoryCheckBox(){ 162 return factoryCheckBox; 163 } 164 165 public javax.swing.JTextField getNameField() { 166 return nameField; 167 } 168 public javax.swing.JLabel getNameLabel() { 169 return nameLabel; 170 } 171 public javax.swing.JTextField getJndiNameField() { 172 return jndiNameField; 173 } 174 public void setComponentsBackground(java.awt.Color c) { 175 nameLabel.setBackground(c); 176 jndiLabel.setBackground(c); 177 typeLabel.setBackground(c); 178 factoryCheckBox.setBackground(c); 179 setBackground(c); 180 } 181 } 182 183 | Popular Tags |