KickJava   Java API By Example, From Geeks To Geeks.

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


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

23
24 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule;
25
26 import java.awt.GridBagConstraints JavaDoc;
27 import java.util.ArrayList JavaDoc;
28 import java.util.Collection JavaDoc;
29 import java.util.ResourceBundle JavaDoc;
30
31
32 //DEPLOYMENT API
33
import javax.enterprise.deploy.spi.DConfigBean JavaDoc;
34
35 import org.netbeans.modules.j2ee.sun.dd.api.ejb.AsContext;
36 import org.netbeans.modules.j2ee.sun.dd.api.ejb.BeanCache;
37 import org.netbeans.modules.j2ee.sun.dd.api.ejb.BeanPool;
38 import org.netbeans.modules.j2ee.sun.dd.api.ejb.IorSecurityConfig;
39 import org.netbeans.modules.j2ee.sun.dd.api.ejb.SasContext;
40 import org.netbeans.modules.j2ee.sun.dd.api.ejb.TransportConfig;
41 import org.netbeans.modules.j2ee.sun.share.configbean.BaseEjb;
42 import org.netbeans.modules.j2ee.sun.share.configbean.StorageBeanFactory;
43 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.BeanCustomizer;
44 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.CustomizerTitlePanel;
45
46
47 /**
48  *
49  * @author Rajeshwar Patil
50  * @version %I%, %G%
51  */

