if (retval == JFileChooser.APPROVE_OPTION) {
File theFile = chooser.getSelectedFile();
if (theFile != null) {
XFile xfile = new XFile(chooser.getSelectedFile().getAbsolutePath());
StringVector sv = new StringVector();
DataModelEnumeration e = mailList.getMailModelEnumeration();
while (e.hasMore()) {
MailModel m = (MailModel) e.next();
StringBuffer line = new StringBuffer();
for (int i = 0; i < MailModel.MAIL_FIELDS.length; ++i) {
line.append(m.getChildText(MailModel.MAIL_FIELDS[i]) + SEPARATOR_CHAR[separator.getInt()]);
}
sv.append(line.toString());
}
DialogManager.setWaitCursor(DialogManager.getToplevelFrame());
try {
xfile.writeTextLines(sv);
} catch (Exception ex) {
DialogManager.setDefaultCursor(DialogManager.getToplevelFrame());
DialogManager.error(ex.getMessage());
return;