label.example_param = Example: {0}
label.select_file_format_before_saving = You must select a file format before saving!
label.file_format_not_specified = File format not specified
-label.couldnt_save_file = Couldn't save file: {0}
+label.couldnt_save_file = Couldn''t save file: {0}
label.error_saving_file = Error Saving File
label.remove_from_default_list = Remove from default list?
label.remove_user_defined_colour = Remove user defined colour
label.backupfiles_confirm_save_file_backupfiles_roll_wrong = Something possibly went wrong with the backups of this file.
label.backupfiles_confirm_save_new_saved_file_ok = The new saved file seems okay.
label.backupfiles_confirm_save_new_saved_file_not_ok = The new saved file might not be okay.
+label.continue_operation = Continue operation?
label.backups = Backups
label.backup = Backup
label.backup_files = Backup Files
label.backupfiles_confirm_save_file_backupfiles_roll_wrong = Posiblemente algo está mal con los archivos de respaldos.
label.backupfiles_confirm_save_new_saved_file_ok = El nuevo archivo guardado parece estar bien.
label.backupfiles_confirm_save_new_saved_file_not_ok = El nuevo archivo guardado podría no estar bien.
+label.continue_operation = ¿Continuar operación?
label.backups = Respaldos
label.backup = Respaldo
label.backup_files = Archivos de respaldos
*/
package jalview.bin;
-import jalview.datamodel.PDBEntry;
-import jalview.gui.UserDefinedColours;
-import jalview.schemes.ColourSchemeLoader;
-import jalview.schemes.ColourSchemes;
-import jalview.schemes.UserColourScheme;
-import jalview.structure.StructureImportSettings;
-import jalview.urls.IdOrgSettings;
-import jalview.util.ColorUtils;
-import jalview.ws.sifts.SiftsSettings;
-
import java.awt.Color;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Collections;
import org.apache.log4j.Logger;
import org.apache.log4j.SimpleLayout;
+import jalview.datamodel.PDBEntry;
+import jalview.gui.UserDefinedColours;
+import jalview.schemes.ColourSchemeLoader;
+import jalview.schemes.ColourSchemes;
+import jalview.schemes.UserColourScheme;
+import jalview.structure.StructureImportSettings;
+import jalview.urls.IdOrgSettings;
+import jalview.util.ColorUtils;
+import jalview.ws.sifts.SiftsSettings;
+
/**
* Stores and retrieves Jalview Application Properties Lists and fields within
* list entries are separated by '|' symbols unless otherwise stated (|) clauses
String jnlpVersion = System.getProperty("jalview.version");
- // jnlpVersion will be null if a latest version check for the channel needs to
- // be done
+ // jnlpVersion will be null if a latest version check for the channel needs
+ // to be done
// Dont do this check if running in headless mode
if (jnlpVersion == null && getDefault("VERSION_CHECK", true)
new BuildDetails(codeVersion, null, codeInstallation);
if (printV && reportVersion)
{
- System.out
- .println("Jalview Version: " + codeVersion + codeInstallation);
+ System.out.println(
+ "Jalview Version: " + codeVersion + codeInstallation);
}
}
public static String getVersionDetailsForConsole()
{
StringBuilder sb = new StringBuilder();
- sb.append("Jalview Version: " + jalview.bin.Cache.getDefault("VERSION", "TEST"));
+ sb.append("Jalview Version: "
+ + jalview.bin.Cache.getDefault("VERSION", "TEST"));
sb.append("\n");
sb.append("Jalview Installation: "
+ jalview.bin.Cache.getDefault("INSTALLATION", "unknown"));
sb.append("\n");
- sb.append("Build Date: " + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"));
+ sb.append("Build Date: "
+ + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"));
sb.append("\n");
sb.append("Java version: " + System.getProperty("java.version"));
sb.append("\n");
- sb.append(System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
+ sb.append(System.getProperty("os.arch") + " "
+ + System.getProperty("os.name") + " "
+ + System.getProperty("os.version"));
sb.append("\n");
appendIfNotNull(sb, "Install4j version: ",
System.getProperty("sys.install4jVersion"), "\n", null);
System.getProperty("installer_template_version"), "\n", null);
appendIfNotNull(sb, "Launcher version: ",
System.getProperty("launcher_version"), "\n", null);
- if (jalview.bin.Cache.getDefault("VERSION", "TEST").equals("DEVELOPMENT")) {
+ if (jalview.bin.Cache.getDefault("VERSION", "TEST")
+ .equals("DEVELOPMENT"))
+ {
appendIfNotNull(sb, "Getdown appdir: ",
System.getProperty("getdownappdir"), "\n", null);
appendIfNotNull(sb, "Java home: ", System.getProperty("java.home"),
// eg 'built from Source' or update channel
return jalview.bin.Cache.getDefault("INSTALLATION", "unknown");
}
+
+ public static String getStackTraceString(Throwable t)
+ {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ t.printStackTrace(pw);
+ return sw.toString();
+ }
}
statusBar.setText(MessageManager.formatMessage(
"label.successfully_saved_to_file_in_format", new Object[]
- { fileName, format }));
+ { file, format }));
}
else
try
{
- Cache.log.debug("ALIGNFRAME setting PrintWriter");
- PrintWriter out = new PrintWriter(
- new FileWriter(backupfiles.getTempFilePath()));
+ String tempFilePath = backupfiles.getTempFilePath();
+ Cache.log.debug(
+ "ALIGNFRAME setting PrintWriter to " + tempFilePath);
+ PrintWriter out = new PrintWriter(new FileWriter(tempFilePath));
- Cache.log.debug("ALIGNFRAME about to write to temp file "
- + backupfiles.getTempFilePath());
+ Cache.log.debug(
+ "ALIGNFRAME about to write to temp file " + tempFilePath);
out.print(output);
Cache.log.debug("ALIGNFRAME about to close file");
this.setTitle(file);
statusBar.setText(MessageManager.formatMessage(
"label.successfully_saved_to_file_in_format", new Object[]
- { fileName, format.getName() }));
+ { file, format.getName() }));
} catch (IOException e)
{
success = false;
Cache.log.error(
"ALIGNFRAME Something happened writing the temp file");
Cache.log.error(e.getMessage());
- Cache.log.debug(e.getStackTrace());
+ Cache.log.debug(Cache.getStackTraceString(e));
} catch (Exception ex)
{
Cache.log.error(
"ALIGNFRAME Something else happened writing the temp file");
Cache.log.error(ex.getMessage());
- Cache.log.debug(ex.getStackTrace());
+ Cache.log.debug(Cache.getStackTraceString(ex));
}
backupfiles.setWriteSuccess(success);
{
JvOptionPane.showInternalMessageDialog(this, MessageManager
.formatMessage("label.couldnt_save_file", new Object[]
- { fileName }),
+ { file }),
MessageManager.getString("label.error_saving_file"),
JvOptionPane.WARNING_MESSAGE);
}
Cache.log
.error("Could not create temp file to save to (IOException)");
Cache.log.error(e.getMessage());
- Cache.log.debug(e.getStackTrace());
+ Cache.log.debug(Cache.getStackTraceString(e));
} catch (Exception e)
{
Cache.log.error("Exception ctreating temp file for saving");
- Cache.log.debug(e.getStackTrace());
+ Cache.log.debug(Cache.getStackTraceString(e));
}
this.setTempFile(temp);
}
Cache.log.error(
"IOException when getting Canonical Path of temp file '"
+ this.getTempFile().getName() + "'");
- Cache.log.debug(e.getStackTrace());
+ Cache.log.debug(Cache.getStackTraceString(e));
}
return path;
}
Cache.log.error(
"Could not get canonical path for file '" + file + "'");
Cache.log.error(e.getMessage());
- Cache.log.debug(e.getStackTrace());
+ Cache.log.debug(Cache.getStackTraceString(e));
return false;
}
String filename = file.getName();
Cache.log.error(
"Error occurred, probably making new temp file for '"
+ fileToBeDeleted.getName() + "'");
- Cache.log.error(e.getStackTrace());
+ Cache.log.error(Cache.getStackTraceString(e));
}
// reset
boolean okay = roll && rename;
if (!okay)
{
- boolean yesno = false;
StringBuilder messageSB = new StringBuilder();
messageSB.append(MessageManager.getString(
"label.backupfiles_confirm_save_file_backupfiles_roll_wrong"));
"label.backupfiles_confirm_save_new_saved_file_not_ok"));
// "The new saved file might not be okay."
}
+ if (messageSB.length() > 0)
+ {
+ messageSB.append("\n");
+ }
+ messageSB
+ .append(MessageManager.getString("label.continue_operation"));
int confirmButton = Platform.isHeadless() ? JvOptionPane.OK_OPTION
: JvOptionPane.showConfirmDialog(Desktop.desktop,
Cache.log.warn("Could not move file '" + oldPath.toString() + "' to '"
+ newPath.toString() + "'");
Cache.log.error(e.getMessage());
- Cache.log.debug(e.getStackTrace());
+ Cache.log.debug(Cache.getStackTraceString(e));
ret = false;
} catch (Exception e)
{
Cache.log.error(e.getMessage());
- Cache.log.debug(e.getStackTrace());
+ Cache.log.debug(Cache.getStackTraceString(e));
ret = false;
}
return ret;