KickJava   Java API By Example, From Geeks To Geeks.

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


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  * BeanCachePanel.java October 22, 2003, 1:07 PM
21  *
22  */

23
24 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule;
25
26 import java.util.ArrayList JavaDoc;
27 import java.util.ResourceBundle JavaDoc;
28
29 import org.netbeans.modules.j2ee.sun.dd.api.ejb.BeanCache;
30
31 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.BaseCustomizer;
32 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.ErrorSupport;
33 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.ErrorSupportClient;
34 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.ValidationSupport;
35
36 /**
37  *
38  * @author Rajeshwar Patil
39  * @version %I%, %G%
40  */

41
42 public class BeanCachePanel extends javax.swing.JPanel JavaDoc
43         implements ErrorSupportClient {
44
45     private EjbCustomizer customizer;
46     protected ErrorSupport errorSupport;
47     protected ValidationSupport validationSupport;
48     
49     static final ResourceBundle JavaDoc bundle =
50         ResourceBundle.getBundle(
51             "org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule.Bundle"); // NOI18N
52

53
54     /** Creates new form BeanCachePanel */
55     public BeanCachePanel(EjbCustomizer customizer){
56         initComponents();
57         this.customizer = customizer;
58         errorSupport = new ErrorSupport(this);
59         validationSupport = new ValidationSupport();
60     }
61
62
63     public void setValues(BeanCache beanCache){
64         if(beanCache != null){
65             maxCacheSizeTextField.setText(beanCache.getMaxCacheSize());
66             resizeQuantityTextField.setText(beanCache.getResizeQuantity());
67             isCacheOverflowAllowedComboBox.setSelectedItem(
68                 beanCache.getIsCacheOverflowAllowed());
69             cacheIdleTimeoutInSecondsTextField.setText(
70                 beanCache.getCacheIdleTimeoutInSeconds());
71             removalTimeoutInSecondsTextField.setText(
72                 beanCache.getRemovalTimeoutInSeconds());
73             victimSelectionPolicyComboBox.setSelectedItem(
74                 beanCache.getVictimSelectionPolicy());
75         }
76     }
77
78
79     public java.awt.Container JavaDoc getErrorPanelParent(){
80         return this;
81     }
82
83
84     public java.awt.GridBagConstraints JavaDoc getErrorPanelConstraints(){
85         java.awt.GridBagConstraints JavaDoc gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
86         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
87         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
88         gridBagConstraints.weightx = 1.0;
89         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6,12,11,11);
90         return gridBagConstraints;
91     }
92
93
94     public java.util.Collection JavaDoc getErrors(){
95         if(validationSupport == null) assert(false);
96         ArrayList JavaDoc errors = new ArrayList JavaDoc();
97         
98         //Bean Cache fields Validation
99
String JavaDoc property = maxCacheSizeTextField.getText();
100         errors.addAll(validationSupport.validate(property,
101             "/sun-ejb-jar/enterprise-beans/ejb/bean-cache/max-cache-size", //NOI18N
102
bundle.getString("LBL_Max_Cache_Size"))); //NOI18N
103

104         property = resizeQuantityTextField.getText();
105         errors.addAll(validationSupport.validate(property,
106             "/sun-ejb-jar/enterprise-beans/ejb/bean-cache/resize-quantity", //NOI18N
107
bundle.getString("LBL_Resize_Quantity"))); //NOI18N
108

109
110         property = (String JavaDoc)isCacheOverflowAllowedComboBox.getSelectedItem();
111         errors.addAll(validationSupport.validate(property,
112             "/sun-ejb-jar/enterprise-beans/ejb/bean-cache/is-cache-overflow-allowed", //NOI18N
113
bundle.getString("LBL_Is_Cache_Overflow_Allowed"))); //NOI18N
114

115         property = cacheIdleTimeoutInSecondsTextField.getText();
116         errors.addAll(validationSupport.validate(property,
117             "/sun-ejb-jar/enterprise-beans/ejb/bean-cache/cache-idle-timeout-in-seconds", //NOI18N
118
bundle.getString("LBL_Cache_Idle_Timeout_In_Seconds"))); //NOI18N
119

120         property = removalTimeoutInSecondsTextField.getText();
121         errors.addAll(validationSupport.validate(property,
122             "/sun-ejb-jar/enterprise-beans/ejb/bean-cache/removal-timeout-in-seconds", //NOI18N
123
bundle.getString("LBL_Removal_Timeout_In_Seconds"))); //NOI18N
124

125         property = (String JavaDoc)victimSelectionPolicyComboBox.getSelectedItem();
126         errors.addAll(validationSupport.validate(property,
127             "/sun-ejb-jar/enterprise-beans/ejb/bean-cache/victim-selection-policy", //NOI18N
128
bundle.getString("LBL_Victim_Selection_Policy"))); //NOI18N
129

130         return errors;
131     }
132     
133     public java.awt.Color JavaDoc getMessageForegroundColor() {
134         return BaseCustomizer.getErrorForegroundColor();
135     }
136     
137     private void validateEntries(){
138         if(errorSupport != null){
139             errorSupport.showErrors();
140         }
141     }
142
143
144     /** This method is called from within the constructor to
145      * initialize the form.
146      * WARNING: Do NOT modify this code. The content of this method is
147      * always regenerated by the Form Editor.
148      */

