mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 02:09:35 +02:00
synchronization with library-service branch
This commit is contained in:
parent
d0e1411ce5
commit
a11a63b3ea
3 changed files with 14 additions and 3 deletions
|
@ -23,10 +23,14 @@ import org.geometerplus.zlibrary.core.resources.ZLResource;
|
|||
import org.geometerplus.zlibrary.core.filesystem.ZLFile;
|
||||
|
||||
import org.geometerplus.fbreader.Paths;
|
||||
import org.geometerplus.fbreader.book.IBookCollection;
|
||||
|
||||
public class FileFirstLevelTree extends FirstLevelTree {
|
||||
FileFirstLevelTree(RootTree root, String id) {
|
||||
private final IBookCollection myCollection;
|
||||
|
||||
FileFirstLevelTree(IBookCollection collection, RootTree root, String id) {
|
||||
super(root, id);
|
||||
myCollection = collection;
|
||||
addChild(Paths.BooksDirectoryOption().getValue(), "fileTreeLibrary");
|
||||
addChild("/", "fileTreeRoot");
|
||||
addChild(Paths.cardDirectory(), "fileTreeCard");
|
||||
|
@ -38,6 +42,7 @@ public class FileFirstLevelTree extends FirstLevelTree {
|
|||
final ZLResource resource = Library.resource().getResource(resourceKey);
|
||||
new FileTree(
|
||||
this,
|
||||
myCollection,
|
||||
file,
|
||||
resource.getValue(),
|
||||
resource.getResource("summary").getValue()
|
||||
|
|
|
@ -24,17 +24,20 @@ import java.util.*;
|
|||
import org.geometerplus.zlibrary.core.filesystem.ZLFile;
|
||||
import org.geometerplus.zlibrary.core.image.ZLImage;
|
||||
|
||||
import org.geometerplus.fbreader.book.*;
|
||||
import org.geometerplus.fbreader.formats.PluginCollection;
|
||||
import org.geometerplus.fbreader.tree.FBTree;
|
||||
|
||||
public class FileTree extends LibraryTree {
|
||||
private final IBookCollection myCollection;
|
||||
private final ZLFile myFile;
|
||||
private final String myName;
|
||||
private final String mySummary;
|
||||
private final boolean myIsSelectable;
|
||||
|
||||
FileTree(LibraryTree parent, ZLFile file, String name, String summary) {
|
||||
FileTree(LibraryTree parent, IBookCollection collection, ZLFile file, String name, String summary) {
|
||||
super(parent);
|
||||
myCollection = collection;
|
||||
myFile = file;
|
||||
myName = name;
|
||||
mySummary = summary;
|
||||
|
@ -43,6 +46,7 @@ public class FileTree extends LibraryTree {
|
|||
|
||||
public FileTree(FileTree parent, ZLFile file) {
|
||||
super(parent);
|
||||
myCollection = parent.myCollection;
|
||||
myFile = file;
|
||||
myName = null;
|
||||
mySummary = null;
|
||||
|
|
|
@ -87,6 +87,7 @@ public final class Library {
|
|||
}
|
||||
}
|
||||
|
||||
public final IBookCollection Collection;
|
||||
private final BooksDatabase myDatabase;
|
||||
|
||||
private final Map<ZLFile,Book> myBooks =
|
||||
|
@ -109,6 +110,7 @@ public final class Library {
|
|||
}
|
||||
|
||||
public Library(BooksDatabase db) {
|
||||
Collection = null;
|
||||
myDatabase = db;
|
||||
|
||||
new FavoritesTree(myRootTree, ROOT_FAVORITES);
|
||||
|
@ -116,7 +118,7 @@ public final class Library {
|
|||
new FirstLevelTree(myRootTree, ROOT_BY_AUTHOR);
|
||||
new FirstLevelTree(myRootTree, ROOT_BY_TITLE);
|
||||
new FirstLevelTree(myRootTree, ROOT_BY_TAG);
|
||||
new FileFirstLevelTree(myRootTree, ROOT_FILE_TREE);
|
||||
new FileFirstLevelTree(Collection, myRootTree, ROOT_FILE_TREE);
|
||||
}
|
||||
|
||||
public LibraryTree getRootTree() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue