KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > websphere6 > dd > loaders > ui > CMPConnectionFactory


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.j2ee.websphere6.dd.loaders.ui;
20
21 import org.netbeans.modules.j2ee.websphere6.dd.beans.DDXmiConstants;
22 /**
23  *
24  * @author dlm198383
25  */

26 public class CMPConnectionFactory extends javax.swing.JPanel JavaDoc {
27
28     /**
29      * Creates new form LocalTransactionPanel
30      */

31     public CMPConnectionFactory() {
32         initComponents();
33         authTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(DDXmiConstants.CMP_RES_AUTH_TYPES));
34
35     }
36
37     /** This method is called from within the constructor to
38      * initialize the form.
39      * WARNING: Do NOT modify this code. The content of this method is
40      * always regenerated by the Form Editor.
41      */

42     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
43
private void initComponents() {
44         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
45
46         factoryCheckBox = new javax.swing.JCheckBox JavaDoc();
47         nameLabel = new javax.swing.JLabel JavaDoc();
48         nameField = new javax.swing.JTextField JavaDoc();
49         typeLabel = new javax.swing.JLabel JavaDoc();
50         authTypeComboBox = new javax.swing.JComboBox JavaDoc();
51         jndiLabel = new javax.swing.JLabel JavaDoc();
52         jndiNameField = new javax.swing.JTextField JavaDoc();
53
54         setLayout(new java.awt.GridBagLayout JavaDoc());
55
56         setPreferredSize(new java.awt.Dimension JavaDoc(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 JavaDoc(0, 0, 0, 0));
60         factoryCheckBox.setMinimumSize(new java.awt.Dimension JavaDoc(40, 15));
61         factoryCheckBox.setPreferredSize(new java.awt.Dimension JavaDoc(150, 15));
62         factoryCheckBox.addActionListener(new java.awt.event.ActionListener JavaDoc() {
63             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
64                 factoryCheckBoxActionPerformed(evt);
65             }
66         });
67
68         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
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 JavaDoc(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 JavaDoc();
82         gridBagConstraints.gridx = 0;
83         gridBagConstraints.gridy = 1;
84         gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
85         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 14, 0, 6);
86         add(nameLabel, gridBagConstraints);
87
88         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
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 JavaDoc(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 JavaDoc();
99         gridBagConstraints.gridx = 0;
100         gridBagConstraints.gridy = 3;
101         gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
102         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 14, 0, 6);
103         add(typeLabel, gridBagConstraints);
104
105         authTypeComboBox.setPreferredSize(new java.awt.Dimension JavaDoc(150, 22));
106         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
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 JavaDoc(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 JavaDoc();
116         gridBagConstraints.gridx = 0;
117         gridBagConstraints.gridy = 2;
118         gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
119         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 14, 0, 6);
120         add(jndiLabel, gridBagConstraints);
121
122         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
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 JavaDoc(0, 1, 0, 10);
128         add(jndiNameField, gridBagConstraints);
129
130     }// </editor-fold>//GEN-END:initComponents
131

132     private void factoryCheckBoxActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_factoryCheckBoxActionPerformed
133
// TODO add your handling code here:
134
}//GEN-LAST:event_factoryCheckBoxActionPerformed
135

136     
137     // Variables declaration - do not modify//GEN-BEGIN:variables
138
private javax.swing.JComboBox JavaDoc authTypeComboBox;
139     private javax.swing.JCheckBox JavaDoc factoryCheckBox;
140     private javax.swing.JLabel JavaDoc jndiLabel;
141     private javax.swing.JTextField JavaDoc jndiNameField;
142     private javax.swing.JTextField JavaDoc nameField;
143     private javax.swing.JLabel JavaDoc nameLabel;
144     private javax.swing.JLabel JavaDoc typeLabel;
145     // End of variables declaration//GEN-END:variables
146

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 JavaDoc getAuthTypeComboBox(){
159         return authTypeComboBox;
160     }
161     public javax.swing.JCheckBox JavaDoc getFactoryCheckBox(){
162         return factoryCheckBox;
163     }
164     
165     public javax.swing.JTextField JavaDoc getNameField() {
166         return nameField;
167     }
168     public javax.swing.JLabel JavaDoc getNameLabel() {
169         return nameLabel;
170     }
171     public javax.swing.JTextField JavaDoc getJndiNameField() {
172         return jndiNameField;
173     }
174     public void setComponentsBackground(java.awt.Color JavaDoc 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