1 6 7 package SOFA.SOFAnet.Browser; 8 9 import SOFA.SOFAnet.Repository.InputTrigger; 10 import SOFA.SOFAnet.Repository.NodeNameFilter; 11 import SOFA.SOFAnet.Repository.BundleNameFilter; 12 import SOFA.SOFAnet.Repository.NodeNameList; 13 import SOFA.SOFAnet.Repository.OutputTrigger; 14 import SOFA.SOFAnet.Repository.NodeNameLicList; 15 import java.util.Date ; 16 import java.text.DateFormat ; 17 import java.text.ParseException ; 18 import javax.swing.*; 19 import java.awt.Component ; 20 import java.awt.Frame ; 21 22 26 public class InputTriggerEditDialog extends javax.swing.JDialog 27 { 28 private InputTrigger inputTrigger; 29 private BundleNameFilter bundleFilter; 30 private NodeNameFilter nodeFilter; 31 private OutputTrigger alpOutputTrigger; 32 private NodeNameLicList apNodeNameLicList; 33 private InputTriggerShareActionPropertiesEditDialog.ActionShareParameters asParameters; 34 private NodeNameList apoNodeNameList; 35 private boolean isOK; 36 37 public static boolean showDialog(Component frameComp, InputTrigger inputTrigger, String title) 38 { 39 Frame frame = JOptionPane.getFrameForComponent(frameComp); 40 InputTriggerEditDialog dialog = new InputTriggerEditDialog(frame, true, inputTrigger, title); 41 dialog.setLocationRelativeTo(frameComp); 42 dialog.setVisible(true); 43 return dialog.isOK(); 44 } 45 46 47 public InputTriggerEditDialog(java.awt.Frame parent, boolean modal, InputTrigger inputTrigger, String title) 48 { 49 super(parent, modal); 50 this.inputTrigger = inputTrigger; 51 bundleFilter = inputTrigger.getBundleFilter(); 52 nodeFilter = inputTrigger.getNodeFilter(); 53 alpOutputTrigger = inputTrigger.getAlpOutputTrigger(); 54 apNodeNameLicList = inputTrigger.getApNodeNameLicList(); 55 apoNodeNameList = inputTrigger.getApoNodeNameList(); 56 asParameters = new InputTriggerShareActionPropertiesEditDialog.ActionShareParameters(inputTrigger); 57 isOK = false; 58 59 initComponents(); 60 setTitle(title); 61 62 nameTextField.setText(inputTrigger.getName()); 63 descriptionTextField.setText(inputTrigger.getDescription()); 64 pushCheckBox.setSelected(inputTrigger.isPushSource()); 65 pullCheckBox.setSelected(inputTrigger.isPullSource()); 66 madeCheckBox.setSelected(inputTrigger.isMadeSource()); 67 switch (inputTrigger.getBundleType()) 68 { 69 default: 70 case InputTrigger.BUNDLETYPE_FULL: 71 bundleCheckBox.setSelected(true); 72 bundleOfferCheckBox.setSelected(false); 73 break; 74 case InputTrigger.BUNDLETYPE_OFFER: 75 bundleCheckBox.setSelected(false); 76 bundleOfferCheckBox.setSelected(true); 77 break; 78 case InputTrigger.BUNDLETYPE_ALL: 79 bundleCheckBox.setSelected(true); 80 bundleOfferCheckBox.setSelected(true); 81 break; 82 } 83 84 if (bundleFilter != null) 85 { 86 bundleFilterCheckBox.setSelected(true); 87 bundleFilterButton.setEnabled(true); 88 } 89 else 90 { 91 bundleFilterCheckBox.setSelected(false); 92 bundleFilterButton.setEnabled(false); 93 } 94 95 if (nodeFilter != null) 96 { 97 nodeFilterCheckBox.setSelected(true); 98 nodeFilterButton.setEnabled(true); 99 } 100 else 101 { 102 nodeFilterCheckBox.setSelected(false); 103 nodeFilterButton.setEnabled(false); 104 } 105 106 if (bundleFilter != null) bundleFilter = (BundleNameFilter)bundleFilter.clone(); 107 else bundleFilter = new BundleNameFilter(); 108 if (nodeFilter != null) nodeFilter = (NodeNameFilter)nodeFilter.clone(); 109 else nodeFilter = new NodeNameFilter(); 110 if (apoNodeNameList != null) apoNodeNameList = (NodeNameList)apoNodeNameList.clone(); 111 else apoNodeNameList = new NodeNameList(); 112 if (alpOutputTrigger != null) alpOutputTrigger = (OutputTrigger)alpOutputTrigger.clone(); 113 else alpOutputTrigger = new OutputTrigger(); 114 if (apNodeNameLicList != null) apNodeNameLicList = (NodeNameLicList)apNodeNameLicList.clone(); 115 else apNodeNameLicList = new NodeNameLicList(); 116 117 Date validFrom = inputTrigger.getValidFrom(); 118 Date validTo = inputTrigger.getValidTo(); 119 DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM); 120 121 if (validFrom != null) validFromTextField.setText(dateFormat.format(validFrom)); 122 else validFromTextField.setText(""); 123 124 if (validTo != null) validToTextField.setText(dateFormat.format(validTo)); 125 else validToTextField.setText(""); 126 127 autodeleteCheckBox.setSelected(inputTrigger.getAutoDelete()); 128 129 if (inputTrigger.isContract()) 130 { 131 contractIDTextField.setText(inputTrigger.getContractID()); 132 contractRuleTextField.setText(inputTrigger.getContractRule()); 133 } 134 135 int actions = inputTrigger.getActions(); 136 137 if ((actions & InputTrigger.ACTION_INSTALL) != 0) 138 { 139 actionInstallCheckBox.setSelected(true); 140 } 141 else 142 { 143 actionInstallCheckBox.setSelected(false); 144 } 145 146 if ((actions & InputTrigger.ACTION_SHARE) != 0) 147 { 148 actionShareCheckBox.setSelected(true); 149 editShareParametersButton.setEnabled(true); 150 } 151 else 152 { 153 actionShareCheckBox.setSelected(false); 154 editShareParametersButton.setEnabled(false); 155 } 156 157 if ((actions & InputTrigger.ACTION_ALLOW_PULL) != 0) 158 { 159 actionAllowPullCheckBox.setSelected(true); 160 alpOutputTriggerButton.setEnabled(true); 161 } 162 else 163 { 164 actionAllowPullCheckBox.setSelected(false); 165 alpOutputTriggerButton.setEnabled(false); 166 } 167 168 if ((actions & InputTrigger.ACTION_PUSH) != 0) 169 { 170 actionPushCheckBox.setSelected(true); 171 apNodeNameLicListButton.setEnabled(true); 172 } 173 else 174 { 175 actionPushCheckBox.setSelected(false); 176 apNodeNameLicListButton.setEnabled(false); 177 } 178 179 if ((actions & InputTrigger.ACTION_PUSH_OFFER) != 0) 180 { 181 actionPushOfferCheckBox.setSelected(true); 182 apoNodeNameListButton.setEnabled(true); 183 } 184 else 185 { 186 actionPushOfferCheckBox.setSelected(false); 187 apoNodeNameListButton.setEnabled(false); 188 } 189 190 if ((actions & InputTrigger.ACTION_DELETE) != 0) 191 { 192 actionDeleteCheckBox.setSelected(true); 193 } 194 else 195 { 196 actionDeleteCheckBox.setSelected(false); 197 } 198 199 } 200 201 public boolean isOK() 202 { 203 return isOK; 204 } 205 206 211 private void initComponents() { 213 nameAndDescriptionPanel = new javax.swing.JPanel (); 214 nameLabel = new javax.swing.JLabel (); 215 nameTextField = new javax.swing.JTextField (); 216 descriptionLabel = new javax.swing.JLabel (); 217 descriptionTextField = new javax.swing.JTextField (); 218 jPanel7 = new javax.swing.JPanel (); 219 jPanel1 = new javax.swing.JPanel (); 220 sourcePanel = new javax.swing.JPanel (); 221 pushCheckBox = new javax.swing.JCheckBox (); 222 pullCheckBox = new javax.swing.JCheckBox (); 223 madeCheckBox = new javax.swing.JCheckBox (); 224 bundleTypePanel = new javax.swing.JPanel (); 225 bundleCheckBox = new javax.swing.JCheckBox (); 226 bundleOfferCheckBox = new javax.swing.JCheckBox (); 227 jPanel2 = new javax.swing.JPanel (); 228 jPanel3 = new javax.swing.JPanel (); 229 parametersPanel = new javax.swing.JPanel (); 230 bundleFilterPanel = new javax.swing.JPanel (); 231 bundleFilterCheckBox = new javax.swing.JCheckBox (); 232 bundleFilterButton = new javax.swing.JButton (); 233 nodeFilterPanel = new javax.swing.JPanel (); 234 nodeFilterCheckBox = new javax.swing.JCheckBox (); 235 nodeFilterButton = new javax.swing.JButton (); 236 validFromPanel = new javax.swing.JPanel (); 237 validFromLabel = new javax.swing.JLabel (); 238 validFromTextField = new javax.swing.JTextField (); 239 validToPanel = new javax.swing.JPanel (); 240 validToLabel = new javax.swing.JLabel (); 241 validToTextField = new javax.swing.JTextField (); 242 autodeleteCheckBox = new javax.swing.JCheckBox (); 243 contractPanel = new javax.swing.JPanel (); 244 jPanel5 = new javax.swing.JPanel (); 245 contractIDLabel = new javax.swing.JLabel (); 246 contractIDTextField = new javax.swing.JTextField (); 247 contractRuleLabel = new javax.swing.JLabel (); 248 contractRuleTextField = new javax.swing.JTextField (); 249 jPanel4 = new javax.swing.JPanel (); 250 actionsPanel = new javax.swing.JPanel (); 251 actionInstallPanel = new javax.swing.JPanel (); 252 actionInstallCheckBox = new javax.swing.JCheckBox (); 253 actionSharePanel = new javax.swing.JPanel (); 254 actionShareCheckBox = new javax.swing.JCheckBox (); 255 editShareParametersButton = new javax.swing.JButton (); 256 actionAllowPullPanel = new javax.swing.JPanel (); 257 actionAllowPullCheckBox = new javax.swing.JCheckBox (); 258 alpOutputTriggerButton = new javax.swing.JButton (); 259 actionPushPanel = new javax.swing.JPanel (); 260 actionPushCheckBox = new javax.swing.JCheckBox (); 261 apNodeNameLicListButton = new javax.swing.JButton (); 262 actionPushOfferPanel = new javax.swing.JPanel (); 263 actionPushOfferCheckBox = new javax.swing.JCheckBox (); 264 apoNodeNameListButton = new javax.swing.JButton (); 265 actionDeleteCheckBox = new javax.swing.JCheckBox (); 266 jPanel6 = new javax.swing.JPanel (); 267 OKButton = new javax.swing.JButton (); 268 cancelButton = new javax.swing.JButton (); 269 270 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); 271 nameAndDescriptionPanel.setLayout(new java.awt.GridLayout (4, 0)); 272 273 nameAndDescriptionPanel.setBorder(new javax.swing.border.TitledBorder ("Name and Description of Input Trigger")); 274 nameLabel.setText("Name:"); 275 nameAndDescriptionPanel.add(nameLabel); 276 277 nameTextField.setEditable(false); 278 nameAndDescriptionPanel.add(nameTextField); 279 280 descriptionLabel.setText("Description:"); 281 nameAndDescriptionPanel.add(descriptionLabel); 282 283 nameAndDescriptionPanel.add(descriptionTextField); 284 285 getContentPane().add(nameAndDescriptionPanel, java.awt.BorderLayout.NORTH); 286 287 jPanel7.setLayout(new java.awt.BorderLayout ()); 288 289 jPanel1.setLayout(new java.awt.GridLayout (1, 0)); 290 291 sourcePanel.setBorder(new javax.swing.border.TitledBorder ("Source")); 292 pushCheckBox.setText("Push"); 293 sourcePanel.add(pushCheckBox); 294 295 pullCheckBox.setText("Pull"); 296 sourcePanel.add(pullCheckBox); 297 298 madeCheckBox.setText("Made"); 299 sourcePanel.add(madeCheckBox); 300 301 jPanel1.add(sourcePanel); 302 303 bundleTypePanel.setBorder(new javax.swing.border.TitledBorder ("Bundle Type")); 304 bundleCheckBox.setText("Bundle"); 305 bundleTypePanel.add(bundleCheckBox); 306 307 bundleOfferCheckBox.setText("Bundle Offer"); 308 bundleTypePanel.add(bundleOfferCheckBox); 309 310 jPanel1.add(bundleTypePanel); 311 312 jPanel7.add(jPanel1, java.awt.BorderLayout.NORTH); 313 314 jPanel2.setLayout(new java.awt.BorderLayout ()); 315 316 jPanel3.setLayout(new java.awt.GridLayout (1, 0)); 317 318 parametersPanel.setLayout(new java.awt.GridLayout (5, 0)); 319 320 parametersPanel.setBorder(new javax.swing.border.TitledBorder ("Parameters")); 321 bundleFilterPanel.setLayout(new javax.swing.BoxLayout (bundleFilterPanel, javax.swing.BoxLayout.X_AXIS)); 322 323 bundleFilterCheckBox.setText("Bundle Filter"); 324 bundleFilterCheckBox.addActionListener(new java.awt.event.ActionListener () 325 { 326 public void actionPerformed(java.awt.event.ActionEvent evt) 327 { 328 bundleFilterCheckBoxActionPerformed(evt); 329 } 330 }); 331 332 bundleFilterPanel.add(bundleFilterCheckBox); 333 334 bundleFilterButton.setText("Edit Bundle Filter"); 335 bundleFilterButton.addActionListener(new java.awt.event.ActionListener () 336 { 337 public void actionPerformed(java.awt.event.ActionEvent evt) 338 { 339 bundleFilterButtonActionPerformed(evt); 340 } 341 }); 342 343 bundleFilterPanel.add(bundleFilterButton); 344 345 parametersPanel.add(bundleFilterPanel); 346 347 nodeFilterPanel.setLayout(new javax.swing.BoxLayout (nodeFilterPanel, javax.swing.BoxLayout.X_AXIS)); 348 349 nodeFilterCheckBox.setText("Node Filter"); 350 nodeFilterCheckBox.addActionListener(new java.awt.event.ActionListener () 351 { 352 public void actionPerformed(java.awt.event.ActionEvent evt) 353 { 354 nodeFilterCheckBoxActionPerformed(evt); 355 } 356 }); 357 358 nodeFilterPanel.add(nodeFilterCheckBox); 359 360 nodeFilterButton.setText("Edit Node Filter"); 361 nodeFilterButton.addActionListener(new java.awt.event.ActionListener () 362 { 363 public void actionPerformed(java.awt.event.ActionEvent evt) 364 { 365 nodeFilterButtonActionPerformed(evt); 366 } 367 }); 368 369 nodeFilterPanel.add(nodeFilterButton); 370 371 parametersPanel.add(nodeFilterPanel); 372 373 validFromPanel.setLayout(new javax.swing.BoxLayout (validFromPanel, javax.swing.BoxLayout.X_AXIS)); 374 375 validFromLabel.setText("Valid From:"); 376 validFromPanel.add(validFromLabel); 377 378 validFromPanel.add(validFromTextField); 379 380 parametersPanel.add(validFromPanel); 381 382 validToPanel.setLayout(new javax.swing.BoxLayout (validToPanel, javax.swing.BoxLayout.X_AXIS)); 383 384 validToLabel.setText("Valid To:"); 385 validToPanel.add(validToLabel); 386 387 validToPanel.add(validToTextField); 388 389 parametersPanel.add(validToPanel); 390 391 autodeleteCheckBox.setText("Automatically Delete When Expired"); 392 parametersPanel.add(autodeleteCheckBox); 393 394 jPanel3.add(parametersPanel); 395 396 contractPanel.setLayout(new java.awt.BorderLayout ()); 397 398 contractPanel.setBorder(new javax.swing.border.TitledBorder ("Contract Connection")); 399 contractPanel.setMinimumSize(new java.awt.Dimension (200, 111)); 400 contractPanel.setPreferredSize(new java.awt.Dimension (200, 111)); 401 jPanel5.setLayout(new java.awt.GridLayout (4, 0)); 402 403 contractIDLabel.setText("Contract ID:"); 404 jPanel5.add(contractIDLabel); 405 406 jPanel5.add(contractIDTextField); 407 408 contractRuleLabel.setText("Contract Rule:"); 409 jPanel5.add(contractRuleLabel); 410 411 jPanel5.add(contractRuleTextField); 412 413 contractPanel.add(jPanel5, java.awt.BorderLayout.NORTH); 414 415 jPanel3.add(contractPanel); 416 417 jPanel2.add(jPanel3, java.awt.BorderLayout.NORTH); 418 419 jPanel4.setLayout(new java.awt.BorderLayout ()); 420 421 actionsPanel.setLayout(new java.awt.GridLayout (6, 0)); 422 423 actionsPanel.setBorder(new javax.swing.border.TitledBorder ("Actions")); 424 actionInstallPanel.setLayout(new javax.swing.BoxLayout (actionInstallPanel, javax.swing.BoxLayout.X_AXIS)); 425 426 actionInstallCheckBox.setText("Install Bundle"); 427 actionInstallPanel.add(actionInstallCheckBox); 428 429 actionsPanel.add(actionInstallPanel); 430 431 actionSharePanel.setLayout(new javax.swing.BoxLayout (actionSharePanel, javax.swing.BoxLayout.X_AXIS)); 432 433 actionShareCheckBox.setText("Share Bundle"); 434 actionShareCheckBox.addActionListener(new java.awt.event.ActionListener () 435 { 436 public void actionPerformed(java.awt.event.ActionEvent evt) 437 { 438 actionShareCheckBoxActionPerformed(evt); 439 } 440 }); 441 442 actionSharePanel.add(actionShareCheckBox); 443 444 editShareParametersButton.setText("Edit Share Parameters"); 445 editShareParametersButton.addActionListener(new java.awt.event.ActionListener () 446 { 447 public void actionPerformed(java.awt.event.ActionEvent evt) 448 { 449 editShareParametersButtonActionPerformed(evt); 450 } 451 }); 452 453 actionSharePanel.add(editShareParametersButton); 454 455 actionsPanel.add(actionSharePanel); 456 457 actionAllowPullPanel.setLayout(new javax.swing.BoxLayout (actionAllowPullPanel, javax.swing.BoxLayout.X_AXIS)); 458 459 actionAllowPullCheckBox.setText("Allow Pull"); 460 actionAllowPullCheckBox.addActionListener(new java.awt.event.ActionListener () 461 { 462 public void actionPerformed(java.awt.event.ActionEvent evt) 463 { 464 actionAllowPullCheckBoxActionPerformed(evt); 465 } 466 }); 467 468 actionAllowPullPanel.add(actionAllowPullCheckBox); 469 470 alpOutputTriggerButton.setText("Edit Output Trigger"); 471 alpOutputTriggerButton.addActionListener(new java.awt.event.ActionListener () 472 { 473 public void actionPerformed(java.awt.event.ActionEvent evt) 474 { 475 alpOutputTriggerButtonActionPerformed(evt); 476 } 477 }); 478 479 actionAllowPullPanel.add(alpOutputTriggerButton); 480 481 actionsPanel.add(actionAllowPullPanel); 482 483 actionPushPanel.setLayout(new javax.swing.BoxLayout (actionPushPanel, javax.swing.BoxLayout.X_AXIS)); 484 485 actionPushCheckBox.setText("Push Bundle"); 486 actionPushCheckBox.addActionListener(new java.awt.event.ActionListener () 487 { 488 public void actionPerformed(java.awt.event.ActionEvent evt) 489 { 490 actionPushCheckBoxActionPerformed(evt); 491 } 492 }); 493 494 actionPushPanel.add(actionPushCheckBox); 495 496 apNodeNameLicListButton.setText("Edit Nodes & Licence Numbers"); 497 apNodeNameLicListButton.addActionListener(new java.awt.event.ActionListener () 498 { 499 public void actionPerformed(java.awt.event.ActionEvent evt) 500 { 501 apNodeNameLicListButtonActionPerformed(evt); 502 } 503 }); 504 505 actionPushPanel.add(apNodeNameLicListButton); 506 507 actionsPanel.add(actionPushPanel); 508 509 actionPushOfferPanel.setLayout(new javax.swing.BoxLayout (actionPushOfferPanel, javax.swing.BoxLayout.X_AXIS)); 510 511 actionPushOfferCheckBox.setText("Push Bundle Offer"); 512 actionPushOfferCheckBox.addActionListener(new java.awt.event.ActionListener () 513 { 514 public void actionPerformed(java.awt.event.ActionEvent evt) 515 { 516 actionPushOfferCheckBoxActionPerformed(evt); 517 } 518 }); 519 520 actionPushOfferPanel.add(actionPushOfferCheckBox); 521 522 apoNodeNameListButton.setText("Edit Nodes"); 523 apoNodeNameListButton.addActionListener(new java.awt.event.ActionListener () 524 { 525 public void actionPerformed(java.awt.event.ActionEvent evt) 526 { 527 apoNodeNameListButtonActionPerformed(evt); 528 } 529 }); 530 531 actionPushOfferPanel.add(apoNodeNameListButton); 532 533 actionsPanel.add(actionPushOfferPanel); 534 535 actionDeleteCheckBox.setText("Delete Bundle"); 536 actionsPanel.add(actionDeleteCheckBox); 537 538 jPanel4.add(actionsPanel, java.awt.BorderLayout.NORTH); 539 540 jPanel2.add(jPanel4, java.awt.BorderLayout.CENTER); 541 542 jPanel7.add(jPanel2, java.awt.BorderLayout.CENTER); 543 544 getContentPane().add(jPanel7, java.awt.BorderLayout.CENTER); 545 546 OKButton.setText("OK"); 547 OKButton.addActionListener(new java.awt.event.ActionListener () 548 { 549 public void actionPerformed(java.awt.event.ActionEvent evt) 550 { 551 OKButtonActionPerformed(evt); 552 } 553 }); 554 555 jPanel6.add(OKButton); 556 557 cancelButton.setText("Cancel"); 558 cancelButton.addActionListener(new java.awt.event.ActionListener () 559 { 560 public void actionPerformed(java.awt.event.ActionEvent evt) 561 { 562 cancelButtonActionPerformed(evt); 563 } 564 }); 565 566 jPanel6.add(cancelButton); 567 568 getContentPane().add(jPanel6, java.awt.BorderLayout.SOUTH); 569 570 pack(); 571 } 573 private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) { dispose(); 576 } 578 private void OKButtonActionPerformed(java.awt.event.ActionEvent evt) { if (!bundleCheckBox.isSelected() && !bundleOfferCheckBox.isSelected()) 581 { 582 JOptionPane.showMessageDialog(this, "Invalid Bundle Type - at least one option must be selected", "Error", JOptionPane.ERROR_MESSAGE); 583 return; 584 } 585 586 Date validFrom = null; 587 Date validTo = null; 588 try 589 { 590 DateFormat dateFormat = DateFormat.getInstance(); 591 String validFromText = validFromTextField.getText().trim().toLowerCase(); 592 if (validFromText.length() != 0 && validFromText.compareTo("no limitation") != 0) validFrom = dateFormat.parse(validFromText); 593 594 String validToText = validToTextField.getText().trim().toLowerCase(); 595 if (validToText.length() != 0 && validToText.compareTo("no limitation") != 0) validTo = dateFormat.parse(validToText); 596 } 597 catch (ParseException e) 598 { 599 JOptionPane.showMessageDialog(this, "Error occured while parsing 'Valid From' or 'Valid To':\n" + e, "Error", JOptionPane.ERROR_MESSAGE); 600 return; 601 } 602 603 String contractID = contractIDTextField.getText().trim(); 604 String contractRule = contractRuleTextField.getText().trim(); 605 if (contractID.length() != 0 && contractRule.length() == 0) 606 { 607 JOptionPane.showMessageDialog(this, "Missing Contract Rule", "Error", JOptionPane.ERROR_MESSAGE); 608 return; 609 } 610 611 inputTrigger.setDescription(descriptionTextField.getText()); 612 613 inputTrigger.setPushSource(pushCheckBox.isSelected()); 614 inputTrigger.setPullSource(pullCheckBox.isSelected()); 615 inputTrigger.setMadeSource(madeCheckBox.isSelected()); 616 if (bundleCheckBox.isSelected()) 617 { 618 if (bundleOfferCheckBox.isSelected()) inputTrigger.setBundleType(InputTrigger.BUNDLETYPE_ALL); 619 else inputTrigger.setBundleType(InputTrigger.BUNDLETYPE_FULL); 620 } 621 else 622 { 623 if (bundleOfferCheckBox.isSelected()) inputTrigger.setBundleType(InputTrigger.BUNDLETYPE_OFFER); 624 else inputTrigger.setBundleType(InputTrigger.BUNDLETYPE_FULL); 625 } 626 627 if (!bundleFilterCheckBox.isSelected()) bundleFilter = null; 628 if (!nodeFilterCheckBox.isSelected()) nodeFilter = null; 629 inputTrigger.setBundleFilter(bundleFilter); 630 inputTrigger.setNodeFilter(nodeFilter); 631 inputTrigger.setValidFrom(validFrom); 632 inputTrigger.setValidTo(validTo); 633 inputTrigger.setAutoDelete(autodeleteCheckBox.isSelected()); 634 if (contractID.length() != 0) inputTrigger.setContract(contractID, contractRule); 635 else inputTrigger.setContract(null, null); 636 637 int actions = 0; 638 if (actionInstallCheckBox.isSelected()) actions |= InputTrigger.ACTION_INSTALL; 639 if (actionShareCheckBox.isSelected()) actions |= InputTrigger.ACTION_SHARE; 640 else asParameters = null; 641 if (actionAllowPullCheckBox.isSelected()) actions |= InputTrigger.ACTION_ALLOW_PULL; 642 else alpOutputTrigger = null; 643 if (actionPushCheckBox.isSelected()) actions |= InputTrigger.ACTION_PUSH; 644 else apNodeNameLicList = null; 645 if (actionPushOfferCheckBox.isSelected()) actions |= InputTrigger.ACTION_PUSH_OFFER; 646 else apoNodeNameList = null; 647 if (actionDeleteCheckBox.isSelected()) actions |= InputTrigger.ACTION_DELETE; 648 649 inputTrigger.setActions(actions); 650 651 if (asParameters != null) asParameters.save(inputTrigger); 652 inputTrigger.setAlpOutputTrigger(alpOutputTrigger); 653 inputTrigger.setApNodeNameLicList(apNodeNameLicList); 654 inputTrigger.setApoNodeNameList(apoNodeNameList); 655 656 isOK = true; 657 dispose(); 658 } 660 private void apoNodeNameListButtonActionPerformed(java.awt.event.ActionEvent evt) { StringListEditDialog.showDialog(this, apoNodeNameList.getList(), "Node Name", "Node Name List"); 663 } 665 private void actionPushOfferCheckBoxActionPerformed(java.awt.event.ActionEvent evt) { apoNodeNameListButton.setEnabled(actionPushOfferCheckBox.isSelected()); 668 } 670 private void apNodeNameLicListButtonActionPerformed(java.awt.event.ActionEvent evt) { NodeNameLicListEditDialog.showDialog(this, apNodeNameLicList, "Action Push Node Name-Licence List"); 673 } 675 private void actionPushCheckBoxActionPerformed(java.awt.event.ActionEvent evt) { apNodeNameLicListButton.setEnabled(actionPushCheckBox.isSelected()); 678 } 680 private void alpOutputTriggerButtonActionPerformed(java.awt.event.ActionEvent evt) { OutputTriggerEditDialog.showDialog(this, alpOutputTrigger, "Allow Pull Action Output Trigger Editor"); 683 } 685 private void actionAllowPullCheckBoxActionPerformed(java.awt.event.ActionEvent evt) { alpOutputTriggerButton.setEnabled(actionAllowPullCheckBox.isSelected()); 688 } 690 private void editShareParametersButtonActionPerformed(java.awt.event.ActionEvent evt) { InputTriggerShareActionPropertiesEditDialog.showDialog(this, asParameters); 693 } 695 private void actionShareCheckBoxActionPerformed(java.awt.event.ActionEvent evt) { editShareParametersButton.setEnabled(actionShareCheckBox.isSelected()); 698 } 700 private void nodeFilterButtonActionPerformed(java.awt.event.ActionEvent evt) { StringListEditDialog.showDialog(this, nodeFilter.getPatterns(), "Node Name Pattern", "Node Filter Editor"); 703 } 705 private void nodeFilterCheckBoxActionPerformed(java.awt.event.ActionEvent evt) { nodeFilterButton.setEnabled(nodeFilterCheckBox.isSelected()); 708 } 710 private void bundleFilterButtonActionPerformed(java.awt.event.ActionEvent evt) { StringListEditDialog.showDialog(this, bundleFilter.getPatterns(), "Bundle Name Pattern", "Bundle Filter Editor"); 713 } 715 private void bundleFilterCheckBoxActionPerformed(java.awt.event.ActionEvent evt) { bundleFilterButton.setEnabled(bundleFilterCheckBox.isSelected()); 718 } 720 private javax.swing.JButton OKButton; 722 private javax.swing.JCheckBox actionAllowPullCheckBox; 723 private javax.swing.JPanel actionAllowPullPanel; 724 private javax.swing.JCheckBox actionDeleteCheckBox; 725 private javax.swing.JCheckBox actionInstallCheckBox; 726 private javax.swing.JPanel actionInstallPanel; 727 private javax.swing.JCheckBox actionPushCheckBox; 728 private javax.swing.JCheckBox actionPushOfferCheckBox; 729 private javax.swing.JPanel actionPushOfferPanel; 730 private javax.swing.JPanel actionPushPanel; 731 private javax.swing.JCheckBox actionShareCheckBox; 732 private javax.swing.JPanel actionSharePanel; 733 private javax.swing.JPanel actionsPanel; 734 private javax.swing.JButton alpOutputTriggerButton; 735 private javax.swing.JButton apNodeNameLicListButton; 736 private javax.swing.JButton apoNodeNameListButton; 737 private javax.swing.JCheckBox autodeleteCheckBox; 738 private javax.swing.JCheckBox bundleCheckBox; 739 private javax.swing.JButton bundleFilterButton; 740 private javax.swing.JCheckBox bundleFilterCheckBox; 741 private javax.swing.JPanel bundleFilterPanel; 742 private javax.swing.JCheckBox bundleOfferCheckBox; 743 private javax.swing.JPanel bundleTypePanel; 744 private javax.swing.JButton cancelButton; 745 private javax.swing.JLabel contractIDLabel; 746 private javax.swing.JTextField contractIDTextField; 747 private javax.swing.JPanel contractPanel; 748 private javax.swing.JLabel contractRuleLabel; 749 private javax.swing.JTextField contractRuleTextField; 750 private javax.swing.JLabel descriptionLabel; 751 private javax.swing.JTextField descriptionTextField; 752 private javax.swing.JButton editShareParametersButton; 753 private javax.swing.JPanel jPanel1; 754 private javax.swing.JPanel jPanel2; 755 private javax.swing.JPanel jPanel3; 756 private javax.swing.JPanel jPanel4; 757 private javax.swing.JPanel jPanel5; 758 private javax.swing.JPanel jPanel6; 759 private javax.swing.JPanel jPanel7; 760 private javax.swing.JCheckBox madeCheckBox; 761 private javax.swing.JPanel nameAndDescriptionPanel; 762 private javax.swing.JLabel nameLabel; 763 private javax.swing.JTextField nameTextField; 764 private javax.swing.JButton nodeFilterButton; 765 private javax.swing.JCheckBox nodeFilterCheckBox; 766 private javax.swing.JPanel nodeFilterPanel; 767 private javax.swing.JPanel parametersPanel; 768 private javax.swing.JCheckBox pullCheckBox; 769 private javax.swing.JCheckBox pushCheckBox; 770 private javax.swing.JPanel sourcePanel; 771 private javax.swing.JLabel validFromLabel; 772 private javax.swing.JPanel validFromPanel; 773 private javax.swing.JTextField validFromTextField; 774 private javax.swing.JLabel validToLabel; 775 private javax.swing.JPanel validToPanel; 776 private javax.swing.JTextField validToTextField; 777 779 } 780 | Popular Tags |