149     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
150
private void initComponents() {
151         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
152
153         maxCacheSizeLabel = new javax.swing.JLabel JavaDoc();
154         maxCacheSizeTextField = new javax.swing.JTextField JavaDoc();
155         resizeQuantityLabel = new javax.swing.JLabel JavaDoc();
156         resizeQuantityTextField = new javax.swing.JTextField JavaDoc();
157         isCacheOverflowAllowedLabel = new javax.swing.JLabel JavaDoc();
158         isCacheOverflowAllowedComboBox = new javax.swing.JComboBox JavaDoc();
159         cacheIdleTimeoutInSecondsLabel = new javax.swing.JLabel JavaDoc();
160         cacheIdleTimeoutInSecondsTextField = new javax.swing.JTextField JavaDoc();
161         removalTimeoutInSecondsLabel = new javax.swing.JLabel JavaDoc();
162         removalTimeoutInSecondsTextField = new javax.swing.JTextField JavaDoc();
163         victimSelectionPolicyLabel = new javax.swing.JLabel JavaDoc();
164         victimSelectionPolicyComboBox = new javax.swing.JComboBox JavaDoc();
165         fillerPanel = new javax.swing.JPanel JavaDoc();
166
167         setLayout(new java.awt.GridBagLayout JavaDoc());
168
169         maxCacheSizeLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Max_Cache_Size").charAt(0));
170         maxCacheSizeLabel.setLabelFor(maxCacheSizeTextField);
171         maxCacheSizeLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Max_Cache_Size_1"));
172         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
173         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
174         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
175         add(maxCacheSizeLabel, gridBagConstraints);
176         maxCacheSizeLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Max_Cache_Size_Acsbl_Name"));
177         maxCacheSizeLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Max_Cache_Size_Acsbl_Desc"));
178
179         maxCacheSizeTextField.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Max_Cache_Size_Tool_Tip"));
180         maxCacheSizeTextField.addActionListener(new java.awt.event.ActionListener JavaDoc() {
181             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
182                 maxCacheSizeActionPerformed(evt);
183             }
184         });
185         maxCacheSizeTextField.addFocusListener(new java.awt.event.FocusAdapter JavaDoc() {
186             public void focusGained(java.awt.event.FocusEvent JavaDoc evt) {
187                 maxCacheSizeFocusGained(evt);
188             }
189         });
190         maxCacheSizeTextField.addKeyListener(new java.awt.event.KeyAdapter JavaDoc() {
191             public void keyReleased(java.awt.event.KeyEvent JavaDoc evt) {
192                 maxCacheSizeKeyReleased(evt);
193             }
194         });
195
196         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
197         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
198         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
199         gridBagConstraints.weightx = 1.0;
200         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
201         add(maxCacheSizeTextField, gridBagConstraints);
202         maxCacheSizeTextField.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Max_Cache_Size_Acsbl_Name"));
203         maxCacheSizeTextField.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Max_Cache_Size_Acsbl_Desc"));
204
205         resizeQuantityLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Resize_Quantity").charAt(0));
206         resizeQuantityLabel.setLabelFor(resizeQuantityTextField);
207         resizeQuantityLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Resize_Quantity_1"));
208         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
209         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
210         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
211         add(resizeQuantityLabel, gridBagConstraints);
212         resizeQuantityLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Resize_Quantity_Acsbl_Name"));
213         resizeQuantityLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Bean_Cache_Resize_Quantity_Acsbl_Desc"));
214
215         resizeQuantityTextField.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Bean_Cache_Resize_Quantity_Tool_Tip"));
216         resizeQuantityTextField.addActionListener(new java.awt.event.ActionListener JavaDoc() {
217             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
218                 resizeQuantityActionPerformed(evt);
219             }
220         });
221         resizeQuantityTextField.addFocusListener(new java.awt.event.FocusAdapter JavaDoc() {
222             public void focusGained(java.awt.event.FocusEvent JavaDoc evt) {
223                 resizeQuantityFocusGained(evt);
224             }
225         });
226         resizeQuantityTextField.addKeyListener(new java.awt.event.KeyAdapter JavaDoc() {
227             public void keyReleased(java.awt.event.KeyEvent JavaDoc evt) {
228                 resizeQuantityKeyReleased(evt);
229             }
230         });
231
232         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
233         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
234         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
235         gridBagConstraints.weightx = 1.0;
236         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
237         add(resizeQuantityTextField, gridBagConstraints);
238         resizeQuantityTextField.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Resize_Quantity_Acsbl_Name"));
239         resizeQuantityTextField.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Bean_Cache_Resize_Quantity_Acsbl_Desc"));
240
241         isCacheOverflowAllowedLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Is_Cache_Overflow_Allowed").charAt(0));
242         isCacheOverflowAllowedLabel.setLabelFor(isCacheOverflowAllowedComboBox);
243         isCacheOverflowAllowedLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Is_Cache_Overflow_Allowed_1"));
244         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
245         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
246         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
247         add(isCacheOverflowAllowedLabel, gridBagConstraints);
248         isCacheOverflowAllowedLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Is_Cache_Overflow_Allowed_Acsbl_Name"));
249         isCacheOverflowAllowedLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Is_Cache_Overflow_Allowed_Acsbl_Desc"));
250
251         isCacheOverflowAllowedComboBox.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "", "true", "false" }));
252         isCacheOverflowAllowedComboBox.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Is_Cache_Overflow_Allowed_Tool_Tip"));
253         isCacheOverflowAllowedComboBox.addItemListener(new java.awt.event.ItemListener JavaDoc() {
254             public void itemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {
255                 isCacheOverflowAllowedItemStateChanged(evt);
256             }
257         });
258
259         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
260         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
261         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
262         gridBagConstraints.weightx = 1.0;
263         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
264         add(isCacheOverflowAllowedComboBox, gridBagConstraints);
265         isCacheOverflowAllowedComboBox.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Is_Cache_Overflow_Allowed_Acsbl_Name"));
266         isCacheOverflowAllowedComboBox.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Is_Cache_Overflow_Allowed_Acsbl_Desc"));
267
268         cacheIdleTimeoutInSecondsLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Cache_Idle_Timeout_In_Seconds").charAt(0));
269         cacheIdleTimeoutInSecondsLabel.setLabelFor(cacheIdleTimeoutInSecondsTextField);
270         cacheIdleTimeoutInSecondsLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Cache_Idle_Timeout_In_Seconds_1"));
271         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
272         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
273         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
274         add(cacheIdleTimeoutInSecondsLabel, gridBagConstraints);
275         cacheIdleTimeoutInSecondsLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Cache_Idle_Timeout_In_Seconds_Acsbl_Name"));
276         cacheIdleTimeoutInSecondsLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Cache_Idle_Timeout_In_Seconds_Acsbl_Desc"));
277
278         cacheIdleTimeoutInSecondsTextField.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Cache_Idle_Timeout_In_Seconds_Tool_Tip"));
279         cacheIdleTimeoutInSecondsTextField.addActionListener(new java.awt.event.ActionListener JavaDoc() {
280             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
281                 cacheIdleTimeoutInSecondsActionPerformed(evt);
282             }
283         });
284         cacheIdleTimeoutInSecondsTextField.addFocusListener(new java.awt.event.FocusAdapter JavaDoc() {
285             public void focusGained(java.awt.event.FocusEvent JavaDoc evt) {
286                 cacheIdleTimeoutInSecondsFocusGained(evt);
287             }
288         });
289         cacheIdleTimeoutInSecondsTextField.addKeyListener(new java.awt.event.KeyAdapter JavaDoc() {
290             public void keyReleased(java.awt.event.KeyEvent JavaDoc evt) {
291                 cacheIdleTimeoutInSecondsKeyReleased(evt);
292             }
293         });
294
295         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
296         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
297         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
298         gridBagConstraints.weightx = 1.0;
299         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
300         add(cacheIdleTimeoutInSecondsTextField, gridBagConstraints);
301         cacheIdleTimeoutInSecondsTextField.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Cache_Idle_Timeout_In_Seconds_Acsbl_Name"));
302         cacheIdleTimeoutInSecondsTextField.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Cache_Idle_Timeout_In_Seconds_Acsbl_Desc"));
303
304         removalTimeoutInSecondsLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Removal_Timeout_In_Seconds").charAt(0));
305         removalTimeoutInSecondsLabel.setLabelFor(removalTimeoutInSecondsTextField);
306         removalTimeoutInSecondsLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Removal_Timeout_In_Seconds_1"));
307         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
308         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
309         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
310         add(removalTimeoutInSecondsLabel, gridBagConstraints);
311         removalTimeoutInSecondsLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Removal_Timeout_In_Seconds_Acsbl_Name"));
312         removalTimeoutInSecondsLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Removal_Timeout_In_Seconds_Acsbl_Desc"));
313
314         removalTimeoutInSecondsTextField.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Removal_Timeout_In_Seconds_Tool_Tip"));
315         removalTimeoutInSecondsTextField.addActionListener(new java.awt.event.ActionListener JavaDoc() {
316             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
317                 removalTimeoutInSecondsActionPerformed(evt);
318             }
319         });
320         removalTimeoutInSecondsTextField.addFocusListener(new java.awt.event.FocusAdapter JavaDoc() {
321             public void focusGained(java.awt.event.FocusEvent JavaDoc evt) {
322                 removalTimeoutInSecondsFocusGained(evt);
323             }
324         });
325         removalTimeoutInSecondsTextField.addKeyListener(new java.awt.event.KeyAdapter JavaDoc() {
326             public void keyReleased(java.awt.event.KeyEvent JavaDoc evt) {
327                 removalTimeoutInSecondsKeyReleased(evt);
328             }
329         });
330
331         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
332         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
333         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
334         gridBagConstraints.weightx = 1.0;
335         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
336         add(removalTimeoutInSecondsTextField, gridBagConstraints);
337         removalTimeoutInSecondsTextField.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Removal_Timeout_In_Seconds_Acsbl_Name"));
338         removalTimeoutInSecondsTextField.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Removal_Timeout_In_Seconds_Acsbl_Desc"));
339
340         victimSelectionPolicyLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Victim_Selection_Policy").charAt(0));
341         victimSelectionPolicyLabel.setLabelFor(victimSelectionPolicyComboBox);
342         victimSelectionPolicyLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Victim_Selection_Policy_1"));
343         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
344         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
345         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 5);
346         add(victimSelectionPolicyLabel, gridBagConstraints);
347         victimSelectionPolicyLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Victim_Selection_Policy_Acsbl_Name"));
348         victimSelectionPolicyLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Victim_Selection_Policy_Acsbl_Desc"));
349
350         victimSelectionPolicyComboBox.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "", "FIFO", "LRU", "NRU" }));
351         victimSelectionPolicyComboBox.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Victim_Selection_Policy_Tool_Tip"));
352         victimSelectionPolicyComboBox.addItemListener(new java.awt.event.ItemListener JavaDoc() {
353             public void itemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {
354                 victimSelectionPolicyItemStateChanged(evt);
355             }
356         });
357
358         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
359         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
360         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
361         gridBagConstraints.weightx = 1.0;
362         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 5);
363         add(victimSelectionPolicyComboBox, gridBagConstraints);
364         victimSelectionPolicyComboBox.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Victim_Selection_Policy_Acsbl_Name"));
365         victimSelectionPolicyComboBox.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Victim_Selection_Policy_Acsbl_Desc"));
366
367         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
368         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
369         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
370         gridBagConstraints.weightx = 1.0;
371         gridBagConstraints.weighty = 1.0;
372         add(fillerPanel, gridBagConstraints);
373
374     }// </editor-fold>//GEN-END:initComponents
375

