* @return true if the file does not yet exist or if the user confirmed
* overwriting it, false if the file should not be written
*/
protected boolean canWrite(Component component, File file) {
if (file.exists()) {
ApplicationResources resources = ApplicationResources.getInstance();
String message = resources.getString("dialog.replacefile.confirm.msg");
message = MessageFormat.format(message, file.getName());
String title = resources.getString("dialog.replacefile.confirm.title");
return JOptionPane.showConfirmDialog(component, message, title,
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
}
return true;
}