1 package be
.nikiroo
.fanfix_swing
.gui
.browser
;
3 import java
.util
.ArrayList
;
6 import javax
.swing
.tree
.DefaultMutableTreeNode
;
8 import be
.nikiroo
.fanfix
.Instance
;
9 import be
.nikiroo
.fanfix
.bundles
.StringIdGui
;
11 public class AuthorTab
extends BasicTab
<List
<String
>> {
12 public AuthorTab(int index
, String listenerCommand
) {
13 super(index
, listenerCommand
);
17 protected List
<String
> createEmptyData() {
18 return new ArrayList
<String
>();
22 protected void fillData(List
<String
> data
) {
24 List
<String
> authors
= Instance
.getInstance().getLibrary().getAuthors();
25 for (String author
: authors
) {
28 } catch (Exception e
) {
35 protected String
keyToElement(String key
) {
40 protected String
keyToDisplay(String key
) {
41 if (key
.trim().isEmpty()) {
42 key
= Instance
.getInstance().getTransGui().getString(StringIdGui
.MENU_AUTHORS_UNKNOWN
);
49 protected int loadData(DefaultMutableTreeNode root
, List
<String
> authors
, String filter
) {
50 for (String author
: authors
) {
51 if (checkFilter(filter
, author
)) {
52 DefaultMutableTreeNode sourceNode
= new DefaultMutableTreeNode(author
);
57 return authors
.size();