/* * ExceptionController.java * * Created on 3.2.2009 * */ package netukar.tinybrowser.controller.exceptions; import java.net.MalformedURLException; import javax.swing.JOptionPane; import netukar.tinybrowser.Application; import netukar.tinybrowser.exceptions.RequestSyntaxException; import netukar.tinybrowser.exceptions.SavingFailedException; /** * * @author Radovan Netuka */ public class ExceptionController { private static final ExceptionController instance = new ExceptionController(); /** * Creates a new instance of ExceptionController. */ private ExceptionController() { } public static ExceptionController getInstance() { return instance; } public void report(MalformedURLException ex) { JOptionPane.showMessageDialog( Application.getMainWindow(), "Invalid URL entered", "Invalid URL!", JOptionPane.ERROR_MESSAGE); } public void report(RequestSyntaxException ex) { JOptionPane.showMessageDialog( Application.getMainWindow(), "Invalid request syntax", "Invalid Request!", JOptionPane.ERROR_MESSAGE); } public static void report(SavingFailedException ex) { JOptionPane.showMessageDialog( Application.getMainWindow(), "Cannot save file", "Saving Failed!", JOptionPane.ERROR_MESSAGE); } }