import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JList;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SpringLayout;
if (selectedFile.exists())
{
- int confirm = JvOptionPane.showConfirmDialog(this,
- MessageManager.getString("label.overwrite_existing_file"),
- MessageManager.getString("label.file_already_exists"),
- JvOptionPane.YES_NO_OPTION);
+ int confirm = Cache.getDefault("CONFIRM_OVERWRITE_FILE", true)
+ ? JvOptionPane.showConfirmDialog(this,
+ MessageManager
+ .getString("label.overwrite_existing_file"),
+ MessageManager.getString("label.file_already_exists"),
+ JvOptionPane.YES_NO_OPTION)
+ : JOptionPane.YES_OPTION;
if (confirm != JvOptionPane.YES_OPTION)
{
}
+ /*
+ @Override
+ public JalviewFileChooser setResponseHandler(Object response,
+ Runnable action)
+ {
+ callbacks.put(response, new Callable<Void>()
+ {
+ @Override
+ public Void call()
+ {
+ action.run();
+ return null;
+ }
+ });
+ return this;
+ }
+ */
+
@Override
public DialogRunnerI setResponseHandler(Object response, Runnable action)
{
Runnable action = callbacks.get(response);
if (action != null)
{
- action.run();
+ try
+ {
+ action.run();
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
}