KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > customizers > ejbmodule > CmpEntityEjbPanel


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 /*
20  * CmpEntityEjbPanel.java November 3, 2003, 10:58 AM
21  *
22  */

23
24 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule;
25
26 /**
27  *
28  * @author Rajeshwar Patil
29  * @version %I%, %G%
30  */

31 public class CmpEntityEjbPanel extends javax.swing.JPanel JavaDoc {
32
33     private CmpEntityEjbCustomizer cmpEntityEjbCutomizer;
34
35
36     /** Creates new form CmpEntityEjbPanel */
37     public CmpEntityEjbPanel(CmpEntityEjbCustomizer customizer) {
38         initComponents();
39         this.cmpEntityEjbCutomizer = customizer;
40     }
41
42
43     public void setMappingProperties(String JavaDoc mappingProperties){
44         if(mappingProperties != null){
45             mappingPropertiesTextField.setText(mappingProperties);
46         }
47     }
48
49
50     public String JavaDoc getMappingProperties(){
51         return mappingPropertiesTextField.getText();
52     }
53
54     /** This method is called from within the constructor to
55      * initialize the form.
56      * WARNING: Do NOT modify this code. The content of this method is
57      * always regenerated by the Form Editor.
58      */

59     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
60
private void initComponents() {
61         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
62
63         mappingPropertiesLabel = new javax.swing.JLabel JavaDoc();
64         mappingPropertiesTextField = new javax.swing.JTextField JavaDoc();
65
66         setLayout(new java.awt.GridBagLayout JavaDoc());
67
68         mappingPropertiesLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Mapping_Properties").charAt(0));
69         mappingPropertiesLabel.setLabelFor(mappingPropertiesTextField);
70         mappingPropertiesLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Mapping_Properties_1"));
71         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
72         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
73         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 0);
74         add(mappingPropertiesLabel, gridBagConstraints);
75         mappingPropertiesLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Mapping_Properties_Acsbl_Name"));
76         mappingPropertiesLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Mapping_Properties_Acsbl_Desc"));
77
78         mappingPropertiesTextField.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Mapping_Properties_Tool_Tip"));
79         mappingPropertiesTextField.addActionListener(new java.awt.event.ActionListener JavaDoc() {
80             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
81                 mappingPropertiesActionPerformed(evt);
82             }
83         });
84         mappingPropertiesTextField.addFocusListener(new java.awt.event.FocusAdapter JavaDoc() {
85             public void focusGained(java.awt.event.FocusEvent JavaDoc evt) {
86                 mappingPropertiesFocusGained(evt);
87             }
88             public void focusLost(java.awt.event.FocusEvent JavaDoc evt) {
89                 mappingPropertiesFocusLost(evt);
90             }
91         });
92         mappingPropertiesTextField.addKeyListener(new java.awt.event.KeyAdapter JavaDoc() {
93             public void keyReleased(java.awt.event.KeyEvent JavaDoc evt) {
94                 mappingPropertiesKeyReleased(evt);
95             }
96         });
97
98         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
99         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
100         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
101         gridBagConstraints.weightx = 1.0;
102         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 5);
103         add(mappingPropertiesTextField, gridBagConstraints);
104         mappingPropertiesTextField.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Mapping_Properties_Acsbl_Name"));
105         mappingPropertiesTextField.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Mapping_Properties_Acsbl_Desc"));
106
107     }// </editor-fold>//GEN-END:initComponents
108

109     private void mappingPropertiesFocusLost(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_mappingPropertiesFocusLost
110
// Add your handling code here:
111
cmpEntityEjbCutomizer.validateEntries();
112     }//GEN-LAST:event_mappingPropertiesFocusLost
113

114     private void mappingPropertiesFocusGained(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_mappingPropertiesFocusGained
115
// Add your handling code here:
116
cmpEntityEjbCutomizer.validateEntries();
117     }//GEN-LAST:event_mappingPropertiesFocusGained
118

119     private void mappingPropertiesActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_mappingPropertiesActionPerformed
120
// Add your handling code here:
121
cmpEntityEjbCutomizer.validateEntries();
122     }//GEN-LAST:event_mappingPropertiesActionPerformed
123

124     private void mappingPropertiesKeyReleased(java.awt.event.KeyEvent JavaDoc evt) {//GEN-FIRST:event_mappingPropertiesKeyReleased
125
// Add your handling code here:
126
String JavaDoc item = mappingPropertiesTextField.getText();
127         cmpEntityEjbCutomizer.updateMappingProperties(item);
128         cmpEntityEjbCutomizer.validateEntries();
129     }//GEN-LAST:event_mappingPropertiesKeyReleased
130

131
132     // Variables declaration - do not modify//GEN-BEGIN:variables
133
private javax.swing.JLabel JavaDoc mappingPropertiesLabel;
134     private javax.swing.JTextField JavaDoc mappingPropertiesTextField;
135     // End of variables declaration//GEN-END:variables
136

137 }
138
Popular Tags