1 package org.columba.addressbook.gui.dialog.contact; 19 20 import java.awt.BorderLayout ; 21 import java.awt.Container ; 22 import java.awt.Frame ; 23 import java.awt.Insets ; 24 import java.awt.event.ActionEvent ; 25 import java.awt.event.ActionListener ; 26 import java.net.MalformedURLException ; 27 import java.net.URL ; 28 import java.util.Iterator ; 29 import java.util.ResourceBundle ; 30 31 import javax.swing.Icon ; 32 import javax.swing.ImageIcon ; 33 import javax.swing.JButton ; 34 import javax.swing.JCheckBox ; 35 import javax.swing.JComboBox ; 36 import javax.swing.JComponent ; 37 import javax.swing.JDialog ; 38 import javax.swing.JLabel ; 39 import javax.swing.JPanel ; 40 import javax.swing.JScrollPane ; 41 import javax.swing.JTabbedPane ; 42 import javax.swing.JTextArea ; 43 import javax.swing.JTextField ; 44 45 import org.columba.addressbook.gui.base.FolderComboBox; 46 import org.columba.addressbook.model.AddressModel; 47 import org.columba.addressbook.model.ContactModel; 48 import org.columba.addressbook.model.EmailModel; 49 import org.columba.addressbook.model.IContactModel; 50 import org.columba.addressbook.model.IEmailModel; 51 import org.columba.addressbook.model.InstantMessagingModel; 52 import org.columba.addressbook.model.PhoneModel; 53 import org.columba.core.desktop.ColumbaDesktop; 54 import org.columba.core.resourceloader.IconKeys; 55 import org.columba.core.resourceloader.ImageLoader; 56 57 import com.jgoodies.forms.factories.Borders; 58 import com.jgoodies.forms.factories.DefaultComponentFactory; 59 import com.jgoodies.forms.factories.FormFactory; 60 import com.jgoodies.forms.layout.CellConstraints; 61 import com.jgoodies.forms.layout.ColumnSpec; 62 import com.jgoodies.forms.layout.FormLayout; 63 import com.jgoodies.forms.layout.FormSpec; 64 import com.jgoodies.forms.layout.RowSpec; 65 import com.jgoodies.forms.layout.Sizes; 66 67 76 77 public class ContactEditorDialog extends JDialog implements ActionListener { 78 79 private JPanel dialogPane; 80 81 private JPanel contentPane; 82 83 private JTabbedPane tabbedPane2; 84 85 private JPanel contactPanel; 86 87 private JPanel panel7; 88 89 private JButton pictureButton; 90 91 private JButton formattedNameButton; 92 93 private JTextField formattedNameTextField; 94 95 private JLabel nicknameLabel; 96 97 private JTextField nicknameTextField; 98 99 private JLabel fileunderLabel; 100 101 private JComboBox fileunderComboBox; 102 103 private JLabel whereLabel; 104 105 private FolderComboBox whereComboBox; 106 107 private JButton categoriesButton; 108 109 private JTextField categoriesTextField; 110 111 private JComponent emailSeparator; 112 113 private JComboBox emailComboBox1; 114 115 private JTextField emailTextField1; 116 117 private JComboBox emailComboBox2; 118 119 private JTextField emailTextField2; 120 121 private JComboBox emailComboBox3; 122 123 private JTextField emailTextField3; 124 125 private JComboBox emailComboBox4; 126 127 private JTextField emailTextField4; 128 129 private JCheckBox preferHtmlCheckBox; 130 131 private JComponent telephoneSeparator; 132 133 private JComboBox telephoneComboBox1; 134 135 private JTextField telephoneTextField1; 136 137 private JComboBox telephoneComboBox2; 138 139 private JTextField telephoneTextField2; 140 141 private JComboBox telephoneComboBox3; 142 143 private JTextField telephoneTextField3; 144 145 private JComboBox telephoneComboBox4; 146 147 private JTextField telephoneTextField4; 148 149 private JComponent imSeparator; 150 151 private JComboBox imComboBox1; 152 153 private JTextField imTextField1; 154 155 private JComboBox imComboBox2; 156 157 private JTextField imTextField2; 158 159 private JComboBox imComboBox3; 160 161 private JTextField imTextField3; 162 163 private JComboBox imComboBox4; 164 165 private JTextField imTextField4; 166 167 private JPanel personalInfoPanel; 168 169 private JComponent webAddressSeparator; 170 171 private JLabel homepageLabel; 172 173 private JPanel panel1; 174 175 private JTextField homepageTextField; 176 177 private JButton homepageButton; 178 179 private JLabel weblogLabel; 180 181 private JPanel panel5; 182 183 private JTextField weblogTextField; 184 185 private JButton weblogButton; 186 187 private JLabel calendarLabel; 188 189 private JPanel panel6; 190 191 private JTextField calendarTextField; 192 193 private JButton calendarButton; 194 195 private JLabel freebusyLabel; 196 197 private JPanel panel8; 198 199 private JTextField freebusyTextField; 200 201 private JButton freebusyButton; 202 203 private JComponent jobSeparator; 204 205 private JLabel professionLabel; 206 207 private JTextField professionTextField; 208 209 private JLabel titleLabel; 210 211 private JTextField titleTextField; 212 213 private JLabel companyLabel; 214 215 private JTextField companyTextField; 216 217 private JLabel departmentLabel; 218 219 private JTextField departmentTextField; 220 221 private JLabel managerLabel; 222 223 private JTextField managerTextField; 224 225 private JLabel officeLabel; 226 227 private JTextField officeTextField; 228 229 private JComponent miscellaneousSeparator; 230 231 private JLabel birthdayLabel; 232 233 private JComboBox birthdayComboBox; 234 235 private JLabel notesLabel; 236 237 private JScrollPane scrollPane3; 238 239 private JTextArea notesTextArea; 240 241 private JPanel mailingAddressPanel; 242 243 private JComponent privateSeparator; 244 245 private JLabel privateAddressLabel; 246 247 private JScrollPane scrollPane1; 248 249 private JTextArea privateAddressTextArea; 250 251 private JLabel privateCityLabel; 252 253 private JTextField privateCityTextField; 254 255 private JLabel privateZipPostalCodeLabel; 256 257 private JTextField privateZipPostalCodeTextField; 258 259 private JLabel label1; 260 261 private JTextField privateStreetTextField; 262 263 private JLabel privateStateProvinceCountyLabel; 264 265 private JTextField privateStateProvinceCountyTextField; 266 267 private JLabel privatePOBoxLabel; 268 269 private JTextField privatePOBoxTextField; 270 271 private JLabel privateCountryLabel; 272 273 private JTextField privateCountryTextField; 274 275 private JComponent workSeparator; 276 277 private JLabel workAddressLabel; 278 279 private JScrollPane scrollPane2; 280 281 private JTextArea workAddressTextArea; 282 283 private JLabel workCityLabel; 284 285 private JTextField workCityTextField; 286 287 private JLabel workZipPostalCodeLabel; 288 289 private JTextField workZipPostalCodeTextField; 290 291 private JLabel label2; 292 293 private JTextField workStreetTextField; 294 295 private JLabel workStateProvinceCountyLabel; 296 297 private JTextField workStateProvinceCountyTextField; 298 299 private JLabel workPOBoxLabel; 300 301 private JTextField workPOBoxTextField; 302 303 private JLabel workCountryLabel; 304 305 private JTextField workCountryTextField; 306 307 private JComponent otherSeparator; 308 309 private JLabel otherAddressLabel; 310 311 private JScrollPane scrollPane4; 312 313 private JTextArea otherAddressTextArea; 314 315 private JLabel otherCityLabel; 316 317 private JTextField otherCityTextField; 318 319 private JLabel otherZipPostalCodeLabel; 320 321 private JTextField otherZipPostalCodeTextField; 322 323 private JLabel label3; 324 325 private JTextField otherStreetTextField; 326 327 private JLabel otherStateProvinceCountyLabel; 328 329 private JTextField otherStateProvinceCountyTextField; 330 331 private JLabel otherPOBoxLabel; 332 333 private JTextField otherPOBoxTextField; 334 335 private JLabel otherCountryLabel; 336 337 private JTextField otherCountryTextField; 338 339 private JPanel buttonBar; 340 341 private JButton okButton; 342 343 private JButton cancelButton; 344 345 private FullNameDialog fullNameDialog; 346 347 private ResourceBundle bundle; 348 349 private IContactModel sourceModel; 350 351 private ContactModel destModel; 352 353 private boolean result = false; 354 355 public ContactEditorDialog(Frame owner, IContactModel sourceModel) { 356 super(owner, true); 357 358 this.sourceModel = sourceModel; 359 360 init(); 361 } 362 363 public ContactEditorDialog(Frame owner) { 364 super(owner, true); 365 366 init(); 367 } 368 369 372 private void init() { 373 bundle = ResourceBundle 374 .getBundle("org.columba.addressbook.i18n.dialog.contact"); 375 376 initComponents(); 377 layoutComponents(); 378 379 destModel = new ContactModel(); 380 381 fullNameDialog = new FullNameDialog(this); 382 383 updateComponents(true); 384 385 pack(); 386 setLocationRelativeTo(null); 387 setVisible(true); 388 } 389 390 public void updateFullNameDialogComponents(boolean b) { 391 if (b) { 392 393 if (sourceModel == null) 395 return; 396 397 fullNameDialog.getNamePrefixTextField().setText( 398 sourceModel.getNamePrefix()); 399 fullNameDialog.getLastNameTextField().setText( 400 sourceModel.getFamilyName()); 401 fullNameDialog.getFirstNameTextField().setText( 402 sourceModel.getGivenName()); 403 fullNameDialog.getMiddleNameTextField().setText( 404 sourceModel.getAdditionalNames()); 405 fullNameDialog.getNameSuffixTextField().setText( 406 sourceModel.getNameSuffix()); 407 408 } else { 409 destModel.setNamePrefix(fullNameDialog.getNamePrefixTextField() 410 .getText()); 411 destModel.setFamilyName(fullNameDialog.getLastNameTextField() 412 .getText()); 413 destModel.setGivenName(fullNameDialog.getFirstNameTextField() 414 .getText()); 415 destModel.setAdditionalNames(fullNameDialog 416 .getMiddleNameTextField().getText()); 417 destModel.setNameSuffix(fullNameDialog.getNameSuffixTextField() 418 .getText()); 419 } 420 } 421 422 public void updateComponents(boolean b) { 423 424 updateFullNameDialogComponents(b); 425 426 if (b) { 427 if (sourceModel == null) 429 return; 430 431 nicknameTextField.setText(sourceModel.getNickName()); 433 formattedNameTextField.setText(sourceModel.getFormattedName()); 434 435 fillSortStringComboBox(); 436 if (sourceModel.getSortString() != null) { 437 fileunderComboBox.setSelectedItem(sourceModel.getSortString()); 438 } 439 440 companyTextField.setText(sourceModel.getOrganisation()); 441 professionTextField.setText(sourceModel.getProfession()); 442 titleTextField.setText(sourceModel.getTitle()); 443 444 managerTextField.setText(sourceModel.getManager()); 445 departmentTextField.setText(sourceModel.getDepartment()); 446 officeTextField.setText(sourceModel.getOffice()); 447 448 homepageTextField.setText(sourceModel.getHomePage()); 449 weblogTextField.setText(sourceModel.getWeblog()); 450 freebusyTextField.setText(sourceModel.getFreeBusy()); 451 calendarTextField.setText(sourceModel.getCalendar()); 452 453 Icon image = null; 454 if (sourceModel.getPhoto() != null) 455 image = sourceModel.getPhoto(); 456 if (image == null) 458 image = ImageLoader.getMiscIcon("malehead.png"); 459 pictureButton.setIcon(image); 460 461 Iterator it = sourceModel.getEmailIterator(); 463 if (it.hasNext()) { 464 IEmailModel m = (IEmailModel) it.next(); 465 fillEmailView(m, emailComboBox1, emailTextField1); 466 } 467 if (it.hasNext()) { 468 IEmailModel m = (IEmailModel) it.next(); 469 fillEmailView(m, emailComboBox2, emailTextField2); 470 } 471 if (it.hasNext()) { 472 IEmailModel m = (IEmailModel) it.next(); 473 fillEmailView(m, emailComboBox3, emailTextField3); 474 } 475 if (it.hasNext()) { 476 IEmailModel m = (IEmailModel) it.next(); 477 fillEmailView(m, emailComboBox4, emailTextField4); 478 } 479 480 it = sourceModel.getPhoneIterator(); 482 if (it.hasNext()) { 483 PhoneModel m = (PhoneModel) it.next(); 484 fillPhoneView(m, telephoneComboBox1, telephoneTextField1); 485 } 486 if (it.hasNext()) { 487 PhoneModel m = (PhoneModel) it.next(); 488 fillPhoneView(m, telephoneComboBox2, telephoneTextField2); 489 } 490 if (it.hasNext()) { 491 PhoneModel m = (PhoneModel) it.next(); 492 fillPhoneView(m, telephoneComboBox3, telephoneTextField3); 493 } 494 if (it.hasNext()) { 495 PhoneModel m = (PhoneModel) it.next(); 496 fillPhoneView(m, telephoneComboBox4, telephoneTextField4); 497 } 498 499 it = sourceModel.getInstantMessagingIterator(); 501 if (it.hasNext()) { 502 InstantMessagingModel m = (InstantMessagingModel) it.next(); 503 fillIMView(m, imComboBox1, imTextField1); 504 } 505 if (it.hasNext()) { 506 InstantMessagingModel m = (InstantMessagingModel) it.next(); 507 fillIMView(m, imComboBox2, imTextField2); 508 } 509 if (it.hasNext()) { 510 InstantMessagingModel m = (InstantMessagingModel) it.next(); 511 fillIMView(m, imComboBox3, imTextField3); 512 } 513 if (it.hasNext()) { 514 InstantMessagingModel m = (InstantMessagingModel) it.next(); 515 fillIMView(m, imComboBox4, imTextField4); 516 } 517 518 it = sourceModel.getAddressIterator(); 520 if (it.hasNext()) { 521 AddressModel m = (AddressModel) it.next(); 522 fillAddressView(m); 523 } 524 if (it.hasNext()) { 525 AddressModel m = (AddressModel) it.next(); 526 fillAddressView(m); 527 } 528 if (it.hasNext()) { 529 AddressModel m = (AddressModel) it.next(); 530 fillAddressView(m); 531 } 532 533 notesTextArea.setText(sourceModel.getNote()); 534 535 } else { 536 destModel.setNickName(nicknameTextField.getText()); 538 destModel.setFormattedName(formattedNameTextField.getText()); 539 540 if (fileunderComboBox.getSelectedItem() != null) 541 destModel.setSortString((String ) fileunderComboBox 542 .getSelectedItem()); 543 544 destModel.setOrganisation(companyTextField.getText()); 545 destModel.setProfession(professionTextField.getText()); 546 destModel.setTitle(titleTextField.getText()); 547 548 destModel.setManager(managerTextField.getText()); 549 destModel.setDepartment(departmentTextField.getText()); 550 destModel.setOffice(officeTextField.getText()); 551 552 destModel.setHomePage(homepageTextField.getText()); 553 destModel.setWeblog(weblogTextField.getText()); 554 destModel.setFreeBusy(freebusyTextField.getText()); 555 destModel.setCalendar(calendarTextField.getText()); 556 557 fillEmailModel(emailTextField1, emailComboBox1, destModel); 559 fillEmailModel(emailTextField2, emailComboBox2, destModel); 560 fillEmailModel(emailTextField3, emailComboBox3, destModel); 561 fillEmailModel(emailTextField4, emailComboBox4, destModel); 562 563 fillPhoneModel(telephoneTextField1, telephoneComboBox1, destModel); 565 fillPhoneModel(telephoneTextField2, telephoneComboBox2, destModel); 566 fillPhoneModel(telephoneTextField3, telephoneComboBox3, destModel); 567 fillPhoneModel(telephoneTextField4, telephoneComboBox4, destModel); 568 569 fillIMModel(imTextField1, imComboBox1, destModel); 571 fillIMModel(imTextField2, imComboBox2, destModel); 572 fillIMModel(imTextField3, imComboBox3, destModel); 573 fillIMModel(imTextField4, imComboBox4, destModel); 574 575 fillAddressModel(AddressModel.TYPE_WORK, destModel); 577 fillAddressModel(AddressModel.TYPE_HOME, destModel); 578 fillAddressModel(AddressModel.TYPE_OTHER, destModel); 579 580 destModel.setNote(notesTextArea.getText()); 581 582 Icon icon = pictureButton.getIcon(); 583 if (icon != null) { 584 destModel.setPhoto((ImageIcon ) icon); 585 } 586 587 } 588 } 589 590 593 private void fillSortStringComboBox() { 594 String ln = fullNameDialog.getLastNameTextField().getText(); 595 String fn = fullNameDialog.getFirstNameTextField().getText(); 596 597 if (ln != null && fn != null) { 598 if (ln.length() != 0 && fn.length() != 0) { 599 fileunderComboBox.addItem(ln + ", " + fn); 600 fileunderComboBox.addItem(fn + " " + ln); 601 } 602 603 if (ln.length() != 0) { 604 fileunderComboBox.addItem(ln); 605 } 606 607 if (fn.length() != 0) { 608 fileunderComboBox.addItem(fn); 609 } 610 611 if ( formattedNameTextField.getText() != null && formattedNameTextField.getText().length() >0) { 612 fileunderComboBox.addItem(formattedNameTextField.getText()); 613 } 614 615 if (fileunderComboBox.getModel().getSize() > 0) 616 fileunderComboBox.setSelectedIndex(0); 617 } 618 } 619 620 private void fillIMModel(JTextField imTextField, JComboBox imComboBox, 621 ContactModel destModel2) { 622 if (imTextField.getText() != null) { 623 if (imComboBox.getSelectedIndex() == 0) 624 destModel.addInstantMessaging(new InstantMessagingModel( 625 imTextField.getText(), 626 InstantMessagingModel.TYPE_JABBER)); 627 else if (imComboBox.getSelectedIndex() == 1) 628 destModel.addInstantMessaging(new InstantMessagingModel( 629 imTextField.getText(), InstantMessagingModel.TYPE_AIM)); 630 else if (imComboBox.getSelectedIndex() == 2) 631 destModel 632 .addInstantMessaging(new InstantMessagingModel( 633 imTextField.getText(), 634 InstantMessagingModel.TYPE_YAHOO)); 635 else if (imComboBox.getSelectedIndex() == 3) 636 destModel.addInstantMessaging(new InstantMessagingModel( 637 imTextField.getText(), InstantMessagingModel.TYPE_MSN)); 638 else if (imComboBox.getSelectedIndex() == 4) 639 destModel.addInstantMessaging(new InstantMessagingModel( 640 imTextField.getText(), InstantMessagingModel.TYPE_ICQ)); 641 } 642 643 } 644 645 private void fillPhoneModel(JTextField telephoneTextField, 646 JComboBox telephoneComboBox, ContactModel destModel2) { 647 if (telephoneTextField.getText() != null) { 648 if (telephoneComboBox.getSelectedIndex() == 0) 649 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 650 PhoneModel.TYPE_BUSINESS_PHONE)); 651 else if (telephoneComboBox.getSelectedIndex() == 1) 652 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 653 PhoneModel.TYPE_ASSISTANT_PHONE)); 654 else if (telephoneComboBox.getSelectedIndex() == 2) 655 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 656 PhoneModel.TYPE_BUSINESS_FAX)); 657 else if (telephoneComboBox.getSelectedIndex() == 3) 658 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 659 PhoneModel.TYPE_CALLBACK_PHONE)); 660 else if (telephoneComboBox.getSelectedIndex() == 4) 661 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 662 PhoneModel.TYPE_CAR_PHONE)); 663 else if (telephoneComboBox.getSelectedIndex() == 5) 664 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 665 PhoneModel.TYPE_COMPANY_PHONE)); 666 else if (telephoneComboBox.getSelectedIndex() == 6) 667 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 668 PhoneModel.TYPE_HOME_PHONE)); 669 else if (telephoneComboBox.getSelectedIndex() == 7) 670 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 671 PhoneModel.TYPE_HOME_FAX)); 672 else if (telephoneComboBox.getSelectedIndex() == 8) 673 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 674 PhoneModel.TYPE_ISDN)); 675 else if (telephoneComboBox.getSelectedIndex() == 9) 676 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 677 PhoneModel.TYPE_MOBILE_PHONE)); 678 else if (telephoneComboBox.getSelectedIndex() == 10) 679 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 680 PhoneModel.TYPE_OTHER_PHONE)); 681 else if (telephoneComboBox.getSelectedIndex() == 11) 682 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 683 PhoneModel.TYPE_OTHER_FAX)); 684 else if (telephoneComboBox.getSelectedIndex() == 12) 685 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 686 PhoneModel.TYPE_PAGER)); 687 else if (telephoneComboBox.getSelectedIndex() == 13) 688 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 689 PhoneModel.TYPE_PRIMARY_PHONE)); 690 else if (telephoneComboBox.getSelectedIndex() == 14) 691 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 692 PhoneModel.TYPE_RADIO)); 693 else if (telephoneComboBox.getSelectedIndex() == 15) 694 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 695 PhoneModel.TYPE_TELEX)); 696 else if (telephoneComboBox.getSelectedIndex() == 16) 697 destModel.addPhone(new PhoneModel(telephoneTextField.getText(), 698 PhoneModel.TYPE_TTY)); 699 700 } 701 702 } 703 704 private void fillIMView(InstantMessagingModel m, JComboBox imComboBox, 705 JTextField imTextField) { 706 707 if (m.getType() == InstantMessagingModel.TYPE_JABBER) 708 imComboBox.setSelectedIndex(0); 709 else if (m.getType() == InstantMessagingModel.TYPE_AIM) 710 imComboBox.setSelectedIndex(1); 711 else if (m.getType() == InstantMessagingModel.TYPE_YAHOO) 712 imComboBox.setSelectedIndex(2); 713 else if (m.getType() == InstantMessagingModel.TYPE_MSN) 714 imComboBox.setSelectedIndex(3); 715 else if (m.getType() == InstantMessagingModel.TYPE_ICQ) 716 imComboBox.setSelectedIndex(4); 717 718 imTextField.setText(m.getUserId()); 719 } 720 721 private void fillPhoneView(PhoneModel m, JComboBox telephoneComboBox, 722 JTextField telephoneTextField) { 723 724 if (m.getType() == PhoneModel.TYPE_BUSINESS_PHONE) 725 telephoneComboBox.setSelectedIndex(0); 726 else if (m.getType() == PhoneModel.TYPE_ASSISTANT_PHONE) 727 telephoneComboBox.setSelectedIndex(1); 728 else if (m.getType() == PhoneModel.TYPE_BUSINESS_FAX) 729 telephoneComboBox.setSelectedIndex(2); 730 else if (m.getType() == PhoneModel.TYPE_CALLBACK_PHONE) 731 telephoneComboBox.setSelectedIndex(3); 732 else if (m.getType() == PhoneModel.TYPE_CAR_PHONE) 733 telephoneComboBox.setSelectedIndex(4); 734 else if (m.getType() == PhoneModel.TYPE_COMPANY_PHONE) 735 telephoneComboBox.setSelectedIndex(5); 736 else if (m.getType() == PhoneModel.TYPE_HOME_PHONE) 737 telephoneComboBox.setSelectedIndex(6); 738 else if (m.getType() == PhoneModel.TYPE_HOME_FAX) 739 telephoneComboBox.setSelectedIndex(7); 740 else if (m.getType() == PhoneModel.TYPE_ISDN) 741 telephoneComboBox.setSelectedIndex(8); 742 else if (m.getType() == PhoneModel.TYPE_MOBILE_PHONE) 743 telephoneComboBox.setSelectedIndex(9); 744 else if (m.getType() == PhoneModel.TYPE_OTHER_PHONE) 745 telephoneComboBox.setSelectedIndex(10); 746 else if (m.getType() == PhoneModel.TYPE_OTHER_FAX) 747 telephoneComboBox.setSelectedIndex(11); 748 else if (m.getType() == PhoneModel.TYPE_PAGER) 749 telephoneComboBox.setSelectedIndex(12); 750 else if (m.getType() == PhoneModel.TYPE_PRIMARY_PHONE) 751 telephoneComboBox.setSelectedIndex(13); 752 else if (m.getType() == PhoneModel.TYPE_RADIO) 753 telephoneComboBox.setSelectedIndex(14); 754 else if (m.getType() == PhoneModel.TYPE_TELEX) 755 telephoneComboBox.setSelectedIndex(15); 756 else if (m.getType() == PhoneModel.TYPE_TTY) 757 telephoneComboBox.setSelectedIndex(16); 758 759 telephoneTextField.setText(m.getNumber()); 760 } 761 762 768 private void fillAddressModel(int type, ContactModel destModel) { 769 AddressModel model = null; 770 if (type == AddressModel.TYPE_WORK) 771 model = new AddressModel(workPOBoxTextField.getText(), 772 workStreetTextField.getText(), 773 workCityTextField.getText(), 774 workZipPostalCodeTextField.getText(), 775 workStateProvinceCountyTextField.getText(), 776 workCountryTextField.getText(), 777 workAddressTextArea.getText(), 778 type); 779 else if (type == AddressModel.TYPE_HOME) 780 model = new AddressModel(privatePOBoxTextField.getText(), 781 privateStreetTextField.getText(), 782 privateCityTextField.getText(), 783 privateZipPostalCodeTextField.getText(), 784 privateStateProvinceCountyTextField.getText(), 785 privateCountryTextField.getText(), 786 privateAddressTextArea.getText(), 787 type); 788 else if (type == AddressModel.TYPE_OTHER) 789 model = new AddressModel(otherPOBoxTextField.getText(), 790 otherStreetTextField.getText(), 791 otherCityTextField.getText(), 792 otherZipPostalCodeTextField.getText(), 793 otherStateProvinceCountyTextField.getText(), 794 otherCountryTextField.getText(), 795 otherAddressTextArea.getText(), 796 type); 797 destModel.addAddress(model); 798 } 799 800 808 private void fillEmailModel(JTextField emailTextField, 809 JComboBox emailComboBox, ContactModel destModel) { 810 if (emailTextField.getText() != null) { 811 if (emailComboBox.getSelectedIndex() == 0) 812 destModel.addEmail(new EmailModel(emailTextField.getText(), 813 EmailModel.TYPE_WORK)); 814 if (emailComboBox.getSelectedIndex() == 1) 815 destModel.addEmail(new EmailModel(emailTextField.getText(), 816 EmailModel.TYPE_HOME)); 817 if (emailComboBox.getSelectedIndex() == 2) 818 destModel.addEmail(new EmailModel(emailTextField.getText(), 819 EmailModel.TYPE_OTHER)); 820 } 821 } 822 823 827 private void fillEmailView(IEmailModel m, JComboBox comboBox, 828 JTextField textField) { 829 if (m.getType() == EmailModel.TYPE_WORK) 830 comboBox.setSelectedIndex(0); 831 else if (m.getType() == EmailModel.TYPE_HOME) 832 comboBox.setSelectedIndex(1); 833 else if (m.getType() == EmailModel.TYPE_OTHER) 834 comboBox.setSelectedIndex(2); 835 836 textField.setText(m.getAddress()); 837 } 838 839 845 private void fillAddressView(AddressModel m) { 846 if (m.getType() == AddressModel.TYPE_WORK) { 847 workCityTextField.setText(m.getCity()); 848 workCountryTextField.setText(m.getCountry()); 849 workPOBoxTextField.setText(m.getPoBox()); 850 workStateProvinceCountyTextField 851 .setText(m.getStateProvinceCounty()); 852 workZipPostalCodeTextField.setText(m.getZipPostalCode()); 853 workAddressTextArea.setText(m.getLabel()); 854 workStreetTextField.setText(m.getStreet()); 855 } else if (m.getType() == AddressModel.TYPE_HOME) { 856 privateCityTextField.setText(m.getCity()); 857 privateCountryTextField.setText(m.getCountry()); 858 privatePOBoxTextField.setText(m.getPoBox()); 859 privateStateProvinceCountyTextField.setText(m 860 .getStateProvinceCounty()); 861 privateZipPostalCodeTextField.setText(m.getZipPostalCode()); 862 privateAddressTextArea.setText(m.getLabel()); 863 privateStreetTextField.setText(m.getStreet()); 864 } else if (m.getType() == AddressModel.TYPE_OTHER) { 865 otherCityTextField.setText(m.getCity()); 866 otherCountryTextField.setText(m.getCountry()); 867 otherPOBoxTextField.setText(m.getPoBox()); 868 otherStateProvinceCountyTextField.setText(m 869 .getStateProvinceCounty()); 870 otherZipPostalCodeTextField.setText(m.getZipPostalCode()); 871 otherAddressTextArea.setText(m.getLabel()); 872 otherStreetTextField.setText(m.getStreet()); 873 } 874 } 875 876 public void actionPerformed(ActionEvent event) { 877 String action = event.getActionCommand(); 878 if (action.equals("OK")) { 879 result = true; 880 881 updateComponents(false); 882 883 setVisible(false); 884 } else if (action.equals("CANCEL")) { 885 result = false; 886 setVisible(false); 887 } else if (action.equals("FORMATTED_NAME_DIALOG")) { 888 fullNameDialog.setVisible(true); 889 890 boolean success = fullNameDialog.getResult(); 891 if (success) { 892 893 String fn = fullNameDialog.getFormattedName(); 894 formattedNameTextField.setText(fn); 896 897 fillSortStringComboBox(); 898 } 899 } 900 901 } 902 903 public boolean getResult() { 904 return result; 905 } 906 907 private void initComponents() { 908 909 DefaultComponentFactory compFactory = DefaultComponentFactory 910 .getInstance(); 911 912 dialogPane = new JPanel (); 913 contentPane = new JPanel (); 914 tabbedPane2 = new JTabbedPane (); 915 contactPanel = new JPanel (); 916 panel7 = new JPanel (); 917 pictureButton = new JButton (); 918 formattedNameButton = new JButton (); 919 formattedNameButton.setActionCommand("FORMATTED_NAME_DIALOG"); 920 formattedNameButton.addActionListener(this); 921 922 formattedNameTextField = new JTextField (); 923 nicknameLabel = new JLabel (); 924 nicknameTextField = new JTextField (); 925 fileunderLabel = new JLabel (); 926 fileunderComboBox = new JComboBox (); 927 whereLabel = new JLabel ("Where:"); 928 whereComboBox = new FolderComboBox(false); 929 whereLabel.setLabelFor(whereComboBox); 930 categoriesButton = new JButton (); 931 categoriesButton.setEnabled(false); 932 categoriesTextField = new JTextField (); 933 categoriesTextField.setEnabled(false); 934 emailSeparator = compFactory.createSeparator(bundle 935 .getString("emailSeparator.text")); 936 String [] emailTypes = new String [] { "Work", "Home", "Other" }; 937 emailComboBox1 = new JComboBox (emailTypes); 938 emailTextField1 = new JTextField (); 939 emailComboBox2 = new JComboBox (emailTypes); 940 emailTextField2 = new JTextField (); 941 emailComboBox3 = new JComboBox (emailTypes); 942 emailTextField3 = new JTextField (); 943 emailComboBox4 = new JComboBox (emailTypes); 944 emailTextField4 = new JTextField (); 945 preferHtmlCheckBox = new JCheckBox (); 946 preferHtmlCheckBox.setEnabled(false); 947 telephoneSeparator = compFactory.createSeparator(bundle 948 .getString("telephoneSeparator.text")); 949 String [] phoneTypes = new String [] { "Business Phone", 950 "Assistant Phone", "Business Fax", "Callback Phone", 951 "Car Phone", "Company Phone", "Home Phone", "Home Fax", "ISDN", 952 "Mobile Phone", "Other Phone", "Other Fax", "Pager", 953 "Primary Phone", "Radio", "Telex", "TTY" }; 954 telephoneComboBox1 = new JComboBox (phoneTypes); 955 telephoneTextField1 = new JTextField (); 956 telephoneComboBox2 = new JComboBox (phoneTypes); 957 telephoneTextField2 = new JTextField (); 958 telephoneComboBox3 = new JComboBox (phoneTypes); 959 telephoneTextField3 = new JTextField (); 960 telephoneComboBox4 = new JComboBox (phoneTypes); 961 telephoneTextField4 = new JTextField (); 962 imSeparator = compFactory.createSeparator(bundle 963 .getString("imSeparator.text")); 964 String [] imTypes = new String [] { "Jabber", "AIM", "Yahoo", "MSN", 965 "ICQ" }; 966 imComboBox1 = new JComboBox (imTypes); 967 imTextField1 = new JTextField (); 968 imComboBox2 = new JComboBox (imTypes); 969 imTextField2 = new JTextField (); 970 imComboBox3 = new JComboBox (imTypes); 971 imTextField3 = new JTextField (); 972 imComboBox4 = new JComboBox (imTypes); 973 imTextField4 = new JTextField (); 974 personalInfoPanel = new JPanel (); 975 webAddressSeparator = compFactory.createSeparator(bundle 976 .getString("webAddressSeparator.text")); 977 homepageLabel = new JLabel (); 978 panel1 = new JPanel (); 979 homepageTextField = new JTextField (); 980 homepageButton = new JButton (ImageLoader 981 .getSmallIcon(IconKeys.INTERNET)); 982 homepageButton.setMargin(new Insets (0, 0, 0, 0)); 983 homepageButton.addActionListener(new ActionListener () { 984 public void actionPerformed(ActionEvent e) { 985 String s = homepageTextField.getText(); 986 try { 987 URL url = new URL (s); 988 ColumbaDesktop.getInstance().browse(url); 989 } catch (MalformedURLException e1) { 990 e1.printStackTrace(); 991 } 992 } 993 }); 994 995 weblogLabel = new JLabel (); 996 panel5 = new JPanel (); 997 weblogTextField = new JTextField (); 998 weblogButton = new JButton (ImageLoader.getSmallIcon(IconKeys.INTERNET)); 999 weblogButton.setMargin(new Insets (0, 0, 0, 0)); 1000 weblogButton.addActionListener(new ActionListener () { 1001 public void actionPerformed(ActionEvent e) { 1002 String s = weblogTextField.getText(); 1003 try { 1004 URL url = new URL (s); 1005 ColumbaDesktop.getInstance().browse(url); 1006 } catch (MalformedURLException e1) { 1007 e1.printStackTrace(); 1008 } 1009 } 1010 }); 1011 calendarLabel = new JLabel (); 1012 panel6 = new JPanel (); 1013 calendarTextField = new JTextField (); 1014 calendarButton = new JButton (ImageLoader 1015 .getSmallIcon(IconKeys.INTERNET)); 1016 calendarButton.setMargin(new Insets (0, 0, 0, 0)); 1017 calendarButton.addActionListener(new ActionListener () { 1018 public void actionPerformed(ActionEvent e) { 1019 String s = calendarTextField.getText(); 1020 try { 1021 URL url = new URL (s); 1022 ColumbaDesktop.getInstance().browse(url); 1023 } catch (MalformedURLException e1) { 1024 e1.printStackTrace(); 1025 } 1026 } 1027 }); 1028 freebusyLabel = new JLabel (); 1029 panel8 = new JPanel (); 1030 freebusyTextField = new JTextField (); 1031 freebusyButton = new JButton (ImageLoader 1032 .getSmallIcon(IconKeys.INTERNET)); 1033 freebusyButton.setMargin(new Insets (0, 0, 0, 0)); 1034 freebusyButton.addActionListener(new ActionListener () { 1035 public void actionPerformed(ActionEvent e) { 1036 String s = freebusyTextField.getText(); 1037 try { 1038 URL url = new URL (s); 1039 ColumbaDesktop.getInstance().browse(url); 1040 } catch (MalformedURLException e1) { 1041 e1.printStackTrace(); 1042 } 1043 } 1044 }); 1045 jobSeparator = compFactory.createSeparator(bundle 1046 .getString("jobSeparator.text")); 1047 professionLabel = new JLabel (); 1048 professionTextField = new JTextField (); 1049 titleLabel = new JLabel (); 1050 titleTextField = new JTextField (); 1051 companyLabel = new JLabel (); 1052 companyTextField = new JTextField (); 1053 departmentLabel = new JLabel (); 1054 departmentTextField = new JTextField (); 1055 managerLabel = new JLabel (); 1056 managerTextField = new JTextField (); 1057 officeLabel = new JLabel (); 1058 officeTextField = new JTextField (); 1059 miscellaneousSeparator = compFactory.createSeparator(bundle 1060 .getString("miscellaneousSeparator.text")); 1061 birthdayLabel = new JLabel (); 1062 birthdayComboBox = new JComboBox (); 1063 notesLabel = new JLabel (); 1064 scrollPane3 = new JScrollPane (); 1065 notesTextArea = new JTextArea (); 1066 mailingAddressPanel = new JPanel (); 1067 privateSeparator = compFactory.createSeparator(bundle 1068 .getString("privateSeparator.text")); 1069 privateAddressLabel = new JLabel (); 1070 scrollPane1 = new JScrollPane (); 1071 privateAddressTextArea = new JTextArea (); 1072 privateCityLabel = new JLabel (); 1073 privateCityTextField = new JTextField (); 1074 privateZipPostalCodeLabel = new JLabel (); 1075 privateZipPostalCodeTextField = new JTextField (); 1076 label1 = new JLabel (); 1077 privateStreetTextField = new JTextField (); 1078 privateStateProvinceCountyLabel = new JLabel (); 1079 privateStateProvinceCountyTextField = new JTextField (); 1080 privatePOBoxLabel = new JLabel (); 1081 privatePOBoxTextField = new JTextField (); 1082 privateCountryLabel = new JLabel (); 1083 privateCountryTextField = new JTextField (); 1084 workSeparator = compFactory.createSeparator(bundle 1085 .getString("workSeparator.text")); 1086 workAddressLabel = new JLabel (); 1087 scrollPane2 = new JScrollPane (); 1088 workAddressTextArea = new JTextArea (); 1089 workCityLabel = new JLabel (); 1090 workCityTextField = new JTextField (); 1091 workZipPostalCodeLabel = new JLabel (); 1092 workZipPostalCodeTextField = new JTextField (); 1093 label2 = new JLabel (); 1094 workStreetTextField = new JTextField (); 1095 workStateProvinceCountyLabel = new JLabel (); 1096 workStateProvinceCountyTextField = new JTextField (); 1097 workPOBoxLabel = new JLabel (); 1098 workPOBoxTextField = new JTextField (); 1099 workCountryLabel = new JLabel (); 1100 workCountryTextField = new JTextField (); 1101 otherSeparator = compFactory.createSeparator(bundle 1102 .getString("otherSeparator.text")); 1103 otherAddressLabel = compFactory.createLabel(bundle 1104 .getString("otherAddressLabel.textWithMnemonic")); 1105 scrollPane4 = new JScrollPane (); 1106 otherAddressTextArea = new JTextArea (); 1107 otherCityLabel = new JLabel (); 1108 otherCityTextField = new JTextField (); 1109 otherZipPostalCodeLabel = new JLabel (); 1110 otherZipPostalCodeTextField = new JTextField (); 1111 label3 = new JLabel (); 1112 otherStreetTextField = new JTextField (); 1113 otherStateProvinceCountyLabel = new JLabel (); 1114 otherStateProvinceCountyTextField = new JTextField (); 1115 otherPOBoxLabel = new JLabel (); 1116 otherPOBoxTextField = new JTextField (); 1117 otherCountryLabel = new JLabel (); 1118 otherCountryTextField = new JTextField (); 1119 1120 buttonBar = new JPanel (); 1121 okButton = new JButton (); 1122 okButton.setActionCommand("OK"); 1123 okButton.addActionListener(this); 1124 cancelButton = new JButton (); 1125 cancelButton.setActionCommand("CANCEL"); 1126 cancelButton.addActionListener(this); 1127 1128 } 1129 1130 private void layoutComponents() { 1131 CellConstraints cc = new CellConstraints(); 1132 1133 Container contentPane2 = getContentPane(); 1135 contentPane2.setLayout(new BorderLayout ()); 1136 1137 { 1139 dialogPane.setBorder(Borders.DIALOG_BORDER); 1140 dialogPane.setLayout(new BorderLayout ()); 1141 1142 { 1144 contentPane.setLayout(new BorderLayout ()); 1145 1146 { 1148 tabbedPane2 1149 .setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); 1150 1151 { 1153 contactPanel.setBorder(Borders.DIALOG_BORDER); 1154 contactPanel 1155 .setLayout(new FormLayout( 1156 new ColumnSpec[] { 1157 FormFactory.DEFAULT_COLSPEC, 1158 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1159 new ColumnSpec(ColumnSpec.FILL, 1160 Sizes.DEFAULT, 1161 FormSpec.DEFAULT_GROW), 1162 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1163 FormFactory.DEFAULT_COLSPEC, 1164 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1165 new ColumnSpec(ColumnSpec.FILL, 1166 Sizes.DEFAULT, 1167 FormSpec.DEFAULT_GROW) }, 1168 new RowSpec[] { 1169 FormFactory.DEFAULT_ROWSPEC, 1170 FormFactory.LINE_GAP_ROWSPEC, 1171 FormFactory.DEFAULT_ROWSPEC, 1172 FormFactory.LINE_GAP_ROWSPEC, 1173 FormFactory.DEFAULT_ROWSPEC, 1174 FormFactory.LINE_GAP_ROWSPEC, 1175 new RowSpec(RowSpec.FILL, 1176 Sizes.DEFAULT, 1177 FormSpec.NO_GROW), 1178 FormFactory.LINE_GAP_ROWSPEC, 1179 new RowSpec(RowSpec.FILL, 1180 Sizes.DEFAULT, 1181 FormSpec.NO_GROW), 1182 FormFactory.LINE_GAP_ROWSPEC, 1183 new RowSpec(RowSpec.FILL, 1184 Sizes.DEFAULT, 1185 FormSpec.NO_GROW), 1186 FormFactory.LINE_GAP_ROWSPEC, 1187 FormFactory.DEFAULT_ROWSPEC, 1188 FormFactory.LINE_GAP_ROWSPEC, 1189 FormFactory.DEFAULT_ROWSPEC, 1190 FormFactory.LINE_GAP_ROWSPEC, 1191 new RowSpec(RowSpec.FILL, 1192 Sizes.DEFAULT, 1193 FormSpec.NO_GROW), 1194 FormFactory.LINE_GAP_ROWSPEC, 1195 new RowSpec(RowSpec.FILL, 1196 Sizes.DEFAULT, 1197 FormSpec.NO_GROW), 1198 FormFactory.LINE_GAP_ROWSPEC, 1199 FormFactory.DEFAULT_ROWSPEC, 1200 FormFactory.LINE_GAP_ROWSPEC, 1201 FormFactory.DEFAULT_ROWSPEC, 1202 FormFactory.LINE_GAP_ROWSPEC, 1203 new RowSpec(RowSpec.FILL, 1204 Sizes.DEFAULT, 1205 FormSpec.NO_GROW), 1206 FormFactory.LINE_GAP_ROWSPEC, 1207 new RowSpec(RowSpec.FILL, 1208 Sizes.DEFAULT, 1209 FormSpec.NO_GROW) })); 1210 ((FormLayout) contactPanel.getLayout()) 1211 .setRowGroups(new int[][] { { 7, 9, 11, 17, 19, 1212 25, 27 } }); 1213 1214 { 1216 panel7 1217 .setLayout(new FormLayout( 1218 new ColumnSpec[] { 1219 FormFactory.DEFAULT_COLSPEC, 1220 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1221 FormFactory.DEFAULT_COLSPEC, 1222 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1223 1224 FormFactory.DEFAULT_COLSPEC, 1225 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1226 1227 FormFactory.DEFAULT_COLSPEC, 1228 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1229 new ColumnSpec( 1230 ColumnSpec.FILL, 1231 Sizes.DEFAULT, 1232 FormSpec.DEFAULT_GROW), }, 1233 new RowSpec[] { 1234 new RowSpec(RowSpec.FILL, 1235 Sizes.DEFAULT, 1236 FormSpec.NO_GROW), 1237 FormFactory.LINE_GAP_ROWSPEC, 1238 new RowSpec(RowSpec.FILL, 1239 Sizes.DEFAULT, 1240 FormSpec.NO_GROW), 1241 FormFactory.LINE_GAP_ROWSPEC, 1242 new RowSpec(RowSpec.FILL, 1243 Sizes.DEFAULT, 1244 FormSpec.NO_GROW) })); 1245 ((FormLayout) panel7.getLayout()) 1246 .setRowGroups(new int[][] { { 1, 3, 5 } }); 1247 1248 1250 panel7.add(pictureButton, cc.xywh(1, 1, 1, 5)); 1251 1252 formattedNameButton.setText(bundle 1254 .getString("formattedNameButton.text")); 1255 panel7.add(formattedNameButton, cc.xy(3, 1)); 1256 panel7.add(formattedNameTextField, cc.xy(5, 1)); 1257 1258 nicknameLabel.setText(bundle 1260 .getString("nicknameLabel.text")); 1261 nicknameLabel.setLabelFor(nicknameTextField); 1262 panel7.add(nicknameLabel, cc.xywh(7, 1, 1, 1, 1263 CellConstraints.RIGHT, 1264 CellConstraints.DEFAULT)); 1265 panel7.add(nicknameTextField, cc.xy(9, 1)); 1266 1267 fileunderLabel.setText(bundle 1269 .getString("fileunderLabel.text")); 1270 fileunderLabel.setLabelFor(fileunderComboBox); 1271 panel7.add(fileunderLabel, cc.xywh(3, 3, 1, 1, 1272 CellConstraints.RIGHT, 1273 CellConstraints.DEFAULT)); 1274 panel7.add(fileunderComboBox, cc.xy(5, 3)); 1275 1276 panel7.add(whereLabel, cc.xywh(7, 3, 1, 1, 1277 CellConstraints.RIGHT, 1278 CellConstraints.DEFAULT)); 1279 panel7.add(whereComboBox, cc.xy(9, 3)); 1280 categoriesButton.setText(bundle 1282 .getString("categoriesButton.text")); 1283 panel7.add(categoriesButton, cc.xy(3, 5)); 1284 panel7 1285 .add(categoriesTextField, cc.xywh(5, 5, 5, 1286 1)); 1287 } 1288 contactPanel.add(panel7, cc.xywh(1, 1, 7, 1)); 1289 contactPanel.add(emailSeparator, cc.xywh(1, 5, 7, 1)); 1290 contactPanel.add(emailComboBox1, cc.xy(1, 7)); 1291 1292 emailTextField1.setColumns(20); 1294 contactPanel.add(emailTextField1, cc.xy(3, 7)); 1295 contactPanel.add(emailComboBox2, cc.xy(5, 7)); 1296 1297 emailTextField2.setColumns(20); 1299 contactPanel.add(emailTextField2, cc.xy(7, 7)); 1300 contactPanel.add(emailComboBox3, cc.xy(1, 9)); 1301 1302 emailTextField3.setColumns(20); 1304 contactPanel.add(emailTextField3, cc.xy(3, 9)); 1305 contactPanel.add(emailComboBox4, cc.xy(5, 9)); 1306 1307 emailTextField4.setColumns(20); 1309 contactPanel.add(emailTextField4, cc.xy(7, 9)); 1310 1311 preferHtmlCheckBox.setText(bundle 1313 .getString("preferHtmlCheckBox.text")); 1314 contactPanel.add(preferHtmlCheckBox, cc.xy(3, 11)); 1315 contactPanel.add(telephoneSeparator, cc.xywh(1, 15, 7, 1316 1)); 1317 contactPanel.add(telephoneComboBox1, cc.xy(1, 17)); 1318 1319 telephoneTextField1.setColumns(20); 1321 contactPanel.add(telephoneTextField1, cc.xy(3, 17)); 1322 contactPanel.add(telephoneComboBox2, cc.xy(5, 17)); 1323 1324 telephoneTextField2.setColumns(20); 1326 contactPanel.add(telephoneTextField2, cc.xy(7, 17)); 1327 contactPanel.add(telephoneComboBox3, cc.xy(1, 19)); 1328 1329 telephoneTextField3.setColumns(20); 1331 contactPanel.add(telephoneTextField3, cc.xy(3, 19)); 1332 contactPanel.add(telephoneComboBox4, cc.xy(5, 19)); 1333 1334 telephoneTextField4.setColumns(20); 1336 contactPanel.add(telephoneTextField4, cc.xy(7, 19)); 1337 contactPanel.add(imSeparator, cc.xywh(1, 23, 7, 1)); 1338 contactPanel.add(imComboBox1, cc.xy(1, 25)); 1339 1340 imTextField1.setColumns(20); 1342 contactPanel.add(imTextField1, cc.xy(3, 25)); 1343 contactPanel.add(imComboBox2, cc.xy(5, 25)); 1344 1345 imTextField2.setColumns(20); 1347 contactPanel.add(imTextField2, cc.xy(7, 25)); 1348 contactPanel.add(imComboBox3, cc.xy(1, 27)); 1349 1350 imTextField3.setColumns(20); 1352 contactPanel.add(imTextField3, cc.xy(3, 27)); 1353 contactPanel.add(imComboBox4, cc.xy(5, 27)); 1354 1355 imTextField4.setColumns(20); 1357 contactPanel.add(imTextField4, cc.xy(7, 27)); 1358 } 1359 tabbedPane2.addTab(bundle 1360 .getString("contactPanel.tab.title"), contactPanel); 1361 1362 { 1364 personalInfoPanel.setBorder(Borders.DIALOG_BORDER); 1365 personalInfoPanel 1366 .setLayout(new FormLayout( 1367 new ColumnSpec[] { 1368 FormFactory.DEFAULT_COLSPEC, 1369 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1370 new ColumnSpec(ColumnSpec.FILL, 1371 Sizes.DEFAULT, 1372 FormSpec.DEFAULT_GROW), 1373 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1374 FormFactory.DEFAULT_COLSPEC, 1375 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1376 new ColumnSpec(ColumnSpec.FILL, 1377 Sizes.DEFAULT, 1378 FormSpec.DEFAULT_GROW) }, 1379 new RowSpec[] { 1380 FormFactory.DEFAULT_ROWSPEC, 1381 FormFactory.LINE_GAP_ROWSPEC, 1382 new RowSpec(RowSpec.FILL, 1383 Sizes.DEFAULT, 1384 FormSpec.NO_GROW), 1385 FormFactory.LINE_GAP_ROWSPEC, 1386 new RowSpec(RowSpec.FILL, 1387 Sizes.DEFAULT, 1388 FormSpec.NO_GROW), 1389 FormFactory.LINE_GAP_ROWSPEC, 1390 new RowSpec(RowSpec.FILL, 1391 Sizes.DEFAULT, 1392 FormSpec.NO_GROW), 1393 FormFactory.LINE_GAP_ROWSPEC, 1394 new RowSpec(RowSpec.FILL, 1395 Sizes.DEFAULT, 1396 FormSpec.NO_GROW), 1397 FormFactory.LINE_GAP_ROWSPEC, 1398 FormFactory.DEFAULT_ROWSPEC, 1399 FormFactory.LINE_GAP_ROWSPEC, 1400 FormFactory.DEFAULT_ROWSPEC, 1401 FormFactory.LINE_GAP_ROWSPEC, 1402 new RowSpec(RowSpec.FILL, 1403 Sizes.DEFAULT, 1404 FormSpec.NO_GROW), 1405 FormFactory.LINE_GAP_ROWSPEC, 1406 new RowSpec(RowSpec.FILL, 1407 Sizes.DEFAULT, 1408 FormSpec.NO_GROW), 1409 FormFactory.LINE_GAP_ROWSPEC, 1410 new RowSpec(RowSpec.FILL, 1411 Sizes.DEFAULT, 1412 FormSpec.NO_GROW), 1413 FormFactory.LINE_GAP_ROWSPEC, 1414 FormFactory.DEFAULT_ROWSPEC, 1415 FormFactory.LINE_GAP_ROWSPEC, 1416 FormFactory.DEFAULT_ROWSPEC, 1417 FormFactory.LINE_GAP_ROWSPEC, 1418 new RowSpec(RowSpec.FILL, 1419 Sizes.DEFAULT, 1420 FormSpec.NO_GROW), 1421 FormFactory.LINE_GAP_ROWSPEC, 1422 FormFactory.DEFAULT_ROWSPEC })); 1423 ((FormLayout) personalInfoPanel.getLayout()) 1424 .setRowGroups(new int[][] { { 3, 5, 7, 9, 15, 1425 17, 19, 25 } }); 1426 personalInfoPanel.add(webAddressSeparator, cc.xywh(1, 1427 1, 7, 1)); 1428 1429 homepageLabel.setText(bundle 1431 .getString("homepageLabel.text")); 1432 homepageLabel.setLabelFor(homepageTextField); 1433 personalInfoPanel.add(homepageLabel, cc.xywh(1, 3, 1, 1434 1, CellConstraints.RIGHT, 1435 CellConstraints.DEFAULT)); 1436 1437 { 1439 panel1.setLayout(new FormLayout(new ColumnSpec[] { 1440 new ColumnSpec(ColumnSpec.FILL, 1441 Sizes.DEFAULT, 1442 FormSpec.DEFAULT_GROW), 1443 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1444 new ColumnSpec(ColumnSpec.CENTER, 1445 Sizes.DEFAULT, FormSpec.NO_GROW) }, 1446 RowSpec.decodeSpecs("fill:default"))); 1447 1448 homepageTextField.setColumns(20); 1450 panel1.add(homepageTextField, cc.xy(1, 1)); 1451 1452 1454 panel1.add(homepageButton, cc.xy(3, 1)); 1455 } 1456 personalInfoPanel.add(panel1, cc.xywh(3, 3, 5, 1)); 1457 1458 weblogLabel.setText(bundle 1460 .getString("weblogLabel.text")); 1461 weblogLabel.setLabelFor(weblogTextField); 1462 personalInfoPanel 1463 .add(weblogLabel, cc.xywh(1, 5, 1, 1, 1464 CellConstraints.RIGHT, 1465 CellConstraints.DEFAULT)); 1466 1467 { 1469 panel5.setLayout(new FormLayout(new ColumnSpec[] { 1470 new ColumnSpec(ColumnSpec.FILL, 1471 Sizes.DEFAULT, 1472 FormSpec.DEFAULT_GROW), 1473 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1474 FormFactory.DEFAULT_COLSPEC }, RowSpec 1475 .decodeSpecs("fill:default"))); 1476 1477 weblogTextField.setColumns(20); 1479 panel5.add(weblogTextField, cc.xy(1, 1)); 1480 1481 1483 panel5.add(weblogButton, cc.xy(3, 1)); 1484 } 1485 personalInfoPanel.add(panel5, cc.xywh(3, 5, 5, 1)); 1486 1487 calendarLabel.setText(bundle 1489 .getString("calendarLabel.text")); 1490 calendarLabel.setLabelFor(calendarTextField); 1491 personalInfoPanel.add(calendarLabel, cc.xywh(1, 7, 1, 1492 1, CellConstraints.RIGHT, 1493 CellConstraints.DEFAULT)); 1494 1495 { 1497 panel6.setLayout(new FormLayout(new ColumnSpec[] { 1498 new ColumnSpec(ColumnSpec.FILL, 1499 Sizes.DEFAULT, 1500 FormSpec.DEFAULT_GROW), 1501 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1502 FormFactory.DEFAULT_COLSPEC }, RowSpec 1503 .decodeSpecs("fill:default"))); 1504 1505 calendarTextField.setColumns(20); 1507 panel6.add(calendarTextField, cc.xy(1, 1)); 1508 1509 panel6.add(calendarButton, cc.xy(3, 1)); 1511 } 1512 personalInfoPanel.add(panel6, cc.xywh(3, 7, 5, 1)); 1513 1514 freebusyLabel.setText(bundle 1516 .getString("freebusyLabel.text")); 1517 freebusyLabel.setLabelFor(freebusyTextField); 1518 personalInfoPanel.add(freebusyLabel, cc.xywh(1, 9, 1, 1519 1, CellConstraints.RIGHT, 1520 CellConstraints.DEFAULT)); 1521 1522 { 1524 panel8.setLayout(new FormLayout(new ColumnSpec[] { 1525 new ColumnSpec(ColumnSpec.FILL, 1526 Sizes.DEFAULT, 1527 FormSpec.DEFAULT_GROW), 1528 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1529 FormFactory.DEFAULT_COLSPEC }, RowSpec 1530 .decodeSpecs("fill:default"))); 1531 1532 freebusyTextField.setColumns(20); 1534 panel8.add(freebusyTextField, cc.xy(1, 1)); 1535 1536 1538 panel8.add(freebusyButton, cc.xy(3, 1)); 1539 } 1540 personalInfoPanel.add(panel8, cc.xywh(3, 9, 5, 1)); 1541 personalInfoPanel.add(jobSeparator, cc 1542 .xywh(1, 13, 7, 1)); 1543 1544 professionLabel.setText(bundle 1546 .getString("professionLabel.text")); 1547 professionLabel.setLabelFor(professionTextField); 1548 personalInfoPanel.add(professionLabel, cc.xywh(1, 15, 1549 1, 1, CellConstraints.RIGHT, 1550 CellConstraints.DEFAULT)); 1551 1552 professionTextField.setColumns(20); 1554 personalInfoPanel 1555 .add(professionTextField, cc.xy(3, 15)); 1556 1557 titleLabel.setText(bundle.getString("titleLabel.text")); 1559 titleLabel.setLabelFor(titleTextField); 1560 personalInfoPanel 1561 .add(titleLabel, cc.xywh(5, 15, 1, 1, 1562 CellConstraints.RIGHT, 1563 CellConstraints.DEFAULT)); 1564 1565 titleTextField.setColumns(20); 1567 personalInfoPanel.add(titleTextField, cc.xy(7, 15)); 1568 1569 companyLabel.setText(bundle 1571 .getString("companyLabel.text")); 1572 companyLabel.setLabelFor(companyTextField); 1573 personalInfoPanel.add(companyLabel, cc.xywh(1, 17, 1, 1574 1, CellConstraints.RIGHT, 1575 CellConstraints.DEFAULT)); 1576 1577 companyTextField.setColumns(20); 1579 personalInfoPanel.add(companyTextField, cc.xy(3, 17)); 1580 1581 departmentLabel.setText(bundle 1583 .getString("departmentLabel.text")); 1584 departmentLabel.setLabelFor(departmentTextField); 1585 personalInfoPanel.add(departmentLabel, cc.xywh(5, 17, 1586 1, 1, CellConstraints.RIGHT, 1587 CellConstraints.DEFAULT)); 1588 1589 departmentTextField.setColumns(20); 1591 personalInfoPanel 1592 .add(departmentTextField, cc.xy(7, 17)); 1593 1594 managerLabel.setText(bundle 1596 .getString("managerLabel.text")); 1597 managerLabel.setLabelFor(managerTextField); 1598 personalInfoPanel.add(managerLabel, cc.xywh(1, 19, 1, 1599 1, CellConstraints.RIGHT, 1600 CellConstraints.DEFAULT)); 1601 1602 managerTextField.setColumns(20); 1604 personalInfoPanel.add(managerTextField, cc.xy(3, 19)); 1605 1606 officeLabel.setText(bundle 1608 .getString("officeLabel.text")); 1609 officeLabel.setLabelFor(officeTextField); 1610 personalInfoPanel 1611 .add(officeLabel, cc.xywh(5, 19, 1, 1, 1612 CellConstraints.RIGHT, 1613 CellConstraints.DEFAULT)); 1614 1615 officeTextField.setColumns(10); 1617 personalInfoPanel.add(officeTextField, cc.xy(7, 19)); 1618 personalInfoPanel.add(miscellaneousSeparator, cc.xywh( 1619 1, 23, 7, 1)); 1620 1621 birthdayLabel.setText(bundle 1623 .getString("birthdayLabel.text")); 1624 birthdayLabel.setLabelFor(birthdayComboBox); 1625 personalInfoPanel.add(birthdayLabel, cc.xywh(1, 25, 1, 1626 1, CellConstraints.RIGHT, 1627 CellConstraints.DEFAULT)); 1628 personalInfoPanel.add(birthdayComboBox, cc.xy(3, 25)); 1629 1630 notesLabel.setText(bundle.getString("notesLabel.text")); 1632 notesLabel.setLabelFor(notesTextArea); 1633 personalInfoPanel.add(notesLabel, cc.xywh(1, 27, 1, 1, 1634 CellConstraints.RIGHT, CellConstraints.TOP)); 1635 1636 { 1638 scrollPane3 1639 .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); 1640 1641 notesTextArea.setRows(5); 1643 notesTextArea.setColumns(20); 1644 notesTextArea.setTabSize(4); 1645 scrollPane3.setViewportView(notesTextArea); 1646 } 1647 personalInfoPanel 1648 .add(scrollPane3, cc.xywh(3, 27, 5, 1)); 1649 } 1650 tabbedPane2.addTab(bundle 1651 .getString("personalInfoPanel.tab.title"), 1652 personalInfoPanel); 1653 1654 { 1656 mailingAddressPanel.setBorder(Borders.DIALOG_BORDER); 1657 mailingAddressPanel 1658 .setLayout(new FormLayout( 1659 new ColumnSpec[] { 1660 FormFactory.DEFAULT_COLSPEC, 1661 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1662 new ColumnSpec(ColumnSpec.FILL, 1663 Sizes.DEFAULT, 1664 FormSpec.DEFAULT_GROW), 1665 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1666 FormFactory.DEFAULT_COLSPEC, 1667 FormFactory.LABEL_COMPONENT_GAP_COLSPEC, 1668 new ColumnSpec(ColumnSpec.FILL, 1669 Sizes.DEFAULT, 1670 FormSpec.DEFAULT_GROW) }, 1671 new RowSpec[] { 1672 FormFactory.DEFAULT_ROWSPEC, 1673 FormFactory.LINE_GAP_ROWSPEC, 1674 new RowSpec(RowSpec.FILL, 1675 Sizes.DEFAULT, 1676 FormSpec.NO_GROW), 1677 FormFactory.LINE_GAP_ROWSPEC, 1678 new RowSpec(RowSpec.FILL, 1679 Sizes.DEFAULT, 1680 FormSpec.NO_GROW), 1681 FormFactory.LINE_GAP_ROWSPEC, 1682 new RowSpec(RowSpec.FILL, 1683 Sizes.DEFAULT, 1684 FormSpec.NO_GROW), 1685 FormFactory.LINE_GAP_ROWSPEC, 1686 new RowSpec(RowSpec.FILL, 1687 Sizes.DEFAULT, 1688 FormSpec.NO_GROW), 1689 FormFactory.LINE_GAP_ROWSPEC, 1690 FormFactory.DEFAULT_ROWSPEC, 1691 FormFactory.LINE_GAP_ROWSPEC, 1692 FormFactory.DEFAULT_ROWSPEC, 1693 FormFactory.LINE_GAP_ROWSPEC, 1694 new RowSpec(RowSpec.FILL, 1695 Sizes.DEFAULT, 1696 FormSpec.NO_GROW), 1697 FormFactory.LINE_GAP_ROWSPEC, 1698 new RowSpec(RowSpec.FILL, 1699 Sizes.DEFAULT, 1700 FormSpec.NO_GROW), 1701 FormFactory.LINE_GAP_ROWSPEC, 1702 new RowSpec(RowSpec.FILL, 1703 Sizes.DEFAULT, 1704 FormSpec.NO_GROW), 1705 FormFactory.LINE_GAP_ROWSPEC, 1706 new RowSpec(RowSpec.FILL, 1707 Sizes.DEFAULT, 1708 FormSpec.NO_GROW), 1709 FormFactory.LINE_GAP_ROWSPEC, 1710 FormFactory.DEFAULT_ROWSPEC, 1711 FormFactory.LINE_GAP_ROWSPEC, 1712 FormFactory.DEFAULT_ROWSPEC, 1713 FormFactory.LINE_GAP_ROWSPEC, 1714 new RowSpec(RowSpec.FILL, 1715 Sizes.DEFAULT, 1716 FormSpec.NO_GROW), 1717 FormFactory.LINE_GAP_ROWSPEC, 1718 new RowSpec(RowSpec.FILL, 1719 Sizes.DEFAULT, 1720 FormSpec.NO_GROW), 1721 FormFactory.LINE_GAP_ROWSPEC, 1722 new RowSpec(RowSpec.FILL, 1723 Sizes.DEFAULT, 1724 FormSpec.NO_GROW), 1725 FormFactory.LINE_GAP_ROWSPEC, 1726 new RowSpec(RowSpec.FILL, 1727 Sizes.DEFAULT, 1728 FormSpec.NO_GROW), 1729 FormFactory.LINE_GAP_ROWSPEC, 1730 FormFactory.DEFAULT_ROWSPEC })); 1731 mailingAddressPanel.add(privateSeparator, cc.xywh(1, 1, 1732 7, 1)); 1733 1734 privateAddressLabel.setText(bundle 1736 .getString("privateAddressLabel.text")); 1737 privateAddressLabel.setLabelFor(privateAddressTextArea); 1738 mailingAddressPanel.add(privateAddressLabel, cc.xywh(1, 1739 3, 1, 1, CellConstraints.RIGHT, 1740 CellConstraints.DEFAULT)); 1741 1742 { 1744 scrollPane1 1745 .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); 1746 scrollPane1.setViewportView(privateAddressTextArea); 1747 } 1748 mailingAddressPanel.add(scrollPane1, cc 1749 .xywh(3, 3, 1, 3)); 1750 1751 privateCityLabel.setText(bundle 1753 .getString("privateCityLabel.text")); 1754 privateCityLabel.setLabelFor(privateCityTextField); 1755 mailingAddressPanel.add(privateCityLabel, cc.xywh(5, 3, 1756 1, 1, CellConstraints.RIGHT, 1757 CellConstraints.DEFAULT)); 1758 1759 privateCityTextField.setColumns(5); 1761 mailingAddressPanel.add(privateCityTextField, cc.xy(7, 1762 3)); 1763 1764 privateZipPostalCodeLabel.setText(bundle 1766 .getString("privateZipPostalCodeLabel.text")); 1767 privateZipPostalCodeLabel 1768 .setLabelFor(privateZipPostalCodeTextField); 1769 mailingAddressPanel.add(privateZipPostalCodeLabel, cc 1770 .xywh(5, 5, 1, 1, CellConstraints.RIGHT, 1771 CellConstraints.DEFAULT)); 1772 mailingAddressPanel.add(privateZipPostalCodeTextField, 1773 cc.xy(7, 5)); 1774 1775 label1.setText(bundle.getString("streetLabel.text")); 1777 label1.setLabelFor(privateStreetTextField); 1778 mailingAddressPanel 1779 .add(label1, cc.xywh(1, 7, 1, 1, 1780 CellConstraints.RIGHT, 1781 CellConstraints.DEFAULT)); 1782 mailingAddressPanel.add(privateStreetTextField, cc.xy( 1783 3, 7)); 1784 1785 privateStateProvinceCountyLabel 1787 .setText(bundle 1788 .getString("privateStateProvinceCountyLabel.text")); 1789 privateStateProvinceCountyLabel 1790 .setLabelFor(privateStateProvinceCountyTextField); 1791 mailingAddressPanel.add( 1792 privateStateProvinceCountyLabel, cc.xywh(5, 7, 1793 1, 1, CellConstraints.RIGHT, 1794 CellConstraints.DEFAULT)); 1795 mailingAddressPanel.add( 1796 privateStateProvinceCountyTextField, cc 1797 .xy(7, 7)); 1798 1799 privatePOBoxLabel.setText(bundle 1801 .getString("privatePOBoxLabel.text")); 1802 privatePOBoxLabel.setLabelFor(privatePOBoxTextField); 1803 mailingAddressPanel.add(privatePOBoxLabel, cc.xywh(1, 1804 9, 1, 1, CellConstraints.RIGHT, 1805 CellConstraints.DEFAULT)); 1806 mailingAddressPanel.add(privatePOBoxTextField, cc.xy(3, 1807 9)); 1808 1809 privateCountryLabel.setText(bundle 1811 .getString("privateCountryLabel.text")); 1812 privateCountryLabel 1813 .setLabelFor(privateCountryTextField); 1814 mailingAddressPanel.add(privateCountryLabel, cc.xywh(5, 1815 9, 1, 1, CellConstraints.RIGHT, 1816 CellConstraints.DEFAULT)); 1817 mailingAddressPanel.add(privateCountryTextField, cc.xy( 1818 7, 9)); 1819 mailingAddressPanel.add(workSeparator, cc.xywh(1, 13, 1820 7, 1)); 1821 1822 workAddressLabel.setText(bundle 1824 .getString("workAddressLabel.text")); 1825 workAddressLabel.setLabelFor(workAddressTextArea); 1826 mailingAddressPanel.add(workAddressLabel, cc.xywh(1, 1827 15, 1, 1, CellConstraints.RIGHT, 1828 CellConstraints.DEFAULT)); 1829 1830 { 1832 scrollPane2 1833 .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); 1834 scrollPane2.setViewportView(workAddressTextArea); 1835 } 1836 mailingAddressPanel.add(scrollPane2, cc.xywh(3, 15, 1, 1837 3)); 1838 1839 workCityLabel.setText(bundle 1841 .getString("workCityLabel.text")); 1842 workCityLabel.setLabelFor(workCityTextField); 1843 mailingAddressPanel.add(workCityLabel, cc.xywh(5, 15, 1844 1, 1, CellConstraints.RIGHT, 1845 CellConstraints.DEFAULT)); 1846 1847 workCityTextField.setColumns(5); 1849 mailingAddressPanel 1850 .add(workCityTextField, cc.xy(7, 15)); 1851 1852 workZipPostalCodeLabel.setText(bundle 1854 .getString("workZipPostalCodeLabel.text")); 1855 workZipPostalCodeLabel 1856 .setLabelFor(workZipPostalCodeTextField); 1857 mailingAddressPanel.add(workZipPostalCodeLabel, cc 1858 .xywh(5, 17, 1, 1, CellConstraints.RIGHT, 1859 CellConstraints.DEFAULT)); 1860 mailingAddressPanel.add(workZipPostalCodeTextField, cc 1861 .xy(7, 17)); 1862 1863 label2.setText(bundle.getString("streetLabel.text")); 1865 label2.setLabelFor(workStreetTextField); 1866 mailingAddressPanel 1867 .add(label2, cc.xywh(1, 19, 1, 1, 1868 CellConstraints.RIGHT, 1869 CellConstraints.DEFAULT)); 1870 mailingAddressPanel.add(workStreetTextField, cc.xy(3, 1871 19)); 1872 1873 workStateProvinceCountyLabel 1875 .setText(bundle 1876 .getString("workStateProvinceCountyLabel.text")); 1877 workStateProvinceCountyLabel 1878 .setLabelFor(workStateProvinceCountyTextField); 1879 mailingAddressPanel.add(workStateProvinceCountyLabel, 1880 cc.xywh(5, 19, 1, 1, CellConstraints.RIGHT, 1881 CellConstraints.DEFAULT)); 1882 mailingAddressPanel.add( 1883 workStateProvinceCountyTextField, cc.xy(7, 19)); 1884 1885 workPOBoxLabel.setText(bundle 1887 .getString("workPOBoxLabel.text")); 1888 workPOBoxLabel.setLabelFor(workPOBoxTextField); 1889 mailingAddressPanel.add(workPOBoxLabel, cc.xywh(1, 21, 1890 1, 1, CellConstraints.RIGHT, 1891 CellConstraints.DEFAULT)); 1892 mailingAddressPanel.add(workPOBoxTextField, cc 1893 .xy(3, 21)); 1894 1895 workCountryLabel.setText(bundle 1897 .getString("workCountryLabel.text")); 1898 workCountryLabel.setLabelFor(workCountryTextField); 1899 mailingAddressPanel.add(workCountryLabel, cc.xywh(5, 1900 21, 1, 1, CellConstraints.RIGHT, 1901 CellConstraints.DEFAULT)); 1902 mailingAddressPanel.add(workCountryTextField, cc.xy(7, 1903 21)); 1904 mailingAddressPanel.add(otherSeparator, cc.xywh(1, 25, 1905 7, 1)); 1906 1907 otherAddressLabel.setLabelFor(otherAddressTextArea); 1909 mailingAddressPanel.add(otherAddressLabel, cc.xywh(1, 1910 27, 1, 1, CellConstraints.RIGHT, 1911 CellConstraints.DEFAULT)); 1912 1913 { 1915 scrollPane4 1916 .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); 1917 scrollPane4.setViewportView(otherAddressTextArea); 1918 } 1919 mailingAddressPanel.add(scrollPane4, cc.xywh(3, 27, 1, 1920 3)); 1921 1922 otherCityLabel.setText(bundle 1924 .getString("otherCityLabel.text")); 1925 otherCityLabel.setLabelFor(otherCityTextField); 1926 mailingAddressPanel.add(otherCityLabel, cc.xywh(5, 27, 1927 1, 1, CellConstraints.RIGHT, 1928 CellConstraints.DEFAULT)); 1929 mailingAddressPanel.add(otherCityTextField, cc 1930 .xy(7, 27)); 1931 1932 otherZipPostalCodeLabel.setText(bundle 1934 .getString("otherZipPostalCodeLabel.text")); 1935 otherZipPostalCodeLabel 1936 .setLabelFor(otherZipPostalCodeTextField); 1937 mailingAddressPanel.add(otherZipPostalCodeLabel, cc 1938 .xywh(5, 29, 1, 1, CellConstraints.RIGHT, 1939 CellConstraints.DEFAULT)); 1940 mailingAddressPanel.add(otherZipPostalCodeTextField, cc 1941 .xy(7, 29)); 1942 1943 label3.setText(bundle.getString("streetLabel.text")); 1945 label3.setLabelFor(otherStreetTextField); 1946 mailingAddressPanel 1947 .add(label3, cc.xywh(1, 31, 1, 1, 1948 CellConstraints.RIGHT, 1949 CellConstraints.DEFAULT)); 1950 mailingAddressPanel.add(otherStreetTextField, cc.xy(3, 1951 31)); 1952 1953 otherStateProvinceCountyLabel 1955 .setText(bundle 1956 .getString("otherStateProvinceCountyLabel.text")); 1957 otherStateProvinceCountyLabel 1958 .setLabelFor(otherStateProvinceCountyTextField); 1959 mailingAddressPanel.add(otherStateProvinceCountyLabel, 1960 cc.xywh(5, 31, 1, 1, CellConstraints.RIGHT, 1961 CellConstraints.DEFAULT)); 1962 mailingAddressPanel 1963 .add(otherStateProvinceCountyTextField, cc.xy( 1964 7, 31)); 1965 1966 otherPOBoxLabel.setText(bundle 1968 .getString("otherPOBoxLabel.text")); 1969 otherPOBoxLabel.setLabelFor(otherPOBoxTextField); 1970 mailingAddressPanel.add(otherPOBoxLabel, cc.xywh(1, 33, 1971 1, 1, CellConstraints.RIGHT, 1972 CellConstraints.DEFAULT)); 1973 mailingAddressPanel.add(otherPOBoxTextField, cc.xy(3, 1974 33)); 1975 1976 otherCountryLabel.setText(bundle 1978 .getString("otherCountryLabel.text")); 1979 otherCountryLabel.setLabelFor(otherCountryTextField); 1980 mailingAddressPanel.add(otherCountryLabel, cc.xywh(5, 1981 33, 1, 1, CellConstraints.RIGHT, 1982 CellConstraints.DEFAULT)); 1983 mailingAddressPanel.add(otherCountryTextField, cc.xy(7, 1984 33)); 1985 } 1986 tabbedPane2.addTab(bundle 1987 .getString("mailingAddressPanel.tab.title"), 1988 mailingAddressPanel); 1989 1990 } 1991 contentPane.add(tabbedPane2, BorderLayout.NORTH); 1992 } 1993 dialogPane.add(contentPane, BorderLayout.CENTER); 1994 1995 { 1997 buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); 1998 buttonBar.setLayout(new FormLayout(new ColumnSpec[] { 1999 FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC, 2000 FormFactory.RELATED_GAP_COLSPEC, 2001 FormFactory.BUTTON_COLSPEC }, RowSpec 2002 .decodeSpecs("pref"))); 2003 2004 okButton.setText(bundle.getString("okButton.text")); 2006 buttonBar.add(okButton, cc.xy(2, 1)); 2007 2008 cancelButton.setText(bundle.getString("cancelButton.text")); 2010 buttonBar.add(cancelButton, cc.xy(4, 1)); 2011 } 2012 dialogPane.add(buttonBar, BorderLayout.SOUTH); 2013 } 2014 contentPane2.add(dialogPane, BorderLayout.CENTER); 2015 } 2016 2017 2020 public ContactModel getDestModel() { 2021 return destModel; 2022 } 2023 2024} 2025 | Popular Tags |