Debug.msg("Import done");
if (entriesImported > 0) { jfritz.getPhonebook().saveToXMLFile(JFritz.PHONEBOOK_FILE); } Debug.msg("Import done, " + entriesImported + " entries imported");
    public void run() {        Debug.msg("Show Outlook-Import-Dialog"); //$NON-NLS-1$        toFront();        setSize(400, 500);        this.getContentPane().setLayout(null);        setBackground(Color.white);        JPanel jPanel = new JPanel();        jPanel.setBounds(0, 0, 400, 500);        jPanel.setLayout(null);        JLabel jLab = new JLabel(JFritz.getMessage("importing_outlook_contacts")); //$NON-NLS-1$        jLab.setFont(new Font(null, 1, 22));        jLab.setBounds(10, 0, 380, 80);        jPanel.add(jLab);        Dispatch myFolder = init();        Dispatch items = Dispatch.get(myFolder, "Items").toDispatch(); //$NON-NLS-1$        int count = Dispatch.call(items, "Count").toInt(); //$NON-NLS-1$        JPanel jPan = new JPanel(new GridLayout(count, 1));        jPan.setBackground(Color.white);        JScrollPane jsp = new JScrollPane(jPan);        jsp.setBounds(20, 80, 350, 325);        jPanel.add(jsp);        getContentPane().add(jPanel);        setLocationRelativeTo(jfritz.getJframe());        setVisible(true);        Debug.msg("Importing..."); //$NON-NLS-1$        for (int i = 1; i <= count; i++) {            boolean hasTel = false;            Dispatch item = Dispatch.call(items, "Item", new Integer(i)) //$NON-NLS-1$                    .toDispatch();            Person newContact = new Person();            for (oElements = outlookElements.elements(); oElements                    .hasMoreElements();)                try {                    String strName = oElements.nextElement().toString();                    String strValue = Dispatch.get(item, strName).toString();                    if (strName.equals("FullName")) { //$NON-NLS-1$                        jPan.add(new JLabel("  " + strValue)); //$NON-NLS-1$                        jPan.updateUI();                    }                    if (!strValue.equals("") //$NON-NLS-1$                            && ((strName.equals("BusinessTelephoneNumber") 			 //$NON-NLS-1$                                    || strName.equals("Business2TelephoneNumber") 	 //$NON-NLS-1$                                    || strName.equals("HomeTelephoneNumber")  		 //$NON-NLS-1$                                    || strName.equals("Home2TelephoneNumber") 		 //$NON-NLS-1$                                    || strName.equals("MobileTelephoneNumber") 		 //$NON-NLS-1$                                    || strName.equals("CarTelephoneNumber") 		 //$NON-NLS-1$                                    || strName.equals("RadioTelephoneNumber") 		 //$NON-NLS-1$                                    || strName.equals("PrimaryTelephoneNumber")  	 //$NON-NLS-1$                                    || strName.equals("CallbackTelephoneNumber")  	 //$NON-NLS-1$                                    || strName.equals("AssistantTelephoneNumber")  	 //$NON-NLS-1$                                    || strName.equals("CompanyMainTelephoneNumber")  //$NON-NLS-1$                                    || strName.equals("OtherTelephoneNumber")))) {   //$NON-NLS-1$                                        hasTel = true;                    }                    /**                     * if (strName.equals("HasPicture") &&                     * strValue.equals("-1")) contact.addContent((new                     * Element("Picture")) .addContent(new                     * Text(getContactPic(item))));                     */                    if (strName.equals("FirstName")) {  				//$NON-NLS-1$                        newContact.setFirstName(strValue);                    } else if (strName.equals("LastName")) {			//$NON-NLS-1$                        newContact.setLastName(strValue);                    } else if (strName.equals("MiddleName")) { 			//$NON-NLS-1$                        newContact.setCompany(strValue);                    } else if (strName.equals("HomeAddressStreet")) {   //$NON-NLS-1$                        newContact.setStreet(strValue);                    } else if (strName.equals("HomeAddressPostalCode")) { //$NON-NLS-1$                        newContact.setPostalCode(strValue);                    } else if (strName.equals("HomeAddressCity")) { //$NON-NLS-1$                        newContact.setCity(strValue);                    } else if (strName.equals("HomeTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact.addNumber(new PhoneNumber(strValue, "home")); //$NON-NLS-1$                    } else if (strName.equals("Home2TelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact.addNumber(new PhoneNumber(strValue, "home")); //$NON-NLS-1$                    } else if (strName.equals("PrimaryTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact.addNumber(new PhoneNumber(strValue, "home")); //$NON-NLS-1$                    } else if (strName.equals("MobileTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact                                .addNumber(new PhoneNumber(strValue, "mobile")); //$NON-NLS-1$                    } else if (strName.equals("BusinessTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact.addNumber(new PhoneNumber(strValue,                                "business")); //$NON-NLS-1$                    } else if (strName.equals("Business2TelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact.addNumber(new PhoneNumber(strValue,                                "business")); //$NON-NLS-1$                    } else if (strName.equals("RadioTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact                                .addNumber(new PhoneNumber(strValue, "other")); //$NON-NLS-1$                    } else if (strName.equals("CarTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact                                .addNumber(new PhoneNumber(strValue, "other")); //$NON-NLS-1$                    } else if (strName.equals("CallbackTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact                                .addNumber(new PhoneNumber(strValue, "other")); //$NON-NLS-1$                    } else if (strName.equals("AssistantTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact                                .addNumber(new PhoneNumber(strValue, "other")); //$NON-NLS-1$                    } else if (strName.equals("CompanyMainTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact                                .addNumber(new PhoneNumber(strValue, "other")); //$NON-NLS-1$                    } else if (strName.equals("OtherTelephoneNumber") //$NON-NLS-1$                            && (!strValue.equals(""))) { //$NON-NLS-1$                        newContact                                .addNumber(new PhoneNumber(strValue, "other")); //$NON-NLS-1$                    }                } catch (Exception exception1) {                }            if (hasTel)                jfritz.getPhonebook().addEntry(newContact);        }        Debug.msg("Import done"); //$NON-NLS-1$        JButton jButton = new JButton(JFritz.getMessage("okay")); //$NON-NLS-1$        //set default confirm button (Enter)        this.getRootPane().setDefaultButton(jButton);                jButton.addActionListener(this);        jButton.setBounds(160, 425, 80, 25);        jPanel.add(jButton);        jPanel.updateUI();    }