KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > addressbook > gui > dialog > contact > ContactEditorDialog


1 // The contents of this file are subject to the Mozilla Public License Version
2
// 1.1
3
//(the "License"); you may not use this file except in compliance with the
4
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
5
//
6
//Software distributed under the License is distributed on an "AS IS" basis,
7
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
8
//for the specific language governing rights and
9
//limitations under the License.
10
//
11
//The Original Code is "The Columba Project"
12
//
13
//The Initial Developers of the Original Code are Frederik Dietz and Timo
14
// Stich.
15
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
16
//
17
//All Rights Reserved.
18
package org.columba.addressbook.gui.dialog.contact;
19
20 import java.awt.BorderLayout JavaDoc;
21 import java.awt.Container JavaDoc;
22 import java.awt.Frame JavaDoc;
23 import java.awt.Insets JavaDoc;
24 import java.awt.event.ActionEvent JavaDoc;
25 import java.awt.event.ActionListener JavaDoc;
26 import java.net.MalformedURLException JavaDoc;
27 import java.net.URL JavaDoc;
28 import java.util.Iterator JavaDoc;
29 import java.util.ResourceBundle JavaDoc;
30
31 import javax.swing.Icon JavaDoc;
32 import javax.swing.ImageIcon JavaDoc;
33 import javax.swing.JButton JavaDoc;
34 import javax.swing.JCheckBox JavaDoc;
35 import javax.swing.JComboBox JavaDoc;
36 import javax.swing.JComponent JavaDoc;
37 import javax.swing.JDialog JavaDoc;
38 import javax.swing.JLabel JavaDoc;
39 import javax.swing.JPanel JavaDoc;
40 import javax.swing.JScrollPane JavaDoc;
41 import javax.swing.JTabbedPane JavaDoc;
42 import javax.swing.JTextArea JavaDoc;
43 import javax.swing.JTextField JavaDoc;
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 /**
68  * Contact Editor Dialog.
69  * <p>
70  * Editor doesn't change contact model, instead it uses a new contact model
71  * instance. Use <code>getDestModel()</code> to retrieve the resulting contact
72  * model, after the user is finished with editing.
73  *
74  * @author Frederik Dietz
75  */