376     private void removalTimeoutInSecondsFocusGained(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_removalTimeoutInSecondsFocusGained
377
// Add your handling code here:
378
validateEntries();
379     }//GEN-LAST:event_removalTimeoutInSecondsFocusGained
380

381     private void removalTimeoutInSecondsActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_removalTimeoutInSecondsActionPerformed
382
// Add your handling code here:
383
validateEntries();
384     }//GEN-LAST:event_removalTimeoutInSecondsActionPerformed
385

386     private void cacheIdleTimeoutInSecondsActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_cacheIdleTimeoutInSecondsActionPerformed
387
// Add your handling code here:
388
validateEntries();
389     }//GEN-LAST:event_cacheIdleTimeoutInSecondsActionPerformed
390

391     private void cacheIdleTimeoutInSecondsFocusGained(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_cacheIdleTimeoutInSecondsFocusGained
392
// Add your handling code here:
393
validateEntries();
394     }//GEN-LAST:event_cacheIdleTimeoutInSecondsFocusGained
395

396     private void maxCacheSizeFocusGained(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_maxCacheSizeFocusGained
397
// Add your handling code here:
398
validateEntries();
399     }//GEN-LAST:event_maxCacheSizeFocusGained
400

401     private void resizeQuantityFocusGained(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_resizeQuantityFocusGained
402
// Add your handling code here:
403
validateEntries();
404     }//GEN-LAST:event_resizeQuantityFocusGained
405

