1 19 23 24 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule; 25 26 import java.awt.GridBagConstraints ; 27 import java.util.ArrayList ; 28 import java.util.Collection ; 29 import java.util.ResourceBundle ; 30 31 32 import javax.enterprise.deploy.spi.DConfigBean ; 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 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 bundle = 59 ResourceBundle.getBundle( 60 "org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule.Bundle"); 62 63 64 public EjbCustomizer() { 65 initComponents(); 66 createPanels(); 67 } 68 69 public void setObject(Object bean) { 70 super.setObject(bean); 71 if(theBean != bean) { 73 if(theBean != null) { 74 } 76 if(bean instanceof BaseEjb) { 77 theBean = (BaseEjb) bean; 78 setComponentValues(); 79 } 80 } 81 initializing = false; 82 } 83 84 protected abstract javax.swing.JPanel getBeanPanel(); 86 87 protected abstract void initializeBeanPanel(BaseEjb theBean); 89 90 protected abstract void addTabbedBeanPanels(); 92 93 protected abstract void initializeTabbedBeanPanels(BaseEjb theBean); 95 96 97 98 private void updateJndiName(String jndiName){ 100 try{ 102 if(EMPTY_STRING.equals(jndiName)){ 103 theBean.setJndiName(null); 104 }else{ 105 theBean.setJndiName(jndiName); 106 } 107 }catch(java.beans.PropertyVetoException exception){ 108 } 109 notifyChange(); 110 } 111 112 113 private void updatePassByRef(String 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 exception){ 121 } 122 notifyChange(); 123 } 124 125 126 void updateIntegrity(String 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 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 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 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 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 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 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 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 225 CustomizerTitlePanel titlePanel = new CustomizerTitlePanel(); 227 String title = getCustomizerTitle(); 228 titlePanel.setCustomizerTitle(title); 229 230 java.awt.GridBagConstraints gridBagConstraints = 231 new java.awt.GridBagConstraints (); 232 gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER; 233 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 234 gridBagConstraints.weightx = 1.0; 235 gridBagConstraints.insets = new java.awt.Insets (0, 0, 0, 0); 236 add(titlePanel, gridBagConstraints, 0); 237 238 javax.swing.JPanel 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 (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")); iorSecCfgPanel.getAccessibleContext().setAccessibleDescription(bundle.getString("IorSecurityConfig_Acsbl_Desc")); tabbedPanel.addTab(bundle.getString("LBL_IorSecurityConfig"), iorSecCfgPanel); 253 254 addTabbedBeanPanels(); 256 } 257 258 259 public Collection getErrors(){ 260 ArrayList errors = null; 261 if(validationSupport == null) assert(false); 262 errors = new ArrayList (); 263 264 String property = jndiNameTextField.getText(); 266 errors.addAll(validationSupport.validate(property, 267 "/sun-ejb-jar/enterprise-beans/ejb/jndi-name", bundle.getString("LBL_Jndi_Name"))); 270 property = (String )passByRefComboBox.getSelectedItem(); 271 errors.addAll(validationSupport.validate(property, 272 "/sun-ejb-jar/enterprise-beans/ejb/pass-by-reference", bundle.getString("LBL_Pass_By_Reference"))); 275 return errors; 276 } 277 278 279 private void setComponentValues() { 280 nameTextField.setText(theBean.getEjbName()); 282 jndiNameTextField.setText(theBean.getJndiName()); 283 String passByRef = theBean.getPassByReference(); 284 if(passByRef != null){ 285 passByRefComboBox.setSelectedItem(passByRef); 286 } 287 288 initializeBeanPanel(theBean); 291 initializeIorSecurityConfig(); 293 294 295 initializeTabbedBeanPanels(theBean); } 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 exception){ 346 } 347 } 348 return iorSecCnfg; 349 } 350 351 352 void updateSteadyPoolSize(String 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 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 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 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 void updateMaxCacheSize(String 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 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 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 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 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 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 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 exception){ 494 } 495 } 496 return beanCache; 497 } 498 499 500 public void tableChanged(javax.swing.event.TableModelEvent e) { 501 notifyChange(); 502 } 503 504 505 private String getCustomizerTitle(){ 506 String title = bundle.getString("EJB_TITLE"); 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 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 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 exception){ 576 } 577 } 578 579 580 585 private void initComponents() { 587 java.awt.GridBagConstraints gridBagConstraints; 588 589 panel1 = new java.awt.Panel (); 590 generalPanel = new javax.swing.JPanel (); 591 nameLabel = new javax.swing.JLabel (); 592 nameTextField = new javax.swing.JTextField (); 593 jndiNameLabel = new javax.swing.JLabel (); 594 jndiNameTextField = new javax.swing.JTextField (); 595 passByRefLabel = new javax.swing.JLabel (); 596 passByRefComboBox = new javax.swing.JComboBox (); 597 tabbedPanel = new javax.swing.JTabbedPane (); 598 599 setLayout(new java.awt.GridBagLayout ()); 600 601 addFocusListener(new java.awt.event.FocusAdapter () { 602 public void focusGained(java.awt.event.FocusEvent evt) { 603 formFocusGained(evt); 604 } 605 }); 606 607 generalPanel.setLayout(new java.awt.GridBagLayout ()); 608 609 generalPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); 610 generalPanel.addFocusListener(new java.awt.event.FocusAdapter () { 611 public void focusGained(java.awt.event.FocusEvent 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 (); 619 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 620 gridBagConstraints.insets = new java.awt.Insets (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 () { 628 public void focusGained(java.awt.event.FocusEvent evt) { 629 nameFocusGained(evt); 630 } 631 }); 632 633 gridBagConstraints = new java.awt.GridBagConstraints (); 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 (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 (); 647 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 648 gridBagConstraints.insets = new java.awt.Insets (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 () { 655 public void actionPerformed(java.awt.event.ActionEvent evt) { 656 jndiNameActionPerformed(evt); 657 } 658 }); 659 jndiNameTextField.addFocusListener(new java.awt.event.FocusAdapter () { 660 public void focusGained(java.awt.event.FocusEvent evt) { 661 jndiNameFocusGained(evt); 662 } 663 }); 664 jndiNameTextField.addKeyListener(new java.awt.event.KeyAdapter () { 665 public void keyReleased(java.awt.event.KeyEvent evt) { 666 jndiNameKeyReleased(evt); 667 } 668 }); 669 670 gridBagConstraints = new java.awt.GridBagConstraints (); 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 (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 (); 683 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 684 gridBagConstraints.insets = new java.awt.Insets (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 (new String [] { "", "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 () { 692 public void itemStateChanged(java.awt.event.ItemEvent evt) { 693 passByRefItemStateChanged(evt); 694 } 695 }); 696 697 gridBagConstraints = new java.awt.GridBagConstraints (); 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 (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 (); 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 (0, 6, 0, 5); 712 add(generalPanel, gridBagConstraints); 713 714 gridBagConstraints = new java.awt.GridBagConstraints (); 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 (6, 6, 5, 5); 719 add(tabbedPanel, gridBagConstraints); 720 721 } 723 private void jndiNameActionPerformed(java.awt.event.ActionEvent evt) { validateEntries(); 726 } 728 private void jndiNameFocusGained(java.awt.event.FocusEvent evt) { validateEntries(); 731 } 733 private void generalPanelFocusGained(java.awt.event.FocusEvent evt) { validateEntries(); 736 } 738 private void nameFocusGained(java.awt.event.FocusEvent evt) { validateEntries(); 741 } 743 private void formFocusGained(java.awt.event.FocusEvent evt) { validateEntries(); 746 } 748 private void passByRefItemStateChanged(java.awt.event.ItemEvent evt) { updatePassByRef((String )passByRefComboBox.getSelectedItem()); 751 notifyChange(); 752 validateEntries(); 753 } 755 private void jndiNameKeyReleased(java.awt.event.KeyEvent evt) { updateJndiName(jndiNameTextField.getText()); 758 notifyChange(); 759 validateEntries(); 760 } 762 763 private javax.swing.JPanel generalPanel; 765 private javax.swing.JLabel jndiNameLabel; 766 private javax.swing.JTextField jndiNameTextField; 767 private javax.swing.JLabel nameLabel; 768 private javax.swing.JTextField nameTextField; 769 private java.awt.Panel panel1; 770 private javax.swing.JComboBox passByRefComboBox; 771 private javax.swing.JLabel passByRefLabel; 772 protected javax.swing.JTabbedPane tabbedPanel; 773 } 775 | Popular Tags |