76
77 public class ContactEditorDialog extends JDialog JavaDoc implements ActionListener JavaDoc {
78
79     private JPanel JavaDoc dialogPane;
80
81     private JPanel JavaDoc contentPane;
82
83     private JTabbedPane JavaDoc tabbedPane2;
84
85     private JPanel JavaDoc contactPanel;
86
87     private JPanel JavaDoc panel7;
88
89     private JButton JavaDoc pictureButton;
90
91     private JButton JavaDoc formattedNameButton;
92
93     private JTextField JavaDoc formattedNameTextField;
94
95     private JLabel JavaDoc nicknameLabel;
96
97     private JTextField JavaDoc nicknameTextField;
98
99     private JLabel JavaDoc fileunderLabel;
100
101     private JComboBox JavaDoc fileunderComboBox;
102
103     private JLabel JavaDoc whereLabel;
104
105     private FolderComboBox whereComboBox;
106
107     private JButton JavaDoc categoriesButton;
108
109     private JTextField JavaDoc categoriesTextField;
110
111     private JComponent JavaDoc emailSeparator;
112
113     private JComboBox JavaDoc emailComboBox1;
114
115     private JTextField JavaDoc emailTextField1;
116
117     private JComboBox JavaDoc emailComboBox2;
118
119     private JTextField JavaDoc emailTextField2;
120
121     private JComboBox JavaDoc emailComboBox3;
122
123     private JTextField JavaDoc emailTextField3;
124
125     private JComboBox JavaDoc emailComboBox4;
126
127     private JTextField JavaDoc emailTextField4;
128
129     private JCheckBox JavaDoc preferHtmlCheckBox;
130
131     private JComponent JavaDoc telephoneSeparator;
132
133     private JComboBox JavaDoc telephoneComboBox1;
134
135     private JTextField JavaDoc telephoneTextField1;
136
137     private JComboBox JavaDoc telephoneComboBox2;
138
139     private JTextField JavaDoc telephoneTextField2;
140
141     private JComboBox JavaDoc telephoneComboBox3;
142
143     private JTextField JavaDoc telephoneTextField3;
144
145     private JComboBox JavaDoc telephoneComboBox4;
146
147     private JTextField JavaDoc telephoneTextField4;
148
149     private JComponent JavaDoc imSeparator;
150
151     private JComboBox JavaDoc imComboBox1;
152
153     private JTextField JavaDoc imTextField1;
154
155     private JComboBox JavaDoc imComboBox2;
156
157     private JTextField JavaDoc imTextField2;
158
159     private JComboBox JavaDoc imComboBox3;
160
161     private JTextField JavaDoc imTextField3;
162
163     private JComboBox JavaDoc imComboBox4;
164
165     private JTextField JavaDoc imTextField4;
166
167     private JPanel JavaDoc personalInfoPanel;
168
169     private JComponent JavaDoc webAddressSeparator;
170
171     private JLabel JavaDoc homepageLabel;
172
173     private JPanel JavaDoc panel1;
174
175     private JTextField JavaDoc homepageTextField;
176
177     private JButton JavaDoc homepageButton;
178
179     private JLabel JavaDoc weblogLabel;
180
181     private JPanel JavaDoc panel5;
182
183     private JTextField JavaDoc weblogTextField;
184
185     private JButton JavaDoc weblogButton;
186
187     private JLabel JavaDoc calendarLabel;
188
189     private JPanel JavaDoc panel6;
190
191     private JTextField JavaDoc calendarTextField;
192
193     private JButton JavaDoc calendarButton;
194
195     private JLabel JavaDoc freebusyLabel;
196
197     private JPanel JavaDoc panel8;
198
199     private JTextField JavaDoc freebusyTextField;
200
201     private JButton JavaDoc freebusyButton;
202
203     private JComponent JavaDoc jobSeparator;
204
205     private JLabel JavaDoc professionLabel;
206
207     private JTextField JavaDoc professionTextField;
208
209     private JLabel JavaDoc titleLabel;
210
211     private JTextField JavaDoc titleTextField;
212
213     private JLabel JavaDoc companyLabel;
214
215     private JTextField JavaDoc companyTextField;
216
217     private JLabel JavaDoc departmentLabel;
218
219     private JTextField JavaDoc departmentTextField;
220
221     private JLabel JavaDoc managerLabel;
222
223     private JTextField JavaDoc managerTextField;
224
225     private JLabel JavaDoc officeLabel;
226
227     private JTextField JavaDoc officeTextField;
228
229     private JComponent JavaDoc miscellaneousSeparator;
230
231     private JLabel JavaDoc birthdayLabel;
232
233     private JComboBox JavaDoc birthdayComboBox;
234
235     private JLabel JavaDoc notesLabel;
236
237     private JScrollPane JavaDoc scrollPane3;
238
239     private JTextArea JavaDoc notesTextArea;
240
241     private JPanel JavaDoc mailingAddressPanel;
242
243     private JComponent JavaDoc privateSeparator;
244
245     private JLabel JavaDoc privateAddressLabel;
246
247     private JScrollPane JavaDoc scrollPane1;
248
249     private JTextArea JavaDoc privateAddressTextArea;
250
251     private JLabel JavaDoc privateCityLabel;
252
253     private JTextField JavaDoc privateCityTextField;
254
255     private JLabel JavaDoc privateZipPostalCodeLabel;
256
257     private JTextField JavaDoc privateZipPostalCodeTextField;
258
259     private JLabel JavaDoc label1;
260
261     private JTextField JavaDoc privateStreetTextField;
262
263     private JLabel JavaDoc privateStateProvinceCountyLabel;
264
265     private JTextField JavaDoc privateStateProvinceCountyTextField;
266
267     private JLabel JavaDoc privatePOBoxLabel;
268
269     private JTextField JavaDoc privatePOBoxTextField;
270
271     private JLabel JavaDoc privateCountryLabel;
272
273     private JTextField JavaDoc privateCountryTextField;
274
275     private JComponent JavaDoc workSeparator;
276
277     private JLabel JavaDoc workAddressLabel;
278
279     private JScrollPane JavaDoc scrollPane2;
280
281     private JTextArea JavaDoc workAddressTextArea;
282
283     private JLabel JavaDoc workCityLabel;
284
285     private JTextField JavaDoc workCityTextField;
286
287     private JLabel JavaDoc workZipPostalCodeLabel;
288
289     private JTextField JavaDoc workZipPostalCodeTextField;
290
291     private JLabel JavaDoc label2;
292
293     private JTextField JavaDoc workStreetTextField;
294
295     private JLabel JavaDoc workStateProvinceCountyLabel;
296
297     private JTextField JavaDoc workStateProvinceCountyTextField;
298
299     private JLabel JavaDoc workPOBoxLabel;
300
301     private JTextField JavaDoc workPOBoxTextField;
302
303     private JLabel JavaDoc workCountryLabel;
304
305     private JTextField JavaDoc workCountryTextField;
306
307     private JComponent JavaDoc otherSeparator;
308
309     private JLabel JavaDoc otherAddressLabel;
310
311     private JScrollPane JavaDoc scrollPane4;
312
313     private JTextArea JavaDoc otherAddressTextArea;
314
315     private JLabel JavaDoc otherCityLabel;
316
317     private JTextField JavaDoc otherCityTextField;
318
319     private JLabel JavaDoc otherZipPostalCodeLabel;
320
321     private JTextField JavaDoc otherZipPostalCodeTextField;
322
323     private JLabel JavaDoc label3;
324
325     private JTextField JavaDoc otherStreetTextField;
326
327     private JLabel JavaDoc otherStateProvinceCountyLabel;
328
329     private JTextField JavaDoc otherStateProvinceCountyTextField;
330
331     private JLabel JavaDoc otherPOBoxLabel;
332
333     private JTextField JavaDoc otherPOBoxTextField;
334
335     private JLabel JavaDoc otherCountryLabel;
336
337     private JTextField JavaDoc otherCountryTextField;
338
339     private JPanel JavaDoc buttonBar;
340
341     private JButton JavaDoc okButton;
342
343     private JButton JavaDoc cancelButton;
344
345     private FullNameDialog fullNameDialog;
346
347     private ResourceBundle JavaDoc bundle;
348
349     private IContactModel sourceModel;
350
351     private ContactModel destModel;
352
353     private boolean result = false;
354
355     public ContactEditorDialog(Frame JavaDoc owner, IContactModel sourceModel) {
356         super(owner, true);
357
358         this.sourceModel = sourceModel;
359
360         init();
361     }
362
363     public ContactEditorDialog(Frame JavaDoc owner) {
364         super(owner, true);
365
366         init();
367     }
368
369     /**
370      *
371      */

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             // leave dialog empty if no source contact model specified
394
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             // leave dialog empty if no source contact model specified
428
if (sourceModel == null)
429                 return;
430
431             // model -> view
432
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 JavaDoc image = null;
454             if (sourceModel.getPhoto() != null)
455                 image = sourceModel.getPhoto();
456             // fall back to default image
457
if (image == null)
458                 image = ImageLoader.getMiscIcon("malehead.png");
459             pictureButton.setIcon(image);
460
461             // we support up to 4 email addresses
462
Iterator JavaDoc 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             // we support up to 4 phone entries
481
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             // we support up to 4 im entries
500
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             // we support up to 3 address entries (work/private/other)
519
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             // view -> model
537
destModel.setNickName(nicknameTextField.getText());
538             destModel.setFormattedName(formattedNameTextField.getText());
539
540             if (fileunderComboBox.getSelectedItem() != null)
541                 destModel.setSortString((String JavaDoc) 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             // we support up to 4 email addresses
558
fillEmailModel(emailTextField1, emailComboBox1, destModel);
559             fillEmailModel(emailTextField2, emailComboBox2, destModel);
560             fillEmailModel(emailTextField3, emailComboBox3, destModel);
561             fillEmailModel(emailTextField4, emailComboBox4, destModel);
562
563             // we support up to 4 phones
564
fillPhoneModel(telephoneTextField1, telephoneComboBox1, destModel);
565             fillPhoneModel(telephoneTextField2, telephoneComboBox2, destModel);
566             fillPhoneModel(telephoneTextField3, telephoneComboBox3, destModel);
567             fillPhoneModel(telephoneTextField4, telephoneComboBox4, destModel);
568
569             // we support up to 4 im
570
fillIMModel(imTextField1, imComboBox1, destModel);
571             fillIMModel(imTextField2, imComboBox2, destModel);
572             fillIMModel(imTextField3, imComboBox3, destModel);
573             fillIMModel(imTextField4, imComboBox4, destModel);
574
575             // we support 3 address types (work/home/other)
576
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 JavaDoc icon = pictureButton.getIcon();
583             if (icon != null) {
584                 destModel.setPhoto((ImageIcon JavaDoc) icon);
585             }
586
587         }
588     }
589
590     /**
591      * for example: "lastname, firstname" or "firstname lastname"
592      */