406     private void resizeQuantityActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_resizeQuantityActionPerformed
407
// Add your handling code here:
408
validateEntries();
409     }//GEN-LAST:event_resizeQuantityActionPerformed
410

411     private void maxCacheSizeActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_maxCacheSizeActionPerformed
412
// Add your handling code here:
413
validateEntries();
414     }//GEN-LAST:event_maxCacheSizeActionPerformed
415

416     private void victimSelectionPolicyItemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {//GEN-FIRST:event_victimSelectionPolicyItemStateChanged
417
// Add your handling code here:
418
String JavaDoc item = (String JavaDoc)victimSelectionPolicyComboBox.getSelectedItem();
419         customizer.updateVictimSelectionPolicy(item);
420         validateEntries();
421     }//GEN-LAST:event_victimSelectionPolicyItemStateChanged
422

423     private void removalTimeoutInSecondsKeyReleased(java.awt.event.KeyEvent JavaDoc evt) {//GEN-FIRST:event_removalTimeoutInSecondsKeyReleased
424
// Add your handling code here:
425
String JavaDoc item = removalTimeoutInSecondsTextField.getText();
426         customizer.updateRemovalTimeoutInSeconds(item);
427         validateEntries();
428     }//GEN-LAST:event_removalTimeoutInSecondsKeyReleased
429

