use of com.mucommander.job.impl.DeleteJob in project mucommander by mucommander.
the class DeleteDialog method actionPerformed.
// /////////////////////////////////
// ActionListener implementation //
// /////////////////////////////////
public void actionPerformed(ActionEvent e) {
// Start by disposing this dialog
dispose();
if (e.getSource() == deleteButton) {
// Starts deleting files
ProgressDialog progressDialog = new ProgressDialog(mainFrame, Translator.get("delete_dialog.deleting"));
DeleteJob deleteJob = new DeleteJob(progressDialog, mainFrame, files, moveToTrash);
progressDialog.start(deleteJob);
}
}
use of com.mucommander.job.impl.DeleteJob in project mucommander by mucommander.
the class XfceTrash method empty.
/**
* Empty the trash
* <p>
* <b>Implementation notes:</b><br>
* Simply free the <code>TRASH_PATH</code> directory
* </p>
*
* @return True if everything went well
*/
@Override
public boolean empty() {
// Abort if there is no usable trash folder
if (TRASH_FOLDER == null)
return false;
FileSet filesToDelete = new FileSet(TRASH_FOLDER);
try {
// delete real files
filesToDelete.addAll(TRASH_FILES_SUBFOLDER.ls());
// delete spec files
filesToDelete.addAll(TRASH_INFO_SUBFOLDER.ls());
} catch (java.io.IOException ex) {
LOGGER.debug("Failed to list files", ex);
return false;
}
if (filesToDelete.size() > 0) {
// Starts deleting files
MainFrame mainFrame = WindowManager.getCurrentMainFrame();
ProgressDialog progressDialog = new ProgressDialog(mainFrame, Translator.get("delete_dialog.deleting"));
DeleteJob deleteJob = new DeleteJob(progressDialog, mainFrame, filesToDelete, false);
progressDialog.start(deleteJob);
}
return true;
}
use of com.mucommander.job.impl.DeleteJob in project mucommander by mucommander.
the class GnomeTrash method empty.
/**
* Empty the trash
* <p>
* <b>Implementation notes:</b><br>
* Simply free the <code>TRASH_PATH</code> directory
* </p>
*
* @return True if everything went well
*/
@Override
public boolean empty() {
// Abort if there is no usable trash folder
if (TRASH_FOLDER == null)
return false;
FileSet filesToDelete = new FileSet(TRASH_FOLDER);
try {
// delete real files
filesToDelete.addAll(TRASH_FILES_SUBFOLDER.ls());
// delete spec files
filesToDelete.addAll(TRASH_INFO_SUBFOLDER.ls());
} catch (java.io.IOException ex) {
LOGGER.debug("Failed to list files", ex);
return false;
}
if (filesToDelete.size() > 0) {
// Starts deleting files
MainFrame mainFrame = WindowManager.getCurrentMainFrame();
ProgressDialog progressDialog = new ProgressDialog(mainFrame, Translator.get("delete_dialog.deleting"));
DeleteJob deleteJob = new DeleteJob(progressDialog, mainFrame, filesToDelete, false);
progressDialog.start(deleteJob);
}
return true;
}
Aggregations