Refactor ProgressDialog
This commit is contained in:
parent
c7b97825f3
commit
0e126daace
|
@ -97,7 +97,9 @@ class RenameAction extends AbstractAction {
|
|||
} else {
|
||||
// call and wait
|
||||
RenameWorker worker = new RenameWorker(renameMap, renameLog, action);
|
||||
ProgressMonitor.runTask(action.getDisplayName(), String.format("%s %d %s. This may take a while.", action.getDisplayName() + "ing", renameMap.size(), renameMap.size() == 1 ? "file" : "files"), worker).get();
|
||||
String title = String.format("%s - %s", getApplicationName(), action.getDisplayName());
|
||||
String message = String.format("%s %d %s. This may take a while.", action.getDisplayName() + "ing", renameMap.size(), renameMap.size() == 1 ? "file" : "files");
|
||||
ProgressMonitor.runTask(title, message, worker).get();
|
||||
}
|
||||
} catch (CancellationException e) {
|
||||
debug.finest(e::toString);
|
||||
|
|
|
@ -12,10 +12,8 @@ import java.util.logging.Level;
|
|||
import org.controlsfx.dialog.ProgressDialog;
|
||||
|
||||
import javafx.concurrent.Task;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.stage.Modality;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.WindowEvent;
|
||||
|
||||
public class ProgressMonitor<T> {
|
||||
|
||||
|
|
Loading…
Reference in New Issue