KickJava   Java API By Example, From Geeks To Geeks.

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


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  * EntityEjbPanel.java Feb 20, 2005, 6:11 PM
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 StatefulEjbPanel extends javax.swing.JPanel JavaDoc {
32
33     private StatefulEjbCustomizer statefulEjbCutomizer;
34
35
36     /** Creates new form StatefulEjbPanel */
37     public StatefulEjbPanel(StatefulEjbCustomizer customizer) {
38         initComponents();
39         this.statefulEjbCutomizer = customizer;
40     }
41
42
43     public void setAvailabilityEnabled(String JavaDoc availabilityEnabled){
44         if(availabilityEnabled != null){
45             availabilityEnabledComboBox.setSelectedItem(availabilityEnabled);
46         }
47     }
48
49
50     public String JavaDoc getAvailabilityEnabled(){
51         return (String JavaDoc)availabilityEnabledComboBox.getSelectedItem();
52     }
53
54
55     /** This method is called from within the constructor to
56      * initialize the form.
57      * WARNING: Do NOT modify this code. The content of this method is
58      * always regenerated by the Form Editor.
59      */

60     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
61
private void initComponents() {
62         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
63
64         availabilityEnabledLabel = new javax.swing.JLabel JavaDoc();
65         availabilityEnabledComboBox = new javax.swing.JComboBox JavaDoc();
66
67         setLayout(new java.awt.GridBagLayout JavaDoc());
68
69         availabilityEnabledLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Avaiability_Enabled").charAt(0));
70         availabilityEnabledLabel.setLabelFor(availabilityEnabledComboBox);
71         availabilityEnabledLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Availability_Enabled"));
72         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
73         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
74         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 0);
75         add(availabilityEnabledLabel, gridBagConstraints);
76         availabilityEnabledLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Availability_Enabled_Acsbl_Name"));
77         availabilityEnabledLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Availability_Enabled_Acsbl_Desc"));
78
79         availabilityEnabledComboBox.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "", "true", "false" }));
80         availabilityEnabledComboBox.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Availability_Enabled_Tool_Tip"));
81         availabilityEnabledComboBox.addItemListener(new java.awt.event.ItemListener JavaDoc() {
82             public void itemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {
83                 availabilityEnabledItemStateChanged(evt);
84             }
85         });
86
87         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
88         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
89         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
90         gridBagConstraints.ipadx = 72;
91         gridBagConstraints.weightx = 1.0;
92         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 5);
93         add(availabilityEnabledComboBox, gridBagConstraints);
94         availabilityEnabledComboBox.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Availability_Enabled_Acsbl_Name"));
95         availabilityEnabledComboBox.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Availability_Enabled_Acsbl_Desc"));
96
97     }// </editor-fold>//GEN-END:initComponents
98

99     private void availabilityEnabledItemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {//GEN-FIRST:event_availabilityEnabledItemStateChanged
100
// Add your handling code here:
101
String JavaDoc item = (String JavaDoc)availabilityEnabledComboBox.getSelectedItem();
102         statefulEjbCutomizer.updateAvailabilityEnabled(item);
103         statefulEjbCutomizer.validateEntries();
104     }//GEN-LAST:event_availabilityEnabledItemStateChanged
105

106
107     // Variables declaration - do not modify//GEN-BEGIN:variables
108
private javax.swing.JComboBox JavaDoc availabilityEnabledComboBox;
109     private javax.swing.JLabel JavaDoc availabilityEnabledLabel;
110     // End of variables declaration//GEN-END:variables
111

112 }
113
Popular Tags