use of com.mucommander.job.impl.SendMailJob in project mucommander by mucommander.
the class EmailFilesDialog method actionPerformed.
// //////////////////////////
// ActionListener methods //
// //////////////////////////
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
// OK Button
if (source == okButton) {
String to = toField.getText().trim();
String subject = subjectField.getText();
String body = bodyArea.getText();
if (!to.equals("")) {
lastTo = to;
lastSubject = subject;
lastBody = body;
// Starts by disposing the dialog
dispose();
// Creates new FileSet with files that have been selected
FileSet filesToSend = new FileSet(flattenedFiles.getBaseFolder());
int nbFiles = fileCheckboxes.length;
for (int i = 0; i < nbFiles; i++) if (fileCheckboxes[i].isSelected())
filesToSend.add(flattenedFiles.elementAt(i));
// Starts sending files
ProgressDialog progressDialog = new ProgressDialog(mainFrame, Translator.get("email_dialog.sending"));
SendMailJob mailJob = new SendMailJob(progressDialog, mainFrame, filesToSend, to, subject, body);
progressDialog.start(mailJob);
}
} else // Cancel button
if (source == cancelButton) {
dispose();
}
}
Aggregations