52 public abstract class EjbCustomizer extends BeanCustomizer
53         implements org.netbeans.modules.j2ee.sun.share.Constants {
54
55     private BaseEjb theBean;
56     private IorSecurityConfigPanel iorSecCfgPanel;
57
58     static final ResourceBundle JavaDoc bundle =
59         ResourceBundle.getBundle(
60             "org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule.Bundle"); // NOI18N
61

62
63     /** Creates new customizer EjbCustomizer */
64     public EjbCustomizer() {
65         initComponents();
66         createPanels();
67     }
68     
69     public void setObject(Object JavaDoc bean) {
70                 super.setObject(bean);
71         // Only do this if the bean is actually changing.
72
if(theBean != bean) {
73             if(theBean != null) {
74                 // commit old object
75
}
76             if(bean instanceof BaseEjb) {
77                 theBean = (BaseEjb) bean;
78                 setComponentValues();
79             }
80         }
81                 initializing = false;
82     }
83
84     //get the bean specific panel
85
protected abstract javax.swing.JPanel JavaDoc getBeanPanel();
86
87     //initialize all the elements in the bean specific panel
88
protected abstract void initializeBeanPanel(BaseEjb theBean);
89
90     //add bean sepcific tabbed panels
91
protected abstract void addTabbedBeanPanels();
92
93     //initialize bean specific panels in tabbed pane
94
protected abstract void initializeTabbedBeanPanels(BaseEjb theBean);
95
96
97
98     //update methods called by the panel
99
private void updateJndiName(String JavaDoc jndiName){
100         //update theBean
101
try{
102             if(EMPTY_STRING.equals(jndiName)){
103                 theBean.setJndiName(null);
104             }else{
105                 theBean.setJndiName(jndiName);
106             }
107         }catch(java.beans.PropertyVetoException JavaDoc exception){
108         }
109         notifyChange();
110     }
111
112
113     private void updatePassByRef(String JavaDoc passByRef){
114         try{
115             if(EMPTY_STRING.equals(passByRef)){
116                 theBean.setPassByReference(null);
117             }else{
118                 theBean.setPassByReference(passByRef);
119             }
120         }catch(java.beans.PropertyVetoException JavaDoc exception){
121         }
122         notifyChange();
123     }
124
125
126     void updateIntegrity(String JavaDoc integrity){
127         TransportConfig transportConfig = getTransportConfig();
128         if((EMPTY_STRING.equals(integrity)) || (null == integrity)){
129             transportConfig.setIntegrity(null);
130             updateTransportConfig();
131         }else{
132             transportConfig.setIntegrity(integrity);
133         }
134         notifyChange();
135     }
136
137
138     void updateConfidentiality(String JavaDoc confidentiality){
139         TransportConfig transportConfig = getTransportConfig();
140         if((EMPTY_STRING.equals(confidentiality)) || (null == confidentiality)){
141             transportConfig.setConfidentiality(null);
142             updateTransportConfig();
143         }else{
144             transportConfig.setConfidentiality(confidentiality);
145         }
146         notifyChange();
147     }
148
149
150     void updateEstbTrstInTrgt(String JavaDoc estbTrstInTrgt){
151         TransportConfig transportConfig = getTransportConfig();
152         if((EMPTY_STRING.equals(estbTrstInTrgt)) || (null == estbTrstInTrgt)){
153             transportConfig.setEstablishTrustInTarget(null);
154             updateTransportConfig();
155         }else{
156             transportConfig.setEstablishTrustInTarget(estbTrstInTrgt);
157         }
158         notifyChange();
159     }
160
161
162     void updateEstbTrstInClnt(String JavaDoc estbTrstInClnt){
163         TransportConfig transportConfig = getTransportConfig();
164         if((EMPTY_STRING.equals(estbTrstInClnt)) || (null == estbTrstInClnt)){
165             transportConfig.setEstablishTrustInClient(null);
166             updateTransportConfig();
167         }else{
168             transportConfig.setEstablishTrustInClient(estbTrstInClnt);
169         }
170         notifyChange();
171     }
172
173
174     void updateAuthMethod(String JavaDoc authMethod){
175         AsContext asContext = getAsContext();
176         if((EMPTY_STRING.equals(authMethod)) || (null == authMethod)){
177             asContext.setAuthMethod(null);
178             updateAsContext();
179         }else{
180             asContext.setAuthMethod(authMethod);
181         }
182         notifyChange();
183     }
184
185
186     void updateRealm(String JavaDoc realm){
187         AsContext asContext = getAsContext();
188         if((EMPTY_STRING.equals(realm)) || (null == realm)){
189             asContext.setRealm(null);
190             updateAsContext();
191         }else{
192             asContext.setRealm(realm);
193         }
194         notifyChange();
195     }
196
197
198     void updateRequired(String JavaDoc reqd){
199         AsContext asContext = getAsContext();
200         if((EMPTY_STRING.equals(reqd)) || (null == reqd)){
201             asContext.setRequired(null);
202             updateAsContext();
203         }else{
204             asContext.setRequired(reqd);
205         }
206         notifyChange();
207     }
208
209
210     void updateCallerPropagation(String JavaDoc callerPrpgtn){
211         SasContext sasContext = getSasContext();
212         if((EMPTY_STRING.equals(callerPrpgtn)) || (null == callerPrpgtn)){
213             sasContext.setCallerPropagation(null);
214             updateSasContext();
215         }else{
216             sasContext.setCallerPropagation(callerPrpgtn);
217         }
218         notifyChange();
219     }
220
221
222     private void createPanels(){
223         //add bean specific panel
224

225         //title panel
226
CustomizerTitlePanel titlePanel = new CustomizerTitlePanel();
227         String JavaDoc title = getCustomizerTitle();
228         titlePanel.setCustomizerTitle(title);
229
230         java.awt.GridBagConstraints JavaDoc gridBagConstraints =
231             new java.awt.GridBagConstraints JavaDoc();
232         gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
233         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
234         gridBagConstraints.weightx = 1.0;
235         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 0);
236         add(titlePanel, gridBagConstraints, 0);
237
238         javax.swing.JPanel JavaDoc beanSpecificPanel = getBeanPanel();
239         if(beanSpecificPanel != null){
240             beanSpecificPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
241             gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
242             gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
243             gridBagConstraints.weightx = 1.0;
244             gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
245             add(beanSpecificPanel, gridBagConstraints, 2);
246         }
247
248         iorSecCfgPanel = new IorSecurityConfigPanel(this);
249         iorSecCfgPanel.getAccessibleContext().setAccessibleName(bundle.getString("IorSecurityConfig_Acsbl_Name")); //NOI18N
250
iorSecCfgPanel.getAccessibleContext().setAccessibleDescription(bundle.getString("IorSecurityConfig_Acsbl_Desc")); //NOI18N
251
tabbedPanel.addTab(bundle.getString("LBL_IorSecurityConfig"), // NOI18N
252
iorSecCfgPanel);
253
254         //add bean sepcific tabbed panels
255
addTabbedBeanPanels();
256     }
257
258
259     public Collection JavaDoc getErrors(){
260         ArrayList JavaDoc errors = null;
261         if(validationSupport == null) assert(false);
262         errors = new ArrayList JavaDoc();
263
264         //Ejb field Validations
265
String JavaDoc property = jndiNameTextField.getText();
266         errors.addAll(validationSupport.validate(property,
267             "/sun-ejb-jar/enterprise-beans/ejb/jndi-name", //NOI18N
268
bundle.getString("LBL_Jndi_Name"))); //NOI18N
269

270         property = (String JavaDoc)passByRefComboBox.getSelectedItem();
271         errors.addAll(validationSupport.validate(property,
272             "/sun-ejb-jar/enterprise-beans/ejb/pass-by-reference", //NOI18N
273
bundle.getString("LBL_Pass_By_Reference"))); //NOI18N
274

275         return errors;
276     }
277
278     
279     private void setComponentValues() {
280         //initialize all the elements in the general panel
281
nameTextField.setText(theBean.getEjbName());
282         jndiNameTextField.setText(theBean.getJndiName());
283         String JavaDoc passByRef = theBean.getPassByReference();
284         if(passByRef != null){
285             passByRefComboBox.setSelectedItem(passByRef);
286         }
287
288         //initialize all the elements in the bean specific panel
289
initializeBeanPanel(theBean); //abstract
290

291        //initialize IorSecurityConfig
292
initializeIorSecurityConfig();
293        
294
295        //initialize bean specific panels in tabbed pane
296
initializeTabbedBeanPanels(theBean); //abstract
297
}
298
299
300     private void initializeIorSecurityConfig(){
301         IorSecurityConfig iorSecurityConfig = theBean.getIorSecurityConfig();
302         iorSecCfgPanel.setValues(iorSecurityConfig);
303     }
304
305
306     private TransportConfig getTransportConfig(){
307         IorSecurityConfig iorSecCnfg = getIorSecurityConfig();
308         TransportConfig transportCfg = iorSecCnfg.getTransportConfig();
309         if(transportCfg == null){
310             transportCfg = theBean.getConfig().getStorageFactory().createTransportConfig();
311             iorSecCnfg.setTransportConfig(transportCfg);
312         }
313         return transportCfg;
314     }
315
316
317     private AsContext getAsContext(){
318         IorSecurityConfig iorSecCnfg = getIorSecurityConfig();
319         AsContext asContext = iorSecCnfg.getAsContext();
320         if(asContext == null){
321             asContext = theBean.getConfig().getStorageFactory().createAsContext();
322             iorSecCnfg.setAsContext(asContext);
323         }
324         return asContext;
325     }
326
327
328     private SasContext getSasContext(){
329         IorSecurityConfig iorSecCnfg = getIorSecurityConfig();
330         SasContext sasContext = iorSecCnfg.getSasContext();
331         if(sasContext == null){
332             sasContext = theBean.getConfig().getStorageFactory().createSasContext();
333             iorSecCnfg.setSasContext(sasContext);
334         }
335         return sasContext;
336     }
337
338     
339     private IorSecurityConfig getIorSecurityConfig(){
340         IorSecurityConfig iorSecCnfg = theBean.getIorSecurityConfig();
341         if(iorSecCnfg == null){
342             iorSecCnfg = theBean.getConfig().getStorageFactory().createIorSecurityConfig();
343             try{
344                 theBean.setIorSecurityConfig(iorSecCnfg);
345             }catch(java.beans.PropertyVetoException JavaDoc exception){
346             }
347         }
348         return iorSecCnfg;
349     }
350
351
352     //BeanPool update methods
353
void updateSteadyPoolSize(String JavaDoc steadyPoolSize){
354         BeanPool beanPool = getBeanPool();
355         if((EMPTY_STRING.equals(steadyPoolSize)) || (null == steadyPoolSize)){
356             beanPool.setSteadyPoolSize(null);
357             updateBeanPool();
358         }else{
359             beanPool.setSteadyPoolSize(steadyPoolSize);
360         }
361         notifyChange();
362     }
363
364
365     void updateResizeQuantity(String JavaDoc resizeQuantity){
366         BeanPool beanPool = getBeanPool();
367         if((EMPTY_STRING.equals(resizeQuantity)) || (null == resizeQuantity)){
368             beanPool.setResizeQuantity(null);
369             updateBeanPool();
370         }else{
371             beanPool.setResizeQuantity(resizeQuantity);
372         }
373         notifyChange();
374     }
375
376
377     void updateMaxPoolSize(String JavaDoc maxPoolSize){
378         BeanPool beanPool = getBeanPool();
379         if((EMPTY_STRING.equals(maxPoolSize)) || (null == maxPoolSize)){
380             beanPool.setMaxPoolSize(null);
381             updateBeanPool();
382         }else{
383             beanPool.setMaxPoolSize(maxPoolSize);
384         }
385         notifyChange();
386     }
387
388
389     void updatePoolIdleTimeoutInSeconds(String JavaDoc poolIdleTimeoutInSec){
390         BeanPool beanPool = getBeanPool();
391         if((EMPTY_STRING.equals(poolIdleTimeoutInSec)) || (null == poolIdleTimeoutInSec)){
392             beanPool.setPoolIdleTimeoutInSeconds(null);
393             updateBeanPool();
394         }else{
395             beanPool.setPoolIdleTimeoutInSeconds(poolIdleTimeoutInSec);
396         }
397         notifyChange();
398     }
399
400
401     //BeanCache update methods
402
void updateMaxCacheSize(String JavaDoc maxCacheSize){
403         BeanCache beanCache = getBeanCache();
404         if((EMPTY_STRING.equals(maxCacheSize)) || (null == maxCacheSize)){
405             beanCache.setMaxCacheSize(null);
406             updateBeanCache();
407         }else{
408             beanCache.setMaxCacheSize(maxCacheSize);
409         }
410         notifyChange();
411     }
412
413
414     void updateCacheResizeQuantity(String JavaDoc resizeQuantity){
415         BeanCache beanCache = getBeanCache();
416         if((EMPTY_STRING.equals(resizeQuantity)) || (null == resizeQuantity)){
417             beanCache.setResizeQuantity(null);
418             updateBeanCache();
419         }else{
420             beanCache.setResizeQuantity(resizeQuantity);
421         }
422         notifyChange();
423     }
424
425
426     void updateIsCacheOverflowAllowed(String JavaDoc isOverflowAllowed){
427         BeanCache beanCache = getBeanCache();
428         if((EMPTY_STRING.equals(isOverflowAllowed)) || (null == isOverflowAllowed)){
429             beanCache.setIsCacheOverflowAllowed(null);
430             updateBeanCache();
431         }else{
432             beanCache.setIsCacheOverflowAllowed(isOverflowAllowed);
433         }
434         notifyChange();
435     }
436
437
438     void updateCacheIdleTimeoutInSeconds(String JavaDoc idleTimeoutInSec){
439         BeanCache beanCache = getBeanCache();
440         if((EMPTY_STRING.equals(idleTimeoutInSec)) || (null == idleTimeoutInSec)){
441             beanCache.setCacheIdleTimeoutInSeconds(null);
442             updateBeanCache();
443         }else{
444             beanCache.setCacheIdleTimeoutInSeconds(idleTimeoutInSec);
445         }
446         notifyChange();
447     }
448
449
450     void updateRemovalTimeoutInSeconds(String JavaDoc removalTimeoutInSeconds){
451         BeanCache beanCache = getBeanCache();
452         if((EMPTY_STRING.equals(removalTimeoutInSeconds)) || (null == removalTimeoutInSeconds)){
453             beanCache.setRemovalTimeoutInSeconds(null);
454             updateBeanCache();
455         }else{
456             beanCache.setRemovalTimeoutInSeconds(removalTimeoutInSeconds);
457         }
458         notifyChange();
459     }
460
461
462     void updateVictimSelectionPolicy(String JavaDoc victimSelectionPolicy){
463         BeanCache beanCache = getBeanCache();
464         if((EMPTY_STRING.equals(victimSelectionPolicy)) || (null == victimSelectionPolicy)){
465             beanCache.setVictimSelectionPolicy(null);
466             updateBeanCache();
467         }else{
468             beanCache.setVictimSelectionPolicy(victimSelectionPolicy);
469         }
470         notifyChange();
471     }
472
473
474     private BeanPool getBeanPool(){
475         BeanPool beanPool = theBean.getBeanPool();
476         if(beanPool == null){
477             beanPool = theBean.getConfig().getStorageFactory().createBeanPool();
478             try{
479                 theBean.setBeanPool(beanPool);
480             }catch(java.beans.PropertyVetoException JavaDoc exception){
481             }
482         }
483         return beanPool;
484     }
485
486
487     private BeanCache getBeanCache(){
488         BeanCache beanCache = theBean.getBeanCache();
489         if(beanCache == null){
490             beanCache = theBean.getConfig().getStorageFactory().createBeanCache();
491             try{
492                 theBean.setBeanCache(beanCache);
493             }catch(java.beans.PropertyVetoException JavaDoc exception){
494             }
495         }
496         return beanCache;
497     }
498
499
500     public void tableChanged(javax.swing.event.TableModelEvent JavaDoc e) {
501         notifyChange();
502     }
503
504
505     private String JavaDoc getCustomizerTitle(){
506         String JavaDoc title = bundle.getString("EJB_TITLE"); // NOI18N
507
return title;
508     }
509
510
511     private void updateTransportConfig(){
512         TransportConfig transportConfig = getTransportConfig();
513         if(transportConfig.getIntegrity() != null) return;
514         if(transportConfig.getConfidentiality() != null) return;
515         if(transportConfig.getEstablishTrustInTarget() != null) return;
516         if(transportConfig.getEstablishTrustInClient() != null) return;
517         getIorSecurityConfig().setTransportConfig(null);
518         updateIorSecurityConfig();
519     }
520
521
522     private void updateAsContext(){
523         AsContext asContext = getAsContext();
524         if(asContext.getAuthMethod() != null) return;
525         if(asContext.getRealm() != null) return;
526         if(asContext.getRequired() != null) return;
527         getIorSecurityConfig().setAsContext(null);
528         updateIorSecurityConfig();
529     }
530
531
532     private void updateSasContext(){
533         SasContext sasContext = getSasContext();
534         if(sasContext.getCallerPropagation() != null) return;
535         getIorSecurityConfig().setSasContext(null);
536         updateIorSecurityConfig();
537     }
538
539
540     private void updateIorSecurityConfig(){
541         IorSecurityConfig iorSecCnfg = getIorSecurityConfig();
542         if(iorSecCnfg.getTransportConfig() != null) return;
543         if(iorSecCnfg.getAsContext() != null) return;
544         if(iorSecCnfg.getSasContext() != null) return;
545         try{
546             theBean.setIorSecurityConfig(null);
547         }catch(java.beans.PropertyVetoException JavaDoc exception){
548         }
549     }
550
551
552     private void updateBeanPool(){
553         BeanPool beanPool = getBeanPool();
554         if(beanPool.getSteadyPoolSize() != null) return;
555         if(beanPool.getResizeQuantity() != null) return;
556         if(beanPool.getMaxPoolSize() != null) return;
557         if(beanPool.getPoolIdleTimeoutInSeconds() != null) return;
558         try{
559             theBean.setBeanPool(null);
560         }catch(java.beans.PropertyVetoException JavaDoc exception){
561         }
562     }
563
564
565     private void updateBeanCache(){
566         BeanCache beanCache = getBeanCache();
567         if(beanCache.getMaxCacheSize() != null) return;
568         if(beanCache.getResizeQuantity() != null) return;
569         if(beanCache.getIsCacheOverflowAllowed() != null) return;
570         if(beanCache.getCacheIdleTimeoutInSeconds() != null) return;
571         if(beanCache.getRemovalTimeoutInSeconds() != null) return;
572         if(beanCache.getVictimSelectionPolicy() != null) return;
573         try{
574             theBean.setBeanCache(null);
575         }catch(java.beans.PropertyVetoException JavaDoc exception){
576         }
577     }
578
579
580      /** This method is called from within the constructor to
581      * initialize the form.
582      * WARNING: Do NOT modify this code. The content of this method is
583      * always regenerated by the FormEditor.
584      */

