use of net.sourceforge.processdash.ui.lib.ErrorReporter in project processdash by dtuma.
the class BrokenDataFileHandler method showMissingDataFileWarnings.
public void showMissingDataFileWarnings() {
// no missing data files? Great! Do nothing and return.
if (missingDataFiles.isEmpty())
return;
// prepare to display an error dialog.
ProcessDashboard.dropSplashScreen();
Resources resources = Resources.getDashBundle("ProcessDashboard.Errors");
// find the errors which can be attributed to missing MCFs.
Map<String, String> warnings = new HashMap(missingDataFiles);
Map<String, List<String>> mcfProjects = findMissingMcfProjects(warnings);
// If they are missing one of the standard MCFs, print a message
// telling them to download and run the dashboard installer.
showMcfWarning(resources, "Missing_MCF.TSP_Footer", "TSP", mcfProjects.remove("TSP"), DOWNLOAD_URL);
showMcfWarning(resources, "Missing_MCF.TSP_Footer", "PDSSD", mcfProjects.remove("PDSSD"), DOWNLOAD_URL);
// If they are missing a custom MCF, print a message telling them
// to obtain it from their team leader and install it.
String resKey = CompressedInstanceLauncher.isRunningFromCompressedData() ? "Missing_MCF.Custom_Footer_Zip_FMT" : "Missing_MCF.Custom_Footer_FMT";
for (Map.Entry<String, List<String>> e : mcfProjects.entrySet()) showMcfWarning(resources, resKey, e.getKey(), e.getValue(), SHARE_MCF_URL);
// if any other files are missing, display a more generic error.
ErrorReporter errorReporter = new ErrorReporter(resources.getString("Broken_Data_Title"), resources.getStrings("Broken_Data_Header"), resources.getStrings("Broken_Data_Footer"));
for (String dataPrefix : warnings.keySet()) errorReporter.logError(dataPrefix);
errorReporter.done();
}
use of net.sourceforge.processdash.ui.lib.ErrorReporter in project processdash by dtuma.
the class TaskScheduleDialog method displayErrorDialog.
protected void displayErrorDialog(Map errors) {
if (errors == null || errors.size() == 0)
return;
String[] footer = EVMetrics.isWarningOnly(errors) ? null : resources.getStrings("Error_Dialog.Foot");
ErrorReporter err = new ErrorReporter(resources.getString("Error_Dialog.Title"), resources.getStrings("Error_Dialog.Head"), footer);
Iterator i = errors.keySet().iterator();
while (i.hasNext()) {
err.logError(//
StringUtils.findAndReplace(//
(String) i.next(), "\n#", "\n#http://ignored/"));
}
err.setHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
String url = e.getURL().getFile();
int pos = url.lastIndexOf('/');
String helpSet = url.substring(0, pos);
String topic = url.substring(pos + 1);
String helpUri = helpSet + "/frame.html?" + topic;
Browser.launch(helpUri);
}
}
});
err.done();
}
use of net.sourceforge.processdash.ui.lib.ErrorReporter in project processdash by dtuma.
the class TemplateLoader method logTemplateError.
public static synchronized void logTemplateError(String error) {
if (errorReporter == null) {
Resources r = Resources.getDashBundle("Templates");
errorReporter = new ErrorReporter(r.getString("Error_Title"), r.getStrings("Error_Header"), r.getStrings("Error_Footer"));
}
errorReporter.logError(error);
}
Aggregations