mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
autosorting for AuthorTree's
This commit is contained in:
parent
05365b01d1
commit
31075d08a0
3 changed files with 19 additions and 13 deletions
|
@ -22,8 +22,12 @@ package org.geometerplus.fbreader.library;
|
|||
public class AuthorTree extends LibraryTree {
|
||||
public final Author Author;
|
||||
|
||||
AuthorTree(LibraryTree parent, Author author) {
|
||||
super(parent);
|
||||
AuthorTree(Author author) {
|
||||
Author = author;
|
||||
}
|
||||
|
||||
AuthorTree(LibraryTree parent, Author author, int position) {
|
||||
super(parent, position);
|
||||
Author = author;
|
||||
}
|
||||
|
||||
|
@ -34,18 +38,19 @@ public class AuthorTree extends LibraryTree {
|
|||
@Override
|
||||
public String getName() {
|
||||
return
|
||||
(Author != null) ?
|
||||
Author != null ?
|
||||
Author.DisplayName :
|
||||
Library.resource().getResource("unknownAuthor").getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getStringId() {
|
||||
return getName();
|
||||
return getName() + ":" + getSortKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getSortKey() {
|
||||
return (Author != null) ? Author.SortKey : null;
|
||||
return Author != null ? Author.SortKey : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue