1 19 package org.java.plugin.boot; 20 21 import java.util.Iterator ; 22 import java.util.LinkedList ; 23 import java.util.List ; 24 25 import org.java.plugin.registry.IntegrityCheckReport; 26 import org.java.plugin.registry.IntegrityCheckReport.ReportItem; 27 import org.java.plugin.util.ResourceManager; 28 29 35 public class BootErrorHandlerGui implements BootErrorHandler { 36 40 public void handleFatalError(String message) { 41 ErrorDialog.showError(null, 42 ResourceManager.getMessage(Boot.PACKAGE_NAME, 43 "errorDialogueHeaderFatal"), message); } 45 46 50 public void handleFatalError(String message, Throwable t) { 51 ErrorDialog.showError(null, 52 ResourceManager.getMessage(Boot.PACKAGE_NAME, 53 "errorDialogueHeaderFatal"), message, t); } 55 56 60 public boolean handleError(String message, Exception e) { 61 return ErrorDialog.showWarning(null, ResourceManager.getMessage( 62 Boot.PACKAGE_NAME, "errorDialogueHeaderNonFatal"), message, e); } 64 65 69 public boolean handleError(String message, IntegrityCheckReport report) { 70 List items = new LinkedList (); 71 for (Iterator it = report.getItems().iterator(); it.hasNext();) { 72 IntegrityCheckReport.ReportItem item = 73 (IntegrityCheckReport.ReportItem) it.next(); 74 if (item.getSeverity() != ReportItem.SEVERITY_ERROR) { 75 continue; 76 } 77 items.add(item.getMessage()); 78 } 79 return ErrorDialog.showWarning(null, ResourceManager.getMessage( 81 Boot.PACKAGE_NAME, "errorDialogueHeaderNonFatal"), message, items); 83 } 84 } 85 | Popular Tags |