585     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
586
private void initComponents() {
587         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
588
589         panel1 = new java.awt.Panel JavaDoc();
590         generalPanel = new javax.swing.JPanel JavaDoc();
591         nameLabel = new javax.swing.JLabel JavaDoc();
592         nameTextField = new javax.swing.JTextField JavaDoc();
593         jndiNameLabel = new javax.swing.JLabel JavaDoc();
594         jndiNameTextField = new javax.swing.JTextField JavaDoc();
595         passByRefLabel = new javax.swing.JLabel JavaDoc();
596         passByRefComboBox = new javax.swing.JComboBox JavaDoc();
597         tabbedPanel = new javax.swing.JTabbedPane JavaDoc();
598
599         setLayout(new java.awt.GridBagLayout JavaDoc());
600
601         addFocusListener(new java.awt.event.FocusAdapter JavaDoc() {
602             public void focusGained(java.awt.event.FocusEvent JavaDoc evt) {
603                 formFocusGained(evt);
604             }
605         });
606
607         generalPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
608
609         generalPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
610         generalPanel.addFocusListener(new java.awt.event.FocusAdapter JavaDoc() {
611             public void focusGained(java.awt.event.FocusEvent JavaDoc evt) {
612                 generalPanelFocusGained(evt);
613             }
614         });
615
616         nameLabel.setLabelFor(nameTextField);
617         nameLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Name_1"));
618         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
619         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
620         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 0);
621         generalPanel.add(nameLabel, gridBagConstraints);
622         nameLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Name_Acsbl_Name"));
623         nameLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Ejb_Name_Acsbl_Desc"));
624
625         nameTextField.setEditable(false);
626         nameTextField.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Ejb_Name_Tool_Tip"));
627         nameTextField.addFocusListener(new java.awt.event.FocusAdapter JavaDoc() {
628             public void focusGained(java.awt.event.FocusEvent JavaDoc evt) {
629                 nameFocusGained(evt);
630             }
631         });
632
633         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
634         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
635         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
636         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
637         gridBagConstraints.weightx = 1.0;
638         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 5);
639         generalPanel.add(nameTextField, gridBagConstraints);
640         nameTextField.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Name_Acsbl_Name"));
641         nameTextField.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Ejb_Name_Acsbl_Desc"));
642
643         jndiNameLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Jndi_Name").charAt(0));
644         jndiNameLabel.setLabelFor(jndiNameTextField);
645         jndiNameLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Jndi_Name_1"));
646         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
647         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
648         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 0);
649         generalPanel.add(jndiNameLabel, gridBagConstraints);
650         jndiNameLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Jndi_Name_Acsbl_Name"));
651         jndiNameLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Ejb_Jndi_Name_Acsbl_Desc"));
652
653         jndiNameTextField.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Ejb_Jndi_Name_Tool_Tip"));
654         jndiNameTextField.addActionListener(new java.awt.event.ActionListener JavaDoc() {
655             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
656                 jndiNameActionPerformed(evt);
657             }
658         });
659         jndiNameTextField.addFocusListener(new java.awt.event.FocusAdapter JavaDoc() {
660             public void focusGained(java.awt.event.FocusEvent JavaDoc evt) {
661                 jndiNameFocusGained(evt);
662             }
663         });
664         jndiNameTextField.addKeyListener(new java.awt.event.KeyAdapter JavaDoc() {
665             public void keyReleased(java.awt.event.KeyEvent JavaDoc evt) {
666                 jndiNameKeyReleased(evt);
667             }
668         });
669
670         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
671         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
672         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
673         gridBagConstraints.weightx = 0.9;
674         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 0);
675         generalPanel.add(jndiNameTextField, gridBagConstraints);
676         jndiNameTextField.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Jndi_Name_Acsbl_Name"));
677         jndiNameTextField.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Ejb_Jndi_Name_Acsbl_Desc"));
678
679         passByRefLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("MNC_Pass_By_Reference").charAt(0));
680         passByRefLabel.setLabelFor(passByRefComboBox);
681         passByRefLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("LBL_Pass_By_Reference_1"));
682         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
683         gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
684         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 18, 5, 0);
685         generalPanel.add(passByRefLabel, gridBagConstraints);
686         passByRefLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Pass_By_Reference_Acsbl_Name"));
687         passByRefLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Pass_By_Reference_Acsbl_Desc"));
688
689         passByRefComboBox.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "", "true", "false" }));
690         passByRefComboBox.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Pass_By_Reference_Tool_Tip"));
691         passByRefComboBox.addItemListener(new java.awt.event.ItemListener JavaDoc() {
692             public void itemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {
693                 passByRefItemStateChanged(evt);
694             }
695         });
696
697         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
698         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
699         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
700         gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
701         gridBagConstraints.weightx = 0.1;
702         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 5);
703         generalPanel.add(passByRefComboBox, gridBagConstraints);
704         passByRefComboBox.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Pass_By_Reference_Acsbl_Name"));
705         passByRefComboBox.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/share/configbean/customizers/ejbmodule/Bundle").getString("Pass_By_Reference_Acsbl_Desc"));
706
707         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
708         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
709         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
710         gridBagConstraints.weightx = 1.0;
711         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 6, 0, 5);
712         add(generalPanel, gridBagConstraints);
713
714         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
715         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
716         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
717         gridBagConstraints.weighty = 1.0;
718         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 5, 5);
719         add(tabbedPanel, gridBagConstraints);
720
721     }// </editor-fold>//GEN-END:initComponents
722

