1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 10:49:24 +02:00

AuthorListTree

This commit is contained in:
Nikolay Pultsin 2013-02-08 09:04:41 +00:00
parent 5f9822ba5f
commit e4912a2beb
4 changed files with 117 additions and 1 deletions

View file

@ -142,6 +142,30 @@ public abstract class LibraryTree extends FBTree {
return !toRemove.isEmpty();
}
public boolean onBookEvent(BookEvent event, Book book) {
switch (event) {
default:
case Added:
return false;
case Removed:
return removeBook(book, true);
case Updated:
{
boolean changed = false;
for (FBTree tree : this) {
if (tree instanceof BookTree) {
final Book b = ((BookTree)tree).Book;
if (b.equals(book)) {
b.updateFrom(book);
changed = true;
}
}
}
return changed;
}
}
}
@Override
public int compareTo(FBTree tree) {
final int cmp = super.compareTo(tree);