[jsword-svn] r1242 - in trunk/incubator/org.crosswire.jsword/src/org/crosswire/jsword: book internal/osgi
Apache
apache at www.crosswire.org
Sun Jan 14 14:19:01 MST 2007
Author:
Date: 2007-01-14 14:18:59 -0700 (Sun, 14 Jan 2007)
New Revision: 1242
Modified:
trunk/incubator/org.crosswire.jsword/src/org/crosswire/jsword/book/BookFilters.java
trunk/incubator/org.crosswire.jsword/src/org/crosswire/jsword/internal/osgi/FilterRegistry.java
Log:
[PRB] - Added "not" method to BookFilters; Filter lookup now forces input to lower case.
Modified: trunk/incubator/org.crosswire.jsword/src/org/crosswire/jsword/book/BookFilters.java
===================================================================
--- trunk/incubator/org.crosswire.jsword/src/org/crosswire/jsword/book/BookFilters.java 2007-01-07 23:02:48 UTC (rev 1241)
+++ trunk/incubator/org.crosswire.jsword/src/org/crosswire/jsword/book/BookFilters.java 2007-01-14 21:18:59 UTC (rev 1242)
@@ -113,8 +113,7 @@
public boolean test(Book book)
{
BookCategory category = book.getBookCategory();
- return (category.equals(BookCategory.DICTIONARY) || category.equals(BookCategory.GLOSSARY))
- && !book.isLocked();
+ return (category.equals(BookCategory.DICTIONARY) || category.equals(BookCategory.GLOSSARY)) && !book.isLocked();
}
}
@@ -267,6 +266,17 @@
}
}
+ public static BookFilter not(final BookFilter filter)
+ {
+ return new BookFilter()
+ {
+ public boolean test(Book book)
+ {
+ return !filter.test(book);
+ }
+ };
+ }
+
/**
* A filter that accepts Books that match two criteria.
*/
Modified: trunk/incubator/org.crosswire.jsword/src/org/crosswire/jsword/internal/osgi/FilterRegistry.java
===================================================================
--- trunk/incubator/org.crosswire.jsword/src/org/crosswire/jsword/internal/osgi/FilterRegistry.java 2007-01-07 23:02:48 UTC (rev 1241)
+++ trunk/incubator/org.crosswire.jsword/src/org/crosswire/jsword/internal/osgi/FilterRegistry.java 2007-01-14 21:18:59 UTC (rev 1242)
@@ -70,7 +70,7 @@
*/
public static Filter getFilterById(String filterId)
{
- return (Filter) ServiceUtil.getServiceById(Filter.class, ID_FILTER, filterId);
+ return (Filter) ServiceUtil.getServiceById(Filter.class, ID_FILTER, filterId.toLowerCase());
}
/**
More information about the jsword-svn
mailing list