1 19 20 package org.netbeans.modules.websvc.wsitconf.ui.service; 21 22 import java.awt.Color ; 23 import java.awt.Dialog ; 24 import java.util.Collection ; 25 import java.util.Set ; 26 import javax.swing.undo.UndoManager ; 27 import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel; 28 import org.netbeans.modules.websvc.api.jaxws.project.config.Service; 29 import org.netbeans.modules.websvc.wsitconf.spi.SecurityProfile; 30 import org.netbeans.modules.websvc.wsitconf.spi.SecurityProfileRegistry; 31 import org.netbeans.modules.websvc.wsitconf.ui.ComboConstants; 32 import org.netbeans.modules.websvc.wsitconf.ui.service.subpanels.AdvancedRMPanel; 33 import org.netbeans.modules.websvc.wsitconf.ui.service.subpanels.KeystorePanel; 34 import org.netbeans.modules.websvc.wsitconf.ui.service.subpanels.STSConfigServicePanel; 35 import org.netbeans.modules.websvc.wsitconf.ui.service.subpanels.TruststorePanel; 36 import org.netbeans.modules.websvc.wsitconf.ui.service.subpanels.ValidatorsPanel; 37 import org.netbeans.modules.websvc.wsitconf.util.UndoCounter; 38 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.ProprietarySecurityPolicyModelHelper; 39 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.TransportModelHelper; 40 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.ProfilesModelHelper; 41 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.RMMSModelHelper; 42 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.RMModelHelper; 43 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.RMSunModelHelper; 44 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.SecurityPolicyModelHelper; 45 import org.netbeans.modules.xml.multiview.ui.SectionInnerPanel; 46 import org.netbeans.modules.xml.multiview.ui.SectionView; 47 import org.netbeans.modules.xml.multiview.ui.SectionVisualTheme; 48 import org.netbeans.modules.xml.wsdl.model.Binding; 49 import org.netbeans.modules.xml.wsdl.model.WSDLModel; 50 import org.netbeans.modules.xml.xam.ComponentEvent; 51 import org.netbeans.modules.xml.xam.ComponentListener; 52 import org.openide.DialogDescriptor; 53 import org.openide.DialogDisplayer; 54 import org.openide.nodes.Node; 55 import javax.swing.*; 56 import org.netbeans.api.project.Project; 57 import org.netbeans.modules.websvc.wsitconf.spi.SecurityCheckerRegistry; 58 import org.netbeans.modules.websvc.wsitconf.util.Util; 59 import org.netbeans.modules.xml.wsdl.model.BindingOperation; 60 import org.openide.util.NbBundle; 61 62 66 public class ServicePanel extends SectionInnerPanel { 67 68 private WSDLModel model; 69 private Node node; 70 private Binding binding; 71 private UndoManager undoManager; 72 private Project project; 73 private Service service; 74 private JaxWsModel jaxwsmodel; 75 76 private String oldProfile; 77 78 private boolean doNotSync = false; 79 80 private boolean inSync = false; 81 private boolean isFromJava = true; 82 83 private final Color RED = new java.awt.Color (255, 0, 0); 84 private Color REGULAR = new java.awt.Color (0, 0, 0); 85 86 public ServicePanel(SectionView view, Node node, Project p, Binding binding, UndoManager undoManager, JaxWsModel jaxwsmodel) { 87 super(view); 88 this.model = binding.getModel(); 89 this.project = p; 90 this.node = node; 91 this.undoManager = undoManager; 92 this.binding = binding; 93 this.jaxwsmodel = jaxwsmodel; 94 initComponents(); 95 96 REGULAR = profileInfoField.getForeground(); 97 98 if (node != null) { 99 service = (Service)node.getLookup().lookup(Service.class); 100 if (service != null) { 101 String wsdlUrl = service.getWsdlUrl(); 102 if (wsdlUrl != null) { isFromJava = false; 104 } 105 } 106 } else { 107 isFromJava = false; 108 } 109 110 mtomChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 111 rmChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 112 orderedChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 113 securityChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 114 profileComboLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 115 profileCombo.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 116 profileInfoField.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 117 profileInfoField.setFont(mtomChBox.getFont()); 118 stsChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 119 tcpChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 120 fiChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 121 jSeparator1.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 122 jSeparator2.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 123 jSeparator3.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 124 125 addImmediateModifier(mtomChBox); 126 addImmediateModifier(rmChBox); 127 addImmediateModifier(orderedChBox); 128 addImmediateModifier(securityChBox); 129 addImmediateModifier(profileCombo); 130 addImmediateModifier(stsChBox); 131 addImmediateModifier(tcpChBox); 132 addImmediateModifier(fiChBox); 133 134 inSync = true; 135 profileCombo.removeAllItems(); 136 137 Set <SecurityProfile> profiles = SecurityProfileRegistry.getDefault().getSecurityProfiles(); 138 139 for (SecurityProfile profile : profiles) { 140 if (profile.isProfileSupported(project, binding)) { 141 profileCombo.addItem(profile.getDisplayName()); 142 } 143 } 144 145 inSync = false; 146 sync(); 147 148 model.addComponentListener(new ComponentListener() { 149 public void valueChanged(ComponentEvent evt) { 150 if (!doNotSync) { 151 sync(); 152 } 153 } 154 public void childrenAdded(ComponentEvent evt) { 155 if (!doNotSync) { 156 sync(); 157 } 158 } 159 public void childrenDeleted(ComponentEvent evt) { 160 if (!doNotSync) { 161 sync(); 162 } 163 } 164 }); 165 } 166 167 private void sync() { 168 inSync = true; 169 170 boolean mtomEnabled = TransportModelHelper.isMtomEnabled(binding); 171 setChBox(mtomChBox, mtomEnabled); 172 173 boolean fiEnabled = TransportModelHelper.isFIEnabled(binding); 174 setChBox(fiChBox, !fiEnabled); 175 176 boolean tcpEnabled = TransportModelHelper.isTCPEnabled(binding); 177 setChBox(tcpChBox, tcpEnabled); 178 179 boolean rmEnabled = RMModelHelper.isRMEnabled(binding); 180 setChBox(rmChBox, rmEnabled); 181 setChBox(orderedChBox, RMSunModelHelper.isOrderedEnabled(binding)); 182 183 boolean securityEnabled = SecurityPolicyModelHelper.isSecurityEnabled(binding); 184 setChBox(securityChBox, securityEnabled); 185 if (securityEnabled) { 186 setSecurityProfile(ProfilesModelHelper.getSecurityProfile(binding)); 187 } else { 188 setSecurityProfile(ComboConstants.PROF_USERNAME); 189 } 190 191 boolean stsEnabled = ProprietarySecurityPolicyModelHelper.isSTSEnabled(binding); 192 setChBox(stsChBox, stsEnabled); 193 194 enableDisable(); 195 inSync = false; 196 } 197 198 @Override 199 public void setValue(javax.swing.JComponent source, Object value) { 200 if (inSync) return; 201 202 if (source.equals(rmChBox)) { 203 if (rmChBox.isSelected()) { 204 if (!(RMModelHelper.isRMEnabled(binding))) { 205 RMModelHelper.enableRM(binding); 206 } 207 } else { 208 if (RMModelHelper.isRMEnabled(binding)) { 209 RMModelHelper.disableRM(binding); 210 RMMSModelHelper.disableFlowControl(binding); 211 RMSunModelHelper.disableOrdered(binding); 212 RMModelHelper.setInactivityTimeout(binding, null); 213 RMMSModelHelper.setMaxReceiveBufferSize(binding, null); 214 } 215 } 216 } 217 218 if (source.equals(orderedChBox)) { 219 if (orderedChBox.isSelected()) { 220 if (!(RMSunModelHelper.isOrderedEnabled(binding))) { 221 RMSunModelHelper.enableOrdered(binding); 222 } 223 } else { 224 if (RMSunModelHelper.isOrderedEnabled(binding)) { 225 RMSunModelHelper.disableOrdered(binding); 226 } 227 } 228 } 229 230 if (source.equals(mtomChBox)) { 231 if (mtomChBox.isSelected()) { 232 if (!(TransportModelHelper.isMtomEnabled(binding))) { 233 TransportModelHelper.enableMtom(binding); 234 } 235 } else { 236 if (TransportModelHelper.isMtomEnabled(binding)) { 237 TransportModelHelper.disableMtom(binding); 238 } 239 } 240 } 241 242 if (source.equals(fiChBox)) { 243 if (!fiChBox.isSelected()) { 244 if (!(TransportModelHelper.isFIEnabled(binding))) { 245 TransportModelHelper.enableFI(binding, true); 246 } 247 } else { 248 if (TransportModelHelper.isFIEnabled(binding)) { 249 TransportModelHelper.enableFI(binding, false); 250 } 251 } 252 } 253 254 if (source.equals(tcpChBox)) { 255 boolean jsr109 = ((jaxwsmodel.getJsr109() == null) || (jaxwsmodel.getJsr109().equals(Boolean.TRUE))); 256 if (tcpChBox.isSelected()) { 257 if (!(TransportModelHelper.isTCPEnabled(binding))) { 258 TransportModelHelper.enableTCP(service, isFromJava, binding, project, true, jsr109); 259 } 260 } else { 261 if (TransportModelHelper.isTCPEnabled(binding)) { 262 TransportModelHelper.enableTCP(service, isFromJava, binding, project, false, jsr109); 263 } 264 } 265 } 266 267 if (source.equals(securityChBox)) { 268 if (securityChBox.isSelected()) { 269 String profile = (String ) profileCombo.getSelectedItem(); 270 profileCombo.setSelectedItem(profile); 271 oldProfile = profile; 272 } else { 273 SecurityPolicyModelHelper.disableSecurity(binding, true); 274 } 275 } 276 277 if (source.equals(stsChBox)) { 278 if (stsChBox.isSelected()) { 279 ProprietarySecurityPolicyModelHelper.enableSTS(binding); 280 } else { 281 ProprietarySecurityPolicyModelHelper.disableSTS(binding); 282 } 283 } 284 285 if (source.equals(profileCombo)) { 286 doNotSync = true; 287 try { 288 String profile = (String ) profileCombo.getSelectedItem(); 289 ProfilesModelHelper.setSecurityProfile(binding, profile, oldProfile); 290 profileInfoField.setText(ProfileUtil.getProfileInfo(profile)); 291 oldProfile = profile; 292 } finally { 293 doNotSync = false; 294 } 295 } 296 297 enableDisable(); 298 } 299 300 public Boolean getMtom() { 301 if (mtomChBox.isSelected()) { 302 return Boolean.TRUE; 303 } 304 return Boolean.FALSE; 305 } 306 307 public Boolean getRM() { 308 if (rmChBox.isSelected()) { 309 return Boolean.TRUE; 310 } 311 return Boolean.FALSE; 312 } 313 314 public Boolean getOrdered() { 315 if (orderedChBox.isSelected()) { 316 return Boolean.TRUE; 317 } 318 return Boolean.FALSE; 319 } 320 321 public Boolean getSecurity() { 322 if (securityChBox.isSelected()) { 323 return Boolean.TRUE; 324 } 325 return Boolean.FALSE; 326 } 327 328 private void setChBox(JCheckBox chBox, Boolean enable) { 329 if (enable == null) { 330 chBox.setSelected(false); 331 } else { 332 chBox.setSelected(enable); 333 } 334 } 335 336 private void setSecurityProfile(String profile) { 338 this.profileCombo.setSelectedItem(profile); 339 this.profileInfoField.setText(ProfileUtil.getProfileInfo(profile)); 340 } 341 342 @Override 343 public void documentChanged(javax.swing.text.JTextComponent comp, String value) { 344 SectionView view = getSectionView(); 345 enableDisable(); 346 if (view != null) { 347 view.getErrorPanel().clearError(); 348 } 349 } 350 351 @Override 352 public void rollbackValue(javax.swing.text.JTextComponent source) { 353 } 354 355 @Override 356 protected void endUIChange() { } 357 358 public void linkButtonPressed(Object ddBean, String ddProperty) { } 359 360 public javax.swing.JComponent getErrorComponent(String errorId) { 361 return new JButton(); 362 } 363 364 private void enableDisable() { 365 366 boolean relSelected = rmChBox.isSelected(); 367 orderedChBox.setEnabled(relSelected); 368 rmAdvanced.setEnabled(relSelected); 369 370 boolean isTomcat = Util.isTomcat(project); 371 tcpChBox.setEnabled(!isTomcat); 372 373 boolean amSec = SecurityCheckerRegistry.getDefault().isNonWsitSecurityEnabled(node, jaxwsmodel); 374 375 if (!amSec) { 377 378 boolean jsr109 = ((jaxwsmodel.getJsr109() == null) || (jaxwsmodel.getJsr109().equals(Boolean.TRUE))); 379 380 securityChBox.setEnabled(true); 381 profileInfoField.setForeground(REGULAR); 382 383 boolean secSelected = securityChBox.isSelected(); 384 profileComboLabel.setEnabled(secSelected); 385 profileCombo.setEnabled(secSelected); 386 profileInfoField.setEnabled(secSelected); 387 profConfigButton.setEnabled(secSelected); 388 stsChBox.setEnabled(secSelected && !isFromJava); 389 390 boolean stsSelected = stsChBox.isSelected(); 391 stsConfigButton.setEnabled(stsSelected); 392 393 boolean storeConfigRequired = true; 394 395 boolean someSecSelected = secSelected; 396 if (!someSecSelected) { 397 Collection <BindingOperation> bops = binding.getBindingOperations(); 398 for (BindingOperation bop : bops) { 399 someSecSelected = SecurityPolicyModelHelper.isSecurityEnabled(bop); 400 if (someSecSelected) break; 401 } 402 } 403 404 validatorsButton.setEnabled(someSecSelected && !jsr109); 405 keyButton.setEnabled(storeConfigRequired && someSecSelected); 406 trustButton.setEnabled(storeConfigRequired && someSecSelected); 407 } else { profileComboLabel.setEnabled(false); 409 profileCombo.setEnabled(false); 410 profileInfoField.setEnabled(false); 411 profConfigButton.setEnabled(false); 412 stsChBox.setEnabled(false); 413 stsConfigButton.setEnabled(false); 414 securityChBox.setEnabled(false); 415 validatorsButton.setEnabled(false); 416 keyButton.setEnabled(false); 417 trustButton.setEnabled(false); 418 profileInfoField.setEnabled(true); 419 profileInfoField.setForeground(RED); 420 profileInfoField.setText(NbBundle.getMessage(ServicePanel.class, "TXT_AMSecSelected")); 421 } 422 } 423 424 429 private void initComponents() { 431 432 mtomChBox = new javax.swing.JCheckBox (); 433 rmChBox = new javax.swing.JCheckBox (); 434 securityChBox = new javax.swing.JCheckBox (); 435 orderedChBox = new javax.swing.JCheckBox (); 436 profileComboLabel = new javax.swing.JLabel (); 437 profileCombo = new javax.swing.JComboBox (); 438 rmAdvanced = new javax.swing.JButton (); 439 jSeparator1 = new javax.swing.JSeparator (); 440 jSeparator2 = new javax.swing.JSeparator (); 441 stsChBox = new javax.swing.JCheckBox (); 442 tcpChBox = new javax.swing.JCheckBox (); 443 jSeparator3 = new javax.swing.JSeparator (); 444 keyButton = new javax.swing.JButton (); 445 trustButton = new javax.swing.JButton (); 446 stsConfigButton = new javax.swing.JButton (); 447 profConfigButton = new javax.swing.JButton (); 448 fiChBox = new javax.swing.JCheckBox (); 449 jScrollPane1 = new javax.swing.JScrollPane (); 450 profileInfoField = new javax.swing.JTextArea (); 451 validatorsButton = new javax.swing.JButton (); 452 453 addFocusListener(new java.awt.event.FocusAdapter () { 454 public void focusGained(java.awt.event.FocusEvent evt) { 455 formFocusGained(evt); 456 } 457 }); 458 addAncestorListener(new javax.swing.event.AncestorListener () { 459 public void ancestorMoved(javax.swing.event.AncestorEvent evt) { 460 } 461 public void ancestorAdded(javax.swing.event.AncestorEvent evt) { 462 formAncestorAdded(evt); 463 } 464 public void ancestorRemoved(javax.swing.event.AncestorEvent evt) { 465 } 466 }); 467 468 org.openide.awt.Mnemonics.setLocalizedText(mtomChBox, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_Section_Service_mtomChBox")); mtomChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 470 mtomChBox.setMargin(new java.awt.Insets (0, 0, 0, 0)); 471 472 org.openide.awt.Mnemonics.setLocalizedText(rmChBox, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_Section_Service_rmChBox")); rmChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 474 rmChBox.setMargin(new java.awt.Insets (0, 0, 0, 0)); 475 476 org.openide.awt.Mnemonics.setLocalizedText(securityChBox, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_Section_Service_securityChBox")); securityChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 478 securityChBox.setMargin(new java.awt.Insets (0, 0, 0, 0)); 479 480 org.openide.awt.Mnemonics.setLocalizedText(orderedChBox, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_Section_Service_OrderedChBox")); orderedChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 482 orderedChBox.setMargin(new java.awt.Insets (0, 0, 0, 0)); 483 484 profileComboLabel.setLabelFor(profileCombo); 485 org.openide.awt.Mnemonics.setLocalizedText(profileComboLabel, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_profileComboLabel")); 487 profileCombo.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "SAML Sender Vouches With Certificates", "Anonymous with Bilateral Certificates" })); 488 489 org.openide.awt.Mnemonics.setLocalizedText(rmAdvanced, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_Section_Service_Advanced")); rmAdvanced.addActionListener(new java.awt.event.ActionListener () { 491 public void actionPerformed(java.awt.event.ActionEvent evt) { 492 rmAdvancedActionPerformed(evt); 493 } 494 }); 495 496 org.openide.awt.Mnemonics.setLocalizedText(stsChBox, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_Section_Service_stsChBox")); stsChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 498 stsChBox.setMargin(new java.awt.Insets (0, 0, 0, 0)); 499 500 org.openide.awt.Mnemonics.setLocalizedText(tcpChBox, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_Section_Service_tcpChBox")); tcpChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 502 tcpChBox.setMargin(new java.awt.Insets (0, 0, 0, 0)); 503 504 org.openide.awt.Mnemonics.setLocalizedText(keyButton, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_keystoreButton")); keyButton.addActionListener(new java.awt.event.ActionListener () { 506 public void actionPerformed(java.awt.event.ActionEvent evt) { 507 keyButtonActionPerformed(evt); 508 } 509 }); 510 511 org.openide.awt.Mnemonics.setLocalizedText(trustButton, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_truststoreButton")); trustButton.addActionListener(new java.awt.event.ActionListener () { 513 public void actionPerformed(java.awt.event.ActionEvent evt) { 514 trustButtonActionPerformed(evt); 515 } 516 }); 517 518 org.openide.awt.Mnemonics.setLocalizedText(stsConfigButton, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_Section_Service_stsConfigButton")); stsConfigButton.addActionListener(new java.awt.event.ActionListener () { 520 public void actionPerformed(java.awt.event.ActionEvent evt) { 521 stsConfigButtonActionPerformed(evt); 522 } 523 }); 524 525 org.openide.awt.Mnemonics.setLocalizedText(profConfigButton, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_keyConfigButton")); profConfigButton.addActionListener(new java.awt.event.ActionListener () { 527 public void actionPerformed(java.awt.event.ActionEvent evt) { 528 profConfigButtonActionPerformed(evt); 529 } 530 }); 531 532 org.openide.awt.Mnemonics.setLocalizedText(fiChBox, org.openide.util.NbBundle.getMessage(ServicePanel.class, "LBL_Section_Service_fiChBox")); fiChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 534 fiChBox.setMargin(new java.awt.Insets (0, 0, 0, 0)); 535 536 profileInfoField.setEditable(false); 537 profileInfoField.setLineWrap(true); 538 profileInfoField.setText("This is a text This is a text This is a text This is a text This is a text This is a text This is"); 539 profileInfoField.setWrapStyleWord(true); 540 profileInfoField.setAutoscrolls(false); 541 profileInfoField.setOpaque(false); 542 jScrollPane1.setViewportView(profileInfoField); 543 544 java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/websvc/wsitconf/ui/service/Bundle"); org.openide.awt.Mnemonics.setLocalizedText(validatorsButton, bundle.getString("LBL_validatorsButton")); validatorsButton.addActionListener(new java.awt.event.ActionListener () { 547 public void actionPerformed(java.awt.event.ActionEvent evt) { 548 validatorsButtonActionPerformed(evt); 549 } 550 }); 551 552 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 553 this.setLayout(layout); 554 layout.setHorizontalGroup( 555 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 556 .add(layout.createSequentialGroup() 557 .addContainerGap() 558 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 559 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) 560 .add(org.jdesktop.layout.GroupLayout.LEADING, jSeparator1) 561 .add(org.jdesktop.layout.GroupLayout.LEADING, jSeparator2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE) 562 .add(org.jdesktop.layout.GroupLayout.LEADING, mtomChBox) 563 .add(org.jdesktop.layout.GroupLayout.LEADING, rmChBox) 564 .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() 565 .add(17, 17, 17) 566 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 567 .add(rmAdvanced) 568 .add(orderedChBox)) 569 .add(79, 79, 79)) 570 .add(org.jdesktop.layout.GroupLayout.LEADING, securityChBox) 571 .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() 572 .add(17, 17, 17) 573 .add(profileComboLabel) 574 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 575 .add(profileCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 228, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 576 .add(6, 6, 6) 577 .add(profConfigButton)) 578 .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 427, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 579 .add(layout.createSequentialGroup() 580 .add(stsChBox) 581 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 582 .add(stsConfigButton)) 583 .add(layout.createSequentialGroup() 584 .add(17, 17, 17) 585 .add(keyButton) 586 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 587 .add(trustButton) 588 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 589 .add(validatorsButton)) 590 .add(jSeparator3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 436, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 591 .add(tcpChBox) 592 .add(fiChBox)) 593 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 594 ); 595 layout.setVerticalGroup( 596 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 597 .add(layout.createSequentialGroup() 598 .addContainerGap() 599 .add(mtomChBox) 600 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 601 .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 602 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 603 .add(rmChBox) 604 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 605 .add(orderedChBox) 606 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 607 .add(rmAdvanced) 608 .add(8, 8, 8) 609 .add(jSeparator2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 610 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 611 .add(securityChBox) 612 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 613 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 614 .add(profileComboLabel) 615 .add(profileCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 616 .add(profConfigButton)) 617 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 618 .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 58, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 619 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 620 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 621 .add(trustButton) 622 .add(keyButton) 623 .add(validatorsButton)) 624 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 625 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 626 .add(stsChBox) 627 .add(stsConfigButton)) 628 .add(11, 11, 11) 629 .add(jSeparator3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 630 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 631 .add(tcpChBox) 632 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 633 .add(fiChBox) 634 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 635 ); 636 } 638 private void formFocusGained(java.awt.event.FocusEvent evt) { enableDisable(); 640 } 642 private void formAncestorAdded(javax.swing.event.AncestorEvent evt) { enableDisable(); 644 } 646 private void validatorsButtonActionPerformed(java.awt.event.ActionEvent evt) { ValidatorsPanel vPanel = new ValidatorsPanel(binding, project); DialogDescriptor dlgDesc = new DialogDescriptor(vPanel, 649 NbBundle.getMessage(ServicePanel.class, "LBL_Validators_Panel_Title")); Dialog dlg = DialogDisplayer.getDefault().createDialog(dlgDesc); 651 652 dlg.setVisible(true); 653 654 if (dlgDesc.getValue() == dlgDesc.OK_OPTION) { 655 vPanel.storeState(); 656 } 657 658 } 660 private void profConfigButtonActionPerformed(java.awt.event.ActionEvent evt) { String prof = (String ) profileCombo.getSelectedItem(); 662 SecurityProfile p = SecurityProfileRegistry.getDefault().getProfile(prof); 663 p.displayConfig(binding, undoManager); 664 } 666 private void stsConfigButtonActionPerformed(java.awt.event.ActionEvent evt) { UndoCounter undoCounter = new UndoCounter(); 668 model.addUndoableEditListener(undoCounter); 669 670 STSConfigServicePanel stsConfigPanel = new STSConfigServicePanel(model, project, binding); 671 DialogDescriptor dlgDesc = new DialogDescriptor(stsConfigPanel, 672 NbBundle.getMessage(ServicePanel.class, "LBL_STSConfig_Panel_Title")); Dialog dlg = DialogDisplayer.getDefault().createDialog(dlgDesc); 674 675 dlg.setVisible(true); 676 if (dlgDesc.getValue() == dlgDesc.CANCEL_OPTION) { 677 for (int i=0; i<undoCounter.getCounter();i++) { 678 if (undoManager.canUndo()) { 679 undoManager.undo(); 680 } 681 } 682 } 683 684 model.removeUndoableEditListener(undoCounter); 685 } 687 private void trustButtonActionPerformed(java.awt.event.ActionEvent evt) { boolean jsr109 = ((jaxwsmodel.getJsr109() == null) || (jaxwsmodel.getJsr109().equals(Boolean.TRUE))); 689 TruststorePanel storePanel = new TruststorePanel(binding, project, jsr109); 690 DialogDescriptor dlgDesc = new DialogDescriptor(storePanel, 691 NbBundle.getMessage(ServicePanel.class, "LBL_Truststore_Panel_Title")); Dialog dlg = DialogDisplayer.getDefault().createDialog(dlgDesc); 693 694 dlg.setVisible(true); 695 if (dlgDesc.getValue() == dlgDesc.OK_OPTION) { 696 storePanel.storeState(); 697 } 698 } 700 private void keyButtonActionPerformed(java.awt.event.ActionEvent evt) { boolean jsr109 = ((jaxwsmodel.getJsr109() == null) || (jaxwsmodel.getJsr109().equals(Boolean.TRUE))); 702 KeystorePanel storePanel = new KeystorePanel(binding, project, jsr109); 703 DialogDescriptor dlgDesc = new DialogDescriptor(storePanel, 704 NbBundle.getMessage(ServicePanel.class, "LBL_Keystore_Panel_Title")); Dialog dlg = DialogDisplayer.getDefault().createDialog(dlgDesc); 706 707 dlg.setVisible(true); 708 709 if (dlgDesc.getValue() == dlgDesc.OK_OPTION) { 710 storePanel.storeState(); 711 } 712 } 714 private void rmAdvancedActionPerformed(java.awt.event.ActionEvent evt) { AdvancedRMPanel advancedRMPanel = new AdvancedRMPanel(binding); DialogDescriptor dlgDesc = new DialogDescriptor(advancedRMPanel, 717 NbBundle.getMessage(ServicePanel.class, "LBL_AdvancedRM_Title")); Dialog dlg = DialogDisplayer.getDefault().createDialog(dlgDesc); 719 720 dlg.setVisible(true); 721 722 if (dlgDesc.getValue() == dlgDesc.OK_OPTION) { 723 advancedRMPanel.storeState(); 724 } 725 } 727 private javax.swing.JCheckBox fiChBox; 729 private javax.swing.JScrollPane jScrollPane1; 730 private javax.swing.JSeparator jSeparator1; 731 private javax.swing.JSeparator jSeparator2; 732 private javax.swing.JSeparator jSeparator3; 733 private javax.swing.JButton keyButton; 734 private javax.swing.JCheckBox mtomChBox; 735 private javax.swing.JCheckBox orderedChBox; 736 private javax.swing.JButton profConfigButton; 737 private javax.swing.JComboBox profileCombo; 738 private javax.swing.JLabel profileComboLabel; 739 private javax.swing.JTextArea profileInfoField; 740 private javax.swing.JButton rmAdvanced; 741 private javax.swing.JCheckBox rmChBox; 742 private javax.swing.JCheckBox securityChBox; 743 private javax.swing.JCheckBox stsChBox; 744 private javax.swing.JButton stsConfigButton; 745 private javax.swing.JCheckBox tcpChBox; 746 private javax.swing.JButton trustButton; 747 private javax.swing.JButton validatorsButton; 748 750 } 751 | Popular Tags |