From af1013959f6ab36ed9f2ff603c08116ee1b55c57 Mon Sep 17 00:00:00 2001 From: Matt Windsor Date: Mon, 21 Feb 2011 23:01:01 +0000 Subject: LibraryViewer etc.: User interface refinements including feedback when no results are matched or an empty string is provided. --- .../library/exceptions/EmptySearchException.java | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/uk/org/ury/library/exceptions/EmptySearchException.java (limited to 'src/uk/org/ury/library/exceptions') diff --git a/src/uk/org/ury/library/exceptions/EmptySearchException.java b/src/uk/org/ury/library/exceptions/EmptySearchException.java new file mode 100644 index 0000000..9b4691f --- /dev/null +++ b/src/uk/org/ury/library/exceptions/EmptySearchException.java @@ -0,0 +1,49 @@ +/** + * + */ +package uk.org.ury.library.exceptions; + +/** + * Exception thrown when a library search is initiated + * in which the query string is null. + * + * Frontends should handle this nicely. Do NOT treat this + * as a fatal error! + * + * @author Matt Windsor + */ + +public class EmptySearchException extends Exception +{ + + /** + * Change this! ---v + */ + + private static final long serialVersionUID = -397479334359858162L; + + + /** + * Construct a new EmptySearchException with a + * default reason. + */ + + public + EmptySearchException () + { + super ("Query string was empty."); + } + + + /** + * Construct a new EmptySearchException. + * + * @param reason The explanation for the exception. + */ + + public + EmptySearchException (String reason) + { + super (reason); + } +} -- cgit v1.2.3