import javax.swing.text.Document;
import net.pterodactylus.util.io.MimeTypes;
-import net.pterodactylus.util.swing.DelayedNotification;
import net.pterodactylus.util.swing.SwingUtils;
+import net.pterodactylus.util.thread.StoppableDelay;
import de.todesbaum.jsite.application.FileOption;
import de.todesbaum.jsite.application.Project;
import de.todesbaum.jsite.gui.FileScanner.ScannedFile;
private JComboBox fileOptionsMIMETypeComboBox;
/** Delayed notification for file scanning. */
- private DelayedNotification delayedNotification;
+ private StoppableDelay delayedNotification;
/** Dialog to display while scanning. */
private JDialog scanningFilesDialog;
ignoreHiddenFilesCheckBox.setEnabled(false);
scanAction.setEnabled(false);
- delayedNotification = new DelayedNotification(scanningFilesDialog, 2000);
+ delayedNotification = new StoppableDelay(new Runnable() {
+
+ @Override
+ @SuppressWarnings("synthetic-access")
+ public void run() {
+ scanningFilesDialog.setVisible(true);
+ }
+ }, new Runnable() {
+
+ @Override
+ @SuppressWarnings("synthetic-access")
+ public void run() {
+ scanningFilesDialog.setVisible(false);
+ }
+ }, 2000);
new Thread(fileScanner).start();
new Thread(delayedNotification).start();
new Thread(new Runnable() {