723     private void jndiNameActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_jndiNameActionPerformed
724
// Add your handling code here:
725
validateEntries();
726     }//GEN-LAST:event_jndiNameActionPerformed
727

728     private void jndiNameFocusGained(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_jndiNameFocusGained
729
// Add your handling code here:
730
validateEntries();
731     }//GEN-LAST:event_jndiNameFocusGained
732

733     private void generalPanelFocusGained(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_generalPanelFocusGained
734
// Add your handling code here:
735
validateEntries();
736     }//GEN-LAST:event_generalPanelFocusGained
737

738     private void nameFocusGained(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_nameFocusGained
739
// Add your handling code here:
740
validateEntries();
741     }//GEN-LAST:event_nameFocusGained
742

743     private void formFocusGained(java.awt.event.FocusEvent JavaDoc evt) {//GEN-FIRST:event_formFocusGained
744
// Add your handling code here:
745
validateEntries();
746     }//GEN-LAST:event_formFocusGained
747

748     private void passByRefItemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {//GEN-FIRST:event_passByRefItemStateChanged
749
// Add your handling code here:
750
updatePassByRef((String JavaDoc)passByRefComboBox.getSelectedItem());
751         notifyChange();
752         validateEntries();
753     }//GEN-LAST:event_passByRefItemStateChanged
754

755     private void jndiNameKeyReleased(java.awt.event.KeyEvent JavaDoc evt) {//GEN-FIRST:event_jndiNameKeyReleased
756
// Add your handling code here:
757
updateJndiName(jndiNameTextField.getText());
758         notifyChange();
759         validateEntries();
760     }//GEN-LAST:event_jndiNameKeyReleased
761

762
763     // Variables declaration - do not modify//GEN-BEGIN:variables
764
private javax.swing.JPanel JavaDoc generalPanel;
765     private javax.swing.JLabel JavaDoc jndiNameLabel;
766     private javax.swing.JTextField JavaDoc jndiNameTextField;
767     private javax.swing.JLabel JavaDoc nameLabel;
768     private javax.swing.JTextField JavaDoc nameTextField;
769     private java.awt.Panel JavaDoc panel1;
770     private javax.swing.JComboBox JavaDoc passByRefComboBox;
771     private javax.swing.JLabel JavaDoc passByRefLabel;
772     protected javax.swing.JTabbedPane JavaDoc tabbedPanel;
773     // End of variables declaration//GEN-END:variables
774
}
775
Popular Tags