1 19 20 package org.netbeans.modules.websvc.jaxrpc.project; 21 22 import java.util.Arrays ; 23 import java.util.HashSet ; 24 import java.util.Iterator ; 25 import java.util.List ; 26 import java.util.Set ; 27 28 import java.awt.Color ; 29 import java.awt.event.ItemEvent ; 30 import java.awt.event.ItemListener ; 31 import java.util.HashMap ; 32 import java.util.Map ; 33 34 import javax.swing.JCheckBox ; 35 import javax.swing.JPanel ; 36 import javax.swing.DefaultListModel ; 37 import javax.swing.event.DocumentEvent ; 38 import javax.swing.event.DocumentListener ; 39 import javax.swing.text.Document ; 40 import javax.swing.text.BadLocationException ; 41 import org.netbeans.modules.websvc.api.webservices.WsCompileEditorSupport; 42 import org.openide.ErrorManager; 43 import org.openide.WizardValidationException; 44 import org.openide.util.HelpCtx; 45 import org.openide.util.NbBundle; 46 47 51 public class CustomizerWsCompile extends javax.swing.JPanel implements WsCompileEditorSupport.Panel, HelpCtx.Provider { 52 53 public static final Color ErrorTextForegroundColor = new Color (89, 79, 191); 54 55 private static final int MAX_IMPORTANT_FEATURES = 12; 56 57 private DefaultListModel servicesModel; 58 private JCheckBox [] featureCheckboxes; 59 60 private int serviceType; 61 private String features; 62 private boolean updatingDisplay; 63 private boolean processingCheckBox; 64 private boolean processingFeatureString; 65 66 public CustomizerWsCompile() { 67 initComponents(); 68 initUserComponents(); 69 } 70 71 76 private void initComponents() { 78 java.awt.GridBagConstraints gridBagConstraints; 79 80 jPnlServices = new javax.swing.JPanel (); 81 jLblServices = new javax.swing.JLabel (); 82 jScrollPane1 = new javax.swing.JScrollPane (); 83 jLstServices = new javax.swing.JList (); 84 jPnlFeatures = new javax.swing.JPanel (); 85 jLblPanelDescription = new javax.swing.JLabel (); 86 jPnlOptions = new javax.swing.JPanel (); 87 jChkFeatureA = new javax.swing.JCheckBox (); 88 jChkFeatureB = new javax.swing.JCheckBox (); 89 jChkFeatureC = new javax.swing.JCheckBox (); 90 jChkFeatureD = new javax.swing.JCheckBox (); 91 jChkFeatureE = new javax.swing.JCheckBox (); 92 jChkFeatureF = new javax.swing.JCheckBox (); 93 jChkFeatureG = new javax.swing.JCheckBox (); 94 jChkFeatureH = new javax.swing.JCheckBox (); 95 jChkFeatureI = new javax.swing.JCheckBox (); 96 jChkFeatureJ = new javax.swing.JCheckBox (); 97 jChkFeatureK = new javax.swing.JCheckBox (); 98 jChkFeatureL = new javax.swing.JCheckBox (); 99 jLblEnabledFeatures = new javax.swing.JLabel (); 100 jScrollPane2 = new javax.swing.JScrollPane (); 101 jTxtEnabledFeatures = new javax.swing.JTextArea (); 102 jLblError = new javax.swing.JLabel (); 103 104 setLayout(new java.awt.GridBagLayout ()); 105 106 jPnlServices.setLayout(new java.awt.GridBagLayout ()); 107 108 jLblServices.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(CustomizerWsCompile.class, "LBL_WebServicesMnemonic").charAt(0)); 109 jLblServices.setLabelFor(jLstServices); 110 jLblServices.setText(org.openide.util.NbBundle.getMessage(CustomizerWsCompile.class, "LBL_WebServices")); 111 gridBagConstraints = new java.awt.GridBagConstraints (); 112 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 113 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 114 gridBagConstraints.insets = new java.awt.Insets (0, 0, 2, 0); 115 jPnlServices.add(jLblServices, gridBagConstraints); 116 117 jLstServices.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); 118 jLstServices.addListSelectionListener(new javax.swing.event.ListSelectionListener () { 119 public void valueChanged(javax.swing.event.ListSelectionEvent evt) { 120 jLstServicesValueChanged(evt); 121 } 122 }); 123 124 jScrollPane1.setViewportView(jLstServices); 125 126 gridBagConstraints = new java.awt.GridBagConstraints (); 127 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 128 gridBagConstraints.weightx = 1.0; 129 gridBagConstraints.weighty = 1.0; 130 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 0); 131 jPnlServices.add(jScrollPane1, gridBagConstraints); 132 133 gridBagConstraints = new java.awt.GridBagConstraints (); 134 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 135 gridBagConstraints.weightx = 0.5; 136 gridBagConstraints.weighty = 1.0; 137 add(jPnlServices, gridBagConstraints); 138 139 jPnlFeatures.setLayout(new java.awt.GridBagLayout ()); 140 141 org.openide.awt.Mnemonics.setLocalizedText(jLblPanelDescription, NbBundle.getMessage(CustomizerWsCompile.class, "LBL_PanelDescriptionService")); 142 gridBagConstraints = new java.awt.GridBagConstraints (); 143 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 144 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 145 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 146 jPnlFeatures.add(jLblPanelDescription, gridBagConstraints); 147 148 jPnlOptions.setLayout(new java.awt.GridBagLayout ()); 149 150 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureA, "Feature A"); 151 gridBagConstraints = new java.awt.GridBagConstraints (); 152 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 153 gridBagConstraints.weightx = 0.33; 154 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 155 jPnlOptions.add(jChkFeatureA, gridBagConstraints); 156 157 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureB, "Feature B"); 158 gridBagConstraints = new java.awt.GridBagConstraints (); 159 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 160 gridBagConstraints.weightx = 0.33; 161 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 162 jPnlOptions.add(jChkFeatureB, gridBagConstraints); 163 164 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureC, "Feature C"); 165 gridBagConstraints = new java.awt.GridBagConstraints (); 166 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 167 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 168 gridBagConstraints.weightx = 0.33; 169 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 170 jPnlOptions.add(jChkFeatureC, gridBagConstraints); 171 172 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureD, "Feature D"); 173 gridBagConstraints = new java.awt.GridBagConstraints (); 174 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 175 gridBagConstraints.weightx = 0.33; 176 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 177 jPnlOptions.add(jChkFeatureD, gridBagConstraints); 178 179 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureE, "Feature E"); 180 gridBagConstraints = new java.awt.GridBagConstraints (); 181 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 182 gridBagConstraints.weightx = 0.33; 183 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 184 jPnlOptions.add(jChkFeatureE, gridBagConstraints); 185 186 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureF, "Feature F"); 187 gridBagConstraints = new java.awt.GridBagConstraints (); 188 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 189 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 190 gridBagConstraints.weightx = 0.33; 191 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 192 jPnlOptions.add(jChkFeatureF, gridBagConstraints); 193 194 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureG, "Feature G"); 195 gridBagConstraints = new java.awt.GridBagConstraints (); 196 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 197 gridBagConstraints.weightx = 0.33; 198 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 199 jPnlOptions.add(jChkFeatureG, gridBagConstraints); 200 201 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureH, "Feature H"); 202 gridBagConstraints = new java.awt.GridBagConstraints (); 203 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 204 gridBagConstraints.weightx = 0.33; 205 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 206 jPnlOptions.add(jChkFeatureH, gridBagConstraints); 207 208 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureI, "Feature I"); 209 gridBagConstraints = new java.awt.GridBagConstraints (); 210 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 211 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 212 gridBagConstraints.weightx = 0.33; 213 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 214 jPnlOptions.add(jChkFeatureI, gridBagConstraints); 215 216 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureJ, "Feature J"); 217 gridBagConstraints = new java.awt.GridBagConstraints (); 218 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 219 gridBagConstraints.weightx = 0.33; 220 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 221 jPnlOptions.add(jChkFeatureJ, gridBagConstraints); 222 223 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureK, "Feature K"); 224 gridBagConstraints = new java.awt.GridBagConstraints (); 225 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 226 gridBagConstraints.weightx = 0.33; 227 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 228 jPnlOptions.add(jChkFeatureK, gridBagConstraints); 229 230 org.openide.awt.Mnemonics.setLocalizedText(jChkFeatureL, "Feature L"); 231 gridBagConstraints = new java.awt.GridBagConstraints (); 232 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 233 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 234 gridBagConstraints.weightx = 0.33; 235 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 11); 236 jPnlOptions.add(jChkFeatureL, gridBagConstraints); 237 238 gridBagConstraints = new java.awt.GridBagConstraints (); 239 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 240 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 241 gridBagConstraints.weightx = 1.0; 242 jPnlFeatures.add(jPnlOptions, gridBagConstraints); 243 244 jLblEnabledFeatures.setLabelFor(jTxtEnabledFeatures); 245 org.openide.awt.Mnemonics.setLocalizedText(jLblEnabledFeatures, org.openide.util.NbBundle.getMessage(CustomizerWsCompile.class, "LBL_EnabledFeatures")); 246 jLblEnabledFeatures.setOpaque(true); 247 gridBagConstraints = new java.awt.GridBagConstraints (); 248 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 249 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 250 gridBagConstraints.insets = new java.awt.Insets (0, 0, 2, 11); 251 jPnlFeatures.add(jLblEnabledFeatures, gridBagConstraints); 252 253 jTxtEnabledFeatures.setLineWrap(true); 254 jTxtEnabledFeatures.setRows(3); 255 jTxtEnabledFeatures.setWrapStyleWord(true); 256 jScrollPane2.setViewportView(jTxtEnabledFeatures); 257 258 gridBagConstraints = new java.awt.GridBagConstraints (); 259 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 260 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 261 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; 262 gridBagConstraints.weightx = 1.0; 263 gridBagConstraints.weighty = 1.0; 264 gridBagConstraints.insets = new java.awt.Insets (0, 0, 11, 0); 265 jPnlFeatures.add(jScrollPane2, gridBagConstraints); 266 267 gridBagConstraints = new java.awt.GridBagConstraints (); 268 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 269 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 270 gridBagConstraints.weightx = 0.5; 271 gridBagConstraints.weighty = 1.0; 272 gridBagConstraints.insets = new java.awt.Insets (0, 11, 0, 0); 273 add(jPnlFeatures, gridBagConstraints); 274 275 org.openide.awt.Mnemonics.setLocalizedText(jLblError, " "); 276 gridBagConstraints = new java.awt.GridBagConstraints (); 277 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 278 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 279 gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST; 280 gridBagConstraints.insets = new java.awt.Insets (0, 0, 6, 0); 281 add(jLblError, gridBagConstraints); 282 283 } 285 private void jLstServicesValueChanged(javax.swing.event.ListSelectionEvent evt) { if(!evt.getValueIsAdjusting()) { 287 WsCompileEditorSupport.ServiceSettings entry = (WsCompileEditorSupport.ServiceSettings) jLstServices.getSelectedValue(); 288 if(entry != null) { 289 updateServiceFeatures(entry); 290 } else { 291 disableServiceFeatures(); 292 } 293 } 294 } 296 private javax.swing.JCheckBox jChkFeatureA; 298 private javax.swing.JCheckBox jChkFeatureB; 299 private javax.swing.JCheckBox jChkFeatureC; 300 private javax.swing.JCheckBox jChkFeatureD; 301 private javax.swing.JCheckBox jChkFeatureE; 302 private javax.swing.JCheckBox jChkFeatureF; 303 private javax.swing.JCheckBox jChkFeatureG; 304 private javax.swing.JCheckBox jChkFeatureH; 305 private javax.swing.JCheckBox jChkFeatureI; 306 private javax.swing.JCheckBox jChkFeatureJ; 307 private javax.swing.JCheckBox jChkFeatureK; 308 private javax.swing.JCheckBox jChkFeatureL; 309 private javax.swing.JLabel jLblEnabledFeatures; 310 private javax.swing.JLabel jLblError; 311 private javax.swing.JLabel jLblPanelDescription; 312 private javax.swing.JLabel jLblServices; 313 private javax.swing.JList jLstServices; 314 private javax.swing.JPanel jPnlFeatures; 315 private javax.swing.JPanel jPnlOptions; 316 private javax.swing.JPanel jPnlServices; 317 private javax.swing.JScrollPane jScrollPane1; 318 private javax.swing.JScrollPane jScrollPane2; 319 private javax.swing.JTextArea jTxtEnabledFeatures; 320 322 private void initUserComponents() { 323 updatingDisplay = false; 324 processingCheckBox = false; 325 processingFeatureString = false; 326 327 jLblError.setForeground(ErrorTextForegroundColor); 328 servicesModel = new DefaultListModel (); 329 330 featureCheckboxes = new JCheckBox [MAX_IMPORTANT_FEATURES]; 339 featureCheckboxes[0] = jChkFeatureA; 340 featureCheckboxes[1] = jChkFeatureB; 341 featureCheckboxes[2] = jChkFeatureC; 342 featureCheckboxes[3] = jChkFeatureD; 343 featureCheckboxes[4] = jChkFeatureE; 344 featureCheckboxes[5] = jChkFeatureF; 345 featureCheckboxes[6] = jChkFeatureG; 346 featureCheckboxes[7] = jChkFeatureH; 347 featureCheckboxes[8] = jChkFeatureI; 348 featureCheckboxes[9] = jChkFeatureJ; 349 featureCheckboxes[10] = jChkFeatureK; 350 featureCheckboxes[11] = jChkFeatureL; 351 352 ItemListener checkBoxListener = new ItemListener () { 353 public void itemStateChanged(ItemEvent evt) { 354 if(!processingFeatureString) { 355 JCheckBox source = (JCheckBox ) evt.getSource(); 356 String feature = source.getText(); 357 enableFeature(feature, evt.getStateChange() == ItemEvent.SELECTED); 358 } 359 } 360 }; 361 362 for(int i = 0; i < MAX_IMPORTANT_FEATURES; i++) { 363 featureCheckboxes[i].addItemListener(checkBoxListener); 364 } 365 366 jTxtEnabledFeatures.getDocument().addDocumentListener(new DocumentListener () { 367 public void changedUpdate(DocumentEvent e) { 368 if(!updatingDisplay) { 369 updateFeatureList(e); 370 } 371 } 372 public void insertUpdate(DocumentEvent e) { 373 if(!updatingDisplay) { 374 updateFeatureList(e); 375 } 376 } 377 public void removeUpdate(DocumentEvent e) { 378 if(!updatingDisplay) { 379 updateFeatureList(e); 380 } 381 } 382 }); 383 } 384 385 private void enableFeature(String feature, boolean enable) { 386 boolean modified = false; 387 Set featureSet = featuresAsSet(features); 388 if(enable && !featureSet.contains(feature)) { 389 featureSet.add(feature); 391 modified = true; 392 } else if(!enable && featureSet.contains(feature)) { 393 featureSet.remove(feature); 395 modified = true; 396 } 397 398 if(modified) { 399 try { 400 processingCheckBox = true; 401 String newFeatures = featuresAsString(featureSet); 402 jTxtEnabledFeatures.setText(newFeatures); 403 } finally { 404 processingCheckBox = false; 405 } 406 } 407 } 408 409 private Set featuresAsSet(String featureString) { 410 HashSet set = new HashSet (10); 411 String [] featureList = featureString.split(","); 412 for(int i = 0; i < featureList.length; i++) { 413 String feature = featureList[i].trim(); 414 if(feature != null && feature.length() > 0) { 415 set.add(feature); 416 } 417 } 418 return set; 419 } 420 421 private String featuresAsString(Set featureSet) { 422 StringBuffer featureString = new StringBuffer (featureSet.size()*16); 423 for(Iterator iter = featureSet.iterator(); iter.hasNext(); ) { 424 String feature = (String ) iter.next(); 425 featureString.append(feature); 426 if(iter.hasNext()) { 427 featureString.append(", "); 428 } 429 } 430 return featureString.toString(); 431 } 432 433 private void updateFeatureList(DocumentEvent e) { 434 Document doc = e.getDocument(); 435 String oldFeatures = features; 436 437 try { 438 features = doc.getText(0, doc.getLength()); 439 } catch(BadLocationException ex) { 440 ErrorManager.getDefault().notify(ErrorManager.EXCEPTION, ex); 441 } 442 443 if(!features.equals(oldFeatures)) { 444 WsCompileEditorSupport.ServiceSettings entry = (WsCompileEditorSupport.ServiceSettings) jLstServices.getSelectedValue(); 445 entry.setNewFeatures(features); 446 checkSettings(entry); 447 448 if(!processingCheckBox) { 449 updateCheckBoxes(features); 450 } 451 452 WsCompileEditorSupport.FeatureDescriptor oldF = new WsCompileEditorSupport.FeatureDescriptor(entry.getServiceName(), oldFeatures); 453 WsCompileEditorSupport.FeatureDescriptor newF = new WsCompileEditorSupport.FeatureDescriptor(entry.getServiceName(), features); 454 firePropertyChange(WsCompileEditorSupport.PROP_FEATURES_CHANGED, oldF, newF); 456 } 457 } 458 459 private void updateCheckBoxes(String features) { 460 try { 461 processingFeatureString = true; 462 Set featureSet = featuresAsSet(features); 463 for(int i = 0; i < MAX_IMPORTANT_FEATURES; i++) { 464 String feature = featureCheckboxes[i].getText(); 465 featureCheckboxes[i].setSelected(featureSet.contains(feature)); 466 } 467 } finally { 468 processingFeatureString = false; 469 } 470 } 471 472 private boolean checkSettings(WsCompileEditorSupport.ServiceSettings settings) { 473 String message = validateSettings(settings); 474 if(message != null) { 475 jLblError.setText(message); 476 } else { 477 jLblError.setText(" "); 478 } 479 return message != null; 480 } 481 482 private String validateSettings(WsCompileEditorSupport.ServiceSettings settings) { 483 String message = null; 485 List availableFeatures = settings.getAvailableFeatures(); 486 String [] featuresList = settings.getNewFeatures().split(","); 487 for(int i = 0; i < featuresList.length; i++) { 488 featuresList[i] = featuresList[i].trim(); 489 if(featuresList[i] != null && featuresList[i].length() > 0 && !availableFeatures.contains(featuresList[i])) { 490 if(masterWsCompileFeatures.contains(featuresList[i])) { 492 message = NbBundle.getMessage(CustomizerWsCompile.class, "ERR_FeatureNotSupported", featuresList[i]); 493 } else { 494 message = NbBundle.getMessage(CustomizerWsCompile.class, "ERR_InvalidFeature", featuresList[i]); 495 } 496 break; 497 } 498 } 499 500 boolean usesRpcLiteral = false; 503 boolean usesDocumentLiteral = false; 504 505 for(int i = 0; i < featuresList.length; i++) { 506 if("rpcliteral".equals(featuresList[i])) { 507 usesRpcLiteral = true; 508 } else if("documentliteral".equals(featuresList[i])) { 509 usesDocumentLiteral = true; 510 } 511 } 512 513 if(usesRpcLiteral && usesDocumentLiteral) { 514 message = NbBundle.getMessage(CustomizerWsCompile.class, "ERR_InvalidBinding"); 515 } 516 517 return message; 518 } 519 520 private void updateServiceFeatures(WsCompileEditorSupport.ServiceSettings entry) { 521 try { 522 updatingDisplay = true; 523 enableServiceFeatures(); 524 525 int index = 0; 526 for(Iterator iter = entry.getImportantFeatures().iterator(); iter.hasNext() && index < MAX_IMPORTANT_FEATURES; index++) { 527 String feature = (String ) iter.next(); 528 featureCheckboxes[index].setVisible(true); 529 featureCheckboxes[index].setText(feature); 530 featureCheckboxes[index].setToolTipText(WsCompileFeatures.getFeaturesMap().get(feature)); 531 } 532 533 while(index < MAX_IMPORTANT_FEATURES) { 534 featureCheckboxes[index++].setVisible(false); 535 } 536 537 features = entry.getNewFeatures(); 538 updateCheckBoxes(features); 539 jTxtEnabledFeatures.setText(features); 540 541 checkSettings(entry); 543 } finally { 544 updatingDisplay = false; 545 } 546 } 547 548 private void enableServiceFeatures() { 549 550 } 551 552 private void disableServiceFeatures() { 553 554 } 555 556 public void addNotify() { 557 super.addNotify(); 558 559 jLstServices.setModel(servicesModel); 560 jLstServices.setSelectedIndex(0); 561 } 562 563 public void removeNotify() { 564 super.removeNotify(); 565 } 566 567 571 public void initValues(List settings) { 572 assert settings.size() > 0; 573 574 jLblServices.setText(NbBundle.getMessage(CustomizerWsCompile.class, "LBL_WebServices")); 575 jLblPanelDescription.setText(NbBundle.getMessage(CustomizerWsCompile.class, "LBL_PanelDescriptionService")); 576 577 servicesModel.clear(); 579 for(Iterator iter = settings.iterator(); iter.hasNext(); ) { 580 WsCompileEditorSupport.ServiceSettings entry = (WsCompileEditorSupport.ServiceSettings) iter.next(); 581 servicesModel.addElement(entry); 582 } 583 } 584 585 public JPanel getComponent() { 586 return this; 587 } 588 589 public void validatePanel() throws org.openide.WizardValidationException { 590 WsCompileEditorSupport.ServiceSettings entry = (WsCompileEditorSupport.ServiceSettings) jLstServices.getSelectedValue(); 592 if(entry != null) { 593 final String message = validateSettings(entry); 594 if(message != null) { 595 throw new WizardValidationException(jTxtEnabledFeatures, message, message); 596 } 597 } 598 } 599 600 public HelpCtx getHelpCtx() { 601 return HelpCtx.DEFAULT_HELP; 602 } 603 604 605 private static final HashSet masterWsCompileFeatures = new HashSet (WsCompileFeatures.getFeaturesMap().keySet()); 606 } | Popular Tags |