430     private void cacheIdleTimeoutInSecondsKeyReleased(java.awt.event.KeyEvent JavaDoc evt) {//GEN-FIRST:event_cacheIdleTimeoutInSecondsKeyReleased
431
// Add your handling code here:
432
String JavaDoc item = cacheIdleTimeoutInSecondsTextField.getText();
433         customizer.updateCacheIdleTimeoutInSeconds(item);
434         validateEntries();
435     }//GEN-LAST:event_cacheIdleTimeoutInSecondsKeyReleased
436

437     private void isCacheOverflowAllowedItemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {//GEN-FIRST:event_isCacheOverflowAllowedItemStateChanged
438
// Add your handling code here:
439
String JavaDoc item = (String JavaDoc)isCacheOverflowAllowedComboBox.getSelectedItem();
440         customizer.updateIsCacheOverflowAllowed(item);
441         validateEntries();
442     }//GEN-LAST:event_isCacheOverflowAllowedItemStateChanged
443

444     private void resizeQuantityKeyReleased(java.awt.event.KeyEvent JavaDoc evt) {//GEN-FIRST:event_resizeQuantityKeyReleased
445
// Add your handling code here:
446
String JavaDoc item = resizeQuantityTextField.getText();
447         customizer.updateCacheResizeQuantity(item);
448         validateEntries();
449     }//GEN-LAST:event_resizeQuantityKeyReleased
450

451     private void maxCacheSizeKeyReleased(java.awt.event.KeyEvent JavaDoc evt) {//GEN-FIRST:event_maxCacheSizeKeyReleased
452
// Add your handling code here:
453
String JavaDoc item = maxCacheSizeTextField.getText();
454         customizer.updateMaxCacheSize(item);
455         validateEntries();
456     }//GEN-LAST:event_maxCacheSizeKeyReleased
457

458     // Variables declaration - do not modify//GEN-BEGIN:variables
459
private javax.swing.JLabel JavaDoc cacheIdleTimeoutInSecondsLabel;
460     private javax.swing.JTextField JavaDoc cacheIdleTimeoutInSecondsTextField;
461     private javax.swing.JPanel JavaDoc fillerPanel;
462     private javax.swing.JComboBox JavaDoc isCacheOverflowAllowedComboBox;
463     private javax.swing.JLabel JavaDoc isCacheOverflowAllowedLabel;
464     private javax.swing.JLabel JavaDoc maxCacheSizeLabel;
465     private javax.swing.JTextField JavaDoc maxCacheSizeTextField;
466     private javax.swing.JLabel JavaDoc removalTimeoutInSecondsLabel;
467     private javax.swing.JTextField JavaDoc removalTimeoutInSecondsTextField;
468     private javax.swing.JLabel JavaDoc resizeQuantityLabel;
469     private javax.swing.JTextField JavaDoc resizeQuantityTextField;
470     private javax.swing.JComboBox JavaDoc victimSelectionPolicyComboBox;
471     private javax.swing.JLabel JavaDoc victimSelectionPolicyLabel;
472     // End of variables declaration//GEN-END:variables
473

474 }
475
Popular Tags