Search in sources :

Example 1 with ErrorReporter

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();
}
Also used : ErrorReporter(net.sourceforge.processdash.ui.lib.ErrorReporter) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) JList(javax.swing.JList) List(java.util.List) Resources(net.sourceforge.processdash.i18n.Resources) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with ErrorReporter

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();
}
Also used : ErrorReporter(net.sourceforge.processdash.ui.lib.ErrorReporter) HyperlinkEvent(javax.swing.event.HyperlinkEvent) HyperlinkListener(javax.swing.event.HyperlinkListener) Iterator(java.util.Iterator)

Example 3 with ErrorReporter

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);
}
Also used : ErrorReporter(net.sourceforge.processdash.ui.lib.ErrorReporter) Resources(net.sourceforge.processdash.i18n.Resources)

Aggregations

ErrorReporter (net.sourceforge.processdash.ui.lib.ErrorReporter)3 Resources (net.sourceforge.processdash.i18n.Resources)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 JList (javax.swing.JList)1 HyperlinkEvent (javax.swing.event.HyperlinkEvent)1 HyperlinkListener (javax.swing.event.HyperlinkListener)1