593     private void fillSortStringComboBox() {
594         String JavaDoc ln = fullNameDialog.getLastNameTextField().getText();
595         String JavaDoc 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 JavaDoc imTextField, JComboBox JavaDoc 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 JavaDoc telephoneTextField,
646             JComboBox JavaDoc 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 JavaDoc imComboBox,
705             JTextField JavaDoc 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 JavaDoc telephoneComboBox,
722             JTextField JavaDoc 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     /**
763      * Fill address model using values from ui-controls.
764      *
765      * @param type
766      * @param destModel
767      */

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     /**
801      * Fill email model using values from ui-controls.
802      *
803      * @param destModel
804      * @param emailComboBox
805      * @param emailTextField
806      *
807      */

808     private void fillEmailModel(JTextField JavaDoc emailTextField,
809             JComboBox JavaDoc 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     /**
824      * Fill all email ui-controls from model.
825      *
826      */

827     private void fillEmailView(IEmailModel m, JComboBox JavaDoc comboBox,
828             JTextField JavaDoc 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     /**
840      * Fill all address ui-controls from model.
841      *
842      * @param m
843      * address model
844      */

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 JavaDoc event) {
877         String JavaDoc 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 JavaDoc fn = fullNameDialog.getFormattedName();
894                 // fill formatted textfield
895
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 JavaDoc();
913         contentPane = new JPanel JavaDoc();
914         tabbedPane2 = new JTabbedPane JavaDoc();
915         contactPanel = new JPanel JavaDoc();
916         panel7 = new JPanel JavaDoc();
917         pictureButton = new JButton JavaDoc();
918         formattedNameButton = new JButton JavaDoc();
919         formattedNameButton.setActionCommand("FORMATTED_NAME_DIALOG");
920         formattedNameButton.addActionListener(this);
921
922         formattedNameTextField = new JTextField JavaDoc();
923         nicknameLabel = new JLabel JavaDoc();
924         nicknameTextField = new JTextField JavaDoc();
925         fileunderLabel = new JLabel JavaDoc();
926         fileunderComboBox = new JComboBox JavaDoc();
927         whereLabel = new JLabel JavaDoc("Where:");
928         whereComboBox = new FolderComboBox(false);
929         whereLabel.setLabelFor(whereComboBox);
930         categoriesButton = new JButton JavaDoc();
931         categoriesButton.setEnabled(false);
932         categoriesTextField = new JTextField JavaDoc();
933         categoriesTextField.setEnabled(false);
934         emailSeparator = compFactory.createSeparator(bundle
935                 .getString("emailSeparator.text"));
936         String JavaDoc[] emailTypes = new String JavaDoc[] { "Work", "Home", "Other" };
937         emailComboBox1 = new JComboBox JavaDoc(emailTypes);
938         emailTextField1 = new JTextField JavaDoc();
939         emailComboBox2 = new JComboBox JavaDoc(emailTypes);
940         emailTextField2 = new JTextField JavaDoc();
941         emailComboBox3 = new JComboBox JavaDoc(emailTypes);
942         emailTextField3 = new JTextField JavaDoc();
943         emailComboBox4 = new JComboBox JavaDoc(emailTypes);
944         emailTextField4 = new JTextField JavaDoc();
945         preferHtmlCheckBox = new JCheckBox JavaDoc();
946         preferHtmlCheckBox.setEnabled(false);
947         telephoneSeparator = compFactory.createSeparator(bundle
948                 .getString("telephoneSeparator.text"));
949         String JavaDoc[] phoneTypes = new String JavaDoc[] { "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 JavaDoc(phoneTypes);
955         telephoneTextField1 = new JTextField JavaDoc();
956         telephoneComboBox2 = new JComboBox JavaDoc(phoneTypes);
957         telephoneTextField2 = new JTextField JavaDoc();
958         telephoneComboBox3 = new JComboBox JavaDoc(phoneTypes);
959         telephoneTextField3 = new JTextField JavaDoc();
960         telephoneComboBox4 = new JComboBox JavaDoc(phoneTypes);
961         telephoneTextField4 = new JTextField JavaDoc();
962         imSeparator = compFactory.createSeparator(bundle
963                 .getString("imSeparator.text"));
964         String JavaDoc[] imTypes = new String JavaDoc[] { "Jabber", "AIM", "Yahoo", "MSN",
965                 "ICQ" };
966         imComboBox1 = new JComboBox JavaDoc(imTypes);
967         imTextField1 = new JTextField JavaDoc();
968         imComboBox2 = new JComboBox JavaDoc(imTypes);
969         imTextField2 = new JTextField JavaDoc();
970         imComboBox3 = new JComboBox JavaDoc(imTypes);
971         imTextField3 = new JTextField JavaDoc();
972         imComboBox4 = new JComboBox JavaDoc(imTypes);
973         imTextField4 = new JTextField JavaDoc();
974         personalInfoPanel = new JPanel JavaDoc();
975         webAddressSeparator = compFactory.createSeparator(bundle
976                 .getString("webAddressSeparator.text"));
977         homepageLabel = new JLabel JavaDoc();
978         panel1 = new JPanel JavaDoc();
979         homepageTextField = new JTextField JavaDoc();
980         homepageButton = new JButton JavaDoc(ImageLoader
981                 .getSmallIcon(IconKeys.INTERNET));
982         homepageButton.setMargin(new Insets JavaDoc(0, 0, 0, 0));
983         homepageButton.addActionListener(new ActionListener JavaDoc() {
984             public void actionPerformed(ActionEvent JavaDoc e) {
985                 String JavaDoc s = homepageTextField.getText();
986                 try {
987                     URL JavaDoc url = new URL JavaDoc(s);
988                     ColumbaDesktop.getInstance().browse(url);
989                 } catch (MalformedURLException JavaDoc e1) {
990                     e1.printStackTrace();
991                 }
992             }
993         });
994
995         weblogLabel = new JLabel JavaDoc();
996         panel5 = new JPanel JavaDoc();
997         weblogTextField = new JTextField JavaDoc();
998         weblogButton = new JButton JavaDoc(ImageLoader.getSmallIcon(IconKeys.INTERNET));
999         weblogButton.setMargin(new Insets JavaDoc(0, 0, 0, 0));
1000        weblogButton.addActionListener(new ActionListener JavaDoc() {
1001            public void actionPerformed(ActionEvent JavaDoc e) {
1002                String JavaDoc s = weblogTextField.getText();
1003                try {
1004                    URL JavaDoc url = new URL JavaDoc(s);
1005                    ColumbaDesktop.getInstance().browse(url);
1006                } catch (MalformedURLException JavaDoc e1) {
1007                    e1.printStackTrace();
1008                }
1009            }
1010        });
1011        calendarLabel = new JLabel JavaDoc();
1012        panel6 = new JPanel JavaDoc();
1013        calendarTextField = new JTextField JavaDoc();
1014        calendarButton = new JButton JavaDoc(ImageLoader
1015                .getSmallIcon(IconKeys.INTERNET));
1016        calendarButton.setMargin(new Insets JavaDoc(0, 0, 0, 0));
1017        calendarButton.addActionListener(new ActionListener JavaDoc() {
1018            public void actionPerformed(ActionEvent JavaDoc e) {
1019                String JavaDoc s = calendarTextField.getText();
1020                try {
1021                    URL JavaDoc url = new URL JavaDoc(s);
1022                    ColumbaDesktop.getInstance().browse(url);
1023                } catch (MalformedURLException JavaDoc e1) {
1024                    e1.printStackTrace();
1025                }
1026            }
1027        });
1028        freebusyLabel = new JLabel JavaDoc();
1029        panel8 = new JPanel JavaDoc();
1030        freebusyTextField = new JTextField JavaDoc();
1031        freebusyButton = new JButton JavaDoc(ImageLoader
1032                .getSmallIcon(IconKeys.INTERNET));
1033        freebusyButton.setMargin(new Insets JavaDoc(0, 0, 0, 0));
1034        freebusyButton.addActionListener(new ActionListener JavaDoc() {
1035            public void actionPerformed(ActionEvent JavaDoc e) {
1036                String JavaDoc s = freebusyTextField.getText();
1037                try {
1038                    URL JavaDoc url = new URL JavaDoc(s);
1039                    ColumbaDesktop.getInstance().browse(url);
1040                } catch (MalformedURLException JavaDoc e1) {
1041                    e1.printStackTrace();
1042                }
1043            }
1044        });
1045        jobSeparator = compFactory.createSeparator(bundle
1046                .getString("jobSeparator.text"));
1047        professionLabel = new JLabel JavaDoc();
1048        professionTextField = new JTextField JavaDoc();
1049        titleLabel = new JLabel JavaDoc();
1050        titleTextField = new JTextField JavaDoc();
1051        companyLabel = new JLabel JavaDoc();
1052        companyTextField = new JTextField JavaDoc();
1053        departmentLabel = new JLabel JavaDoc();
1054        departmentTextField = new JTextField JavaDoc();
1055        managerLabel = new JLabel JavaDoc();
1056        managerTextField = new JTextField JavaDoc();
1057        officeLabel = new JLabel JavaDoc();
1058        officeTextField = new JTextField JavaDoc();
1059        miscellaneousSeparator = compFactory.createSeparator(bundle
1060                .getString("miscellaneousSeparator.text"));
1061        birthdayLabel = new JLabel JavaDoc();
1062        birthdayComboBox = new JComboBox JavaDoc();
1063        notesLabel = new JLabel JavaDoc();
1064        scrollPane3 = new JScrollPane JavaDoc();
1065        notesTextArea = new JTextArea JavaDoc();
1066        mailingAddressPanel = new JPanel JavaDoc();
1067        privateSeparator = compFactory.createSeparator(bundle
1068                .getString("privateSeparator.text"));
1069        privateAddressLabel = new JLabel JavaDoc();
1070        scrollPane1 = new JScrollPane JavaDoc();
1071        privateAddressTextArea = new JTextArea JavaDoc();
1072        privateCityLabel = new JLabel JavaDoc();
1073        privateCityTextField = new JTextField JavaDoc();
1074        privateZipPostalCodeLabel = new JLabel JavaDoc();
1075        privateZipPostalCodeTextField = new JTextField JavaDoc();
1076        label1 = new JLabel JavaDoc();
1077        privateStreetTextField = new JTextField JavaDoc();
1078        privateStateProvinceCountyLabel = new JLabel JavaDoc();
1079        privateStateProvinceCountyTextField = new JTextField JavaDoc();
1080        privatePOBoxLabel = new JLabel JavaDoc();
1081        privatePOBoxTextField = new JTextField JavaDoc();
1082        privateCountryLabel = new JLabel JavaDoc();
1083        privateCountryTextField = new JTextField JavaDoc();
1084        workSeparator = compFactory.createSeparator(bundle
1085                .getString("workSeparator.text"));
1086        workAddressLabel = new JLabel JavaDoc();
1087        scrollPane2 = new JScrollPane JavaDoc();
1088        workAddressTextArea = new JTextArea JavaDoc();
1089        workCityLabel = new JLabel JavaDoc();
1090        workCityTextField = new JTextField JavaDoc();
1091        workZipPostalCodeLabel = new JLabel JavaDoc();
1092        workZipPostalCodeTextField = new JTextField JavaDoc();
1093        label2 = new JLabel JavaDoc();
1094        workStreetTextField = new JTextField JavaDoc();
1095        workStateProvinceCountyLabel = new JLabel JavaDoc();
1096        workStateProvinceCountyTextField = new JTextField JavaDoc();
1097        workPOBoxLabel = new JLabel JavaDoc();
1098        workPOBoxTextField = new JTextField JavaDoc();
1099        workCountryLabel = new JLabel JavaDoc();
1100        workCountryTextField = new JTextField JavaDoc();
1101        otherSeparator = compFactory.createSeparator(bundle
1102                .getString("otherSeparator.text"));
1103        otherAddressLabel = compFactory.createLabel(bundle
1104                .getString("otherAddressLabel.textWithMnemonic"));
1105        scrollPane4 = new JScrollPane JavaDoc();
1106        otherAddressTextArea = new JTextArea JavaDoc();
1107        otherCityLabel = new JLabel JavaDoc();
1108        otherCityTextField = new JTextField JavaDoc();
1109        otherZipPostalCodeLabel = new JLabel JavaDoc();
1110        otherZipPostalCodeTextField = new JTextField JavaDoc();
1111        label3 = new JLabel JavaDoc();
1112        otherStreetTextField = new JTextField JavaDoc();
1113        otherStateProvinceCountyLabel = new JLabel JavaDoc();
1114        otherStateProvinceCountyTextField = new JTextField JavaDoc();
1115        otherPOBoxLabel = new JLabel JavaDoc();
1116        otherPOBoxTextField = new JTextField JavaDoc();
1117        otherCountryLabel = new JLabel JavaDoc();
1118        otherCountryTextField = new JTextField JavaDoc();
1119
1120        buttonBar = new JPanel JavaDoc();
1121        okButton = new JButton JavaDoc();
1122        okButton.setActionCommand("OK");
1123        okButton.addActionListener(this);
1124        cancelButton = new JButton JavaDoc();
1125        cancelButton.setActionCommand("CANCEL");
1126        cancelButton.addActionListener(this);
1127
1128    }
1129
1130    private void layoutComponents() {
1131        CellConstraints cc = new CellConstraints();
1132
1133        // ======== this ========
1134
Container JavaDoc contentPane2 = getContentPane();
1135        contentPane2.setLayout(new BorderLayout JavaDoc());
1136
1137        // ======== dialogPane ========
1138
{
1139            dialogPane.setBorder(Borders.DIALOG_BORDER);
1140            dialogPane.setLayout(new BorderLayout JavaDoc());
1141
1142            // ======== contentPane ========
1143
{
1144                contentPane.setLayout(new BorderLayout JavaDoc());
1145
1146                // ======== tabbedPane2 ========
1147
{
1148                    tabbedPane2
1149                            .setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
1150
1151                    // ======== contactPanel ========
1152
{
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                        // ======== panel7 ========
1215
{
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                            // ---- pictureButton ----
1249

1250                            panel7.add(pictureButton, cc.xywh(1, 1, 1, 5));
1251
1252                            // ---- fullnameButton ----
1253
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 ----
1259
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 ----
1268
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 ----
1281
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 ----
1293
emailTextField1.setColumns(20);
1294                        contactPanel.add(emailTextField1, cc.xy(3, 7));
1295                        contactPanel.add(emailComboBox2, cc.xy(5, 7));
1296
1297                        // ---- emailTextField2 ----
1298
emailTextField2.setColumns(20);
1299                        contactPanel.add(emailTextField2, cc.xy(7, 7));
1300                        contactPanel.add(emailComboBox3, cc.xy(1, 9));
1301
1302                        // ---- emailTextField3 ----
1303
emailTextField3.setColumns(20);
1304                        contactPanel.add(emailTextField3, cc.xy(3, 9));
1305                        contactPanel.add(emailComboBox4, cc.xy(5, 9));
1306
1307                        // ---- emailTextField4 ----
1308
emailTextField4.setColumns(20);
1309                        contactPanel.add(emailTextField4, cc.xy(7, 9));
1310
1311                        // ---- preferHtmlCheckBox ----
1312
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 ----
1320
telephoneTextField1.setColumns(20);
1321                        contactPanel.add(telephoneTextField1, cc.xy(3, 17));
1322                        contactPanel.add(telephoneComboBox2, cc.xy(5, 17));
1323
1324                        // ---- telephoneTextField2 ----
1325
telephoneTextField2.setColumns(20);
1326                        contactPanel.add(telephoneTextField2, cc.xy(7, 17));
1327                        contactPanel.add(telephoneComboBox3, cc.xy(1, 19));
1328
1329                        // ---- telephoneTextField3 ----
1330
telephoneTextField3.setColumns(20);
1331                        contactPanel.add(telephoneTextField3, cc.xy(3, 19));
1332                        contactPanel.add(telephoneComboBox4, cc.xy(5, 19));
1333
1334                        // ---- telephoneTextField4 ----
1335
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 ----
1341
imTextField1.setColumns(20);
1342                        contactPanel.add(imTextField1, cc.xy(3, 25));
1343                        contactPanel.add(imComboBox2, cc.xy(5, 25));
1344
1345                        // ---- imTextField2 ----
1346
imTextField2.setColumns(20);
1347                        contactPanel.add(imTextField2, cc.xy(7, 25));
1348                        contactPanel.add(imComboBox3, cc.xy(1, 27));
1349
1350                        // ---- imTextField3 ----
1351
imTextField3.setColumns(20);
1352                        contactPanel.add(imTextField3, cc.xy(3, 27));
1353                        contactPanel.add(imComboBox4, cc.xy(5, 27));
1354
1355                        // ---- imTextField4 ----
1356
imTextField4.setColumns(20);
1357                        contactPanel.add(imTextField4, cc.xy(7, 27));
1358                    }
1359                    tabbedPane2.addTab(bundle
1360                            .getString("contactPanel.tab.title"), contactPanel);
1361
1362                    // ======== personalInfoPanel ========
1363
{
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 ----
1430
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                        // ======== panel1 ========
1438
{
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 ----
1449
homepageTextField.setColumns(20);
1450                            panel1.add(homepageTextField, cc.xy(1, 1));
1451
1452                            // ---- homepageButton ----
1453

1454                            panel1.add(homepageButton, cc.xy(3, 1));
1455                        }
1456                        personalInfoPanel.add(panel1, cc.xywh(3, 3, 5, 1));
1457
1458                        // ---- weblogLabel ----
1459
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                        // ======== panel5 ========
1468
{
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 ----
1478
weblogTextField.setColumns(20);
1479                            panel5.add(weblogTextField, cc.xy(1, 1));
1480
1481                            // ---- weblogButton ----
1482

1483                            panel5.add(weblogButton, cc.xy(3, 1));
1484                        }
1485                        personalInfoPanel.add(panel5, cc.xywh(3, 5, 5, 1));
1486
1487                        // ---- calendarLabel ----
1488
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                        // ======== panel6 ========
1496
{
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 ----
1506
calendarTextField.setColumns(20);
1507                            panel6.add(calendarTextField, cc.xy(1, 1));
1508
1509                            // ---- calendarButton ----
1510
panel6.add(calendarButton, cc.xy(3, 1));
1511                        }
1512                        personalInfoPanel.add(panel6, cc.xywh(3, 7, 5, 1));
1513
1514                        // ---- freebusyLabel ----
1515
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                        // ======== panel8 ========
1523
{
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 ----
1533
freebusyTextField.setColumns(20);
1534                            panel8.add(freebusyTextField, cc.xy(1, 1));
1535
1536                            // ---- freebusyButton ----
1537

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 ----
1545
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 ----
1553
professionTextField.setColumns(20);
1554                        personalInfoPanel
1555                                .add(professionTextField, cc.xy(3, 15));
1556
1557                        // ---- titleLabel ----
1558
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 ----
1566
titleTextField.setColumns(20);
1567                        personalInfoPanel.add(titleTextField, cc.xy(7, 15));
1568
1569                        // ---- companyLabel ----
1570
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 ----
1578
companyTextField.setColumns(20);
1579                        personalInfoPanel.add(companyTextField, cc.xy(3, 17));
1580
1581                        // ---- departmentLabel ----
1582
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 ----
1590
departmentTextField.setColumns(20);
1591                        personalInfoPanel
1592                                .add(departmentTextField, cc.xy(7, 17));
1593
1594                        // ---- managerLabel ----
1595
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 ----
1603
managerTextField.setColumns(20);
1604                        personalInfoPanel.add(managerTextField, cc.xy(3, 19));
1605
1606                        // ---- officeLabel ----
1607
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 ----
1616
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 ----
1622
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 ----
1631
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                        // ======== scrollPane3 ========
1637
{
1638                            scrollPane3
1639                                    .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
1640
1641                            // ---- notesTextArea ----
1642
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                    // ======== mailingAddressPanel ========
1655
{
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 ----
1735
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                        // ======== scrollPane1 ========
1743
{
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 ----
1752
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 ----
1760
privateCityTextField.setColumns(5);
1761                        mailingAddressPanel.add(privateCityTextField, cc.xy(7,
1762                                3));
1763
1764                        // ---- privateZipPostalCodeLabel ----
1765
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 ----
1776
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 ----
1786
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 ----
1800
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 ----
1810
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 ----
1823
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                        // ======== scrollPane2 ========
1831
{
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 ----
1840
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 ----
1848
workCityTextField.setColumns(5);
1849                        mailingAddressPanel
1850                                .add(workCityTextField, cc.xy(7, 15));
1851
1852                        // ---- workZipPostalCodeLabel ----
1853
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 ----
1864
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 ----
1874
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 ----
1886
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 ----
1896
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 ----
1908
otherAddressLabel.setLabelFor(otherAddressTextArea);
1909                        mailingAddressPanel.add(otherAddressLabel, cc.xywh(1,
1910                                27, 1, 1, CellConstraints.RIGHT,
1911                                CellConstraints.DEFAULT));
1912
1913                        // ======== scrollPane4 ========
1914
{
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 ----
1923
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 ----
1933
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 ----
1944
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 ----
1954
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 ----
1967
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 ----
1977
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            // ======== buttonBar ========
1996
{
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 ----
2005
okButton.setText(bundle.getString("okButton.text"));
2006                buttonBar.add(okButton, cc.xy(2, 1));
2007
2008                // ---- cancelButton ----
2009
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    /**
2018     * @return Returns the destModel.
2019     */

2020    public ContactModel getDestModel() {
2021        return destModel;
2022    }
2023
2024}
2025
Popular Tags