DataTree changes
authorNiki Roo <niki@nikiroo.be>
Mon, 27 Apr 2020 15:41:50 +0000 (17:41 +0200)
committerNiki Roo <niki@nikiroo.be>
Mon, 27 Apr 2020 15:41:50 +0000 (17:41 +0200)
src/be/nikiroo/fanfix_swing/gui/BreadCrumbsPanel.java
src/be/nikiroo/fanfix_swing/gui/BrowserPanel.java
src/be/nikiroo/fanfix_swing/gui/BrowserTab.java
src/be/nikiroo/fanfix_swing/gui/utils/DataTreeAuthors.java [deleted file]
src/be/nikiroo/fanfix_swing/gui/utils/DataTreeBooks.java [new file with mode: 0644]
src/be/nikiroo/fanfix_swing/gui/utils/DataTreeSources.java [deleted file]
src/be/nikiroo/fanfix_swing/gui/utils/DataTreeTag.java [deleted file]

index 4502e8d01d185c86d70b665e8a53aa0b35a45802..4e2d63c88449fe38f6bf2d277b40e2c049569e7c 100644 (file)
@@ -1,17 +1,12 @@
 package be.nikiroo.fanfix_swing.gui;
 
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
 
 import be.nikiroo.fanfix.Instance;
 import be.nikiroo.fanfix.library.BasicLibrary;
 import be.nikiroo.fanfix_swing.gui.book.BookInfo;
-import be.nikiroo.fanfix_swing.gui.book.BookInfo.Type;
 import be.nikiroo.fanfix_swing.gui.utils.DataNodeBook;
-import be.nikiroo.fanfix_swing.gui.utils.DataTreeAuthors;
-import be.nikiroo.fanfix_swing.gui.utils.DataTreeSources;
-import be.nikiroo.fanfix_swing.gui.utils.DataTreeTag;
+import be.nikiroo.fanfix_swing.gui.utils.DataTreeBooks;
 import be.nikiroo.utils.ui.BreadCrumbsBar;
 import be.nikiroo.utils.ui.DataNode;
 import be.nikiroo.utils.ui.DataTree;
@@ -19,32 +14,18 @@ import be.nikiroo.utils.ui.DataTree;
 public class BreadCrumbsPanel extends BreadCrumbsBar<DataNodeBook> {
        public BreadCrumbsPanel() {
                super(new DataTree<DataNodeBook>() {
+                       private DataTreeBooks dataTreeBooks = new DataTreeBooks(false,
+                                       false, false);
+
                        @Override
                        protected DataNode<DataNodeBook> extractData() throws IOException {
-                               List<? extends DataNode<DataNodeBook>> children = null;
-
-                               children = new DataTreeSources(false).loadData().getChildren();
-                               DataNode<DataNodeBook> sources = new DataNode<DataNodeBook>(
-                                               children, new DataNodeBook(Type.SOURCE, "Sources", true,
-                                                               !children.isEmpty()));
-                               children = new DataTreeAuthors(false).loadData().getChildren();
-                               DataNode<DataNodeBook> authors = new DataNode<DataNodeBook>(
-                                               children, new DataNodeBook(Type.AUTHOR, "Authors", true,
-                                                               !children.isEmpty()));
-                               children = new DataTreeTag(false).loadData().getChildren();
-                               DataNode<DataNodeBook> tags = new DataNode<DataNodeBook>(
-                                               children, new DataNodeBook(Type.TAG, "Tags", true,
-                                                               !children.isEmpty()));
-
-                               return new DataNode<DataNodeBook>(
-                                               Arrays.asList(sources, authors, tags),
-                                               new DataNodeBook(null, false));
+                               return dataTreeBooks.loadData();
                        }
 
                        @Override
                        protected boolean checkFilter(String filter,
                                        DataNodeBook userData) {
-                               return userData.toString().contains(filter.toLowerCase());
+                               return dataTreeBooks.checkFilter(filter, userData);
                        }
                });
        }
index 12840f526441adf3ba49683c5a298e420a068ad9..2e48398b470e01a9bb76ad1b89d975f0bc160921 100644 (file)
@@ -10,15 +10,14 @@ import java.util.List;
 import javax.swing.JButton;
 import javax.swing.JPanel;
 import javax.swing.JTabbedPane;
+import javax.swing.SwingWorker;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
 import be.nikiroo.fanfix.Instance;
 import be.nikiroo.fanfix.library.BasicLibrary;
 import be.nikiroo.fanfix_swing.gui.book.BookInfo;
-import be.nikiroo.fanfix_swing.gui.utils.DataTreeAuthors;
-import be.nikiroo.fanfix_swing.gui.utils.DataTreeSources;
-import be.nikiroo.fanfix_swing.gui.utils.DataTreeTag;
+import be.nikiroo.fanfix_swing.gui.utils.DataTreeBooks;
 import be.nikiroo.fanfix_swing.gui.utils.UiHelper;
 import be.nikiroo.utils.ui.ListenerPanel;
 
@@ -60,6 +59,8 @@ public class BrowserPanel extends ListenerPanel {
         */
        static public final String TAB_CHANGE = "tab_change";
 
+       private DataTreeBooks dataTreeBooks;
+
        private JTabbedPane tabs;
        private BrowserTab sourceTab;
        private BrowserTab authorTab;
@@ -77,11 +78,12 @@ public class BrowserPanel extends ListenerPanel {
                tabs = new JTabbedPane();
 
                int index = 0;
-               tabs.add(sourceTab = new BrowserTab(new DataTreeSources(false), index++,
+               dataTreeBooks = new DataTreeBooks(false, true, true);
+               tabs.add(sourceTab = new BrowserTab(dataTreeBooks.getSources(), index++,
                                SOURCE_SELECTION));
-               tabs.add(authorTab = new BrowserTab(new DataTreeAuthors(true), index++,
+               tabs.add(authorTab = new BrowserTab(dataTreeBooks.getAuthors(), index++,
                                AUTHOR_SELECTION));
-               tabs.add(tagsTab = new BrowserTab(new DataTreeTag(true), index++,
+               tabs.add(tagsTab = new BrowserTab(dataTreeBooks.getTags(), index++,
                                TAGS_SELECTION));
 
                configureTab(tabs, sourceTab, "Sources", "Tooltip for Sources");
@@ -120,6 +122,8 @@ public class BrowserPanel extends ListenerPanel {
                                fireActionPerformed(TAB_CHANGE);
                        }
                });
+
+               reloadData(true);
        }
 
        private void unselect() {
@@ -215,8 +219,24 @@ public class BrowserPanel extends ListenerPanel {
         * Reload all the data from the 3 tabs (without firing an action).
         */
        public void reloadData() {
-               sourceTab.reloadData();
-               authorTab.reloadData();
-               tagsTab.reloadData();
+               reloadData(false);
+       }
+
+       public void reloadData(final boolean fireActionPerformed) {
+               new SwingWorker<Void, Void>() {
+                       @Override
+                       protected Void doInBackground() throws Exception {
+                               dataTreeBooks.loadData();
+                               return null;
+                       }
+
+                       @Override
+                       protected void done() {
+                               sourceTab.filter(fireActionPerformed);
+                               authorTab.filter(fireActionPerformed);
+                               tagsTab.filter(fireActionPerformed);
+
+                       }
+               }.execute();
        }
 }
index 243402b40065ab3b083c174d6410933077c5db7f..c923b6a6546486ff25739d6e7c9873bbd52bc6b1 100644 (file)
@@ -5,9 +5,11 @@ import java.awt.Component;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 import javax.swing.JTree;
+import javax.swing.SwingUtilities;
 import javax.swing.SwingWorker;
 import javax.swing.event.TreeSelectionEvent;
 import javax.swing.event.TreeSelectionListener;
@@ -95,19 +97,12 @@ public class BrowserTab extends ListenerPanel {
                searchBar.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
-                               reloadData(true);
+                               filter(true);
                        }
                });
-
-               reloadData(true);
-       }
-
-       // does NOT send a change event
-       public void reloadData() {
-               reloadData(false);
        }
 
-       private void reloadData(final boolean fireActionPerformed) {
+       public void filter(final boolean fireActionPerformed) {
                final TreeSnapshot snapshot = new TreeSnapshot(tree) {
                        @Override
                        protected boolean isSamePath(TreePath oldPath, TreePath newPath) {
@@ -124,37 +119,19 @@ public class BrowserTab extends ListenerPanel {
                                return oldString.equals(newString);
                        }
                };
-               SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
-                       @Override
-                       protected Void doInBackground() throws Exception {
-                               data.loadData();
-                               return null;
-                       }
-
-                       @Override
-                       protected void done() {
-                               try {
-                                       get();
 
-                                       DataNode<DataNodeBook> filtered = data
-                                                       .getRoot(searchBar.getText());
+               DataNode<DataNodeBook> filtered = data.getRoot(searchBar.getText());
 
-                                       node2node(root, filtered);
-                                       totalCount = filtered.count() - 1; // root is counted
+               node2node(root, filtered);
+               totalCount = filtered.count() - 1; // root is counted
 
-                                       ((DefaultTreeModel) tree.getModel()).reload();
+               ((DefaultTreeModel) tree.getModel()).reload();
 
-                                       snapshot.apply();
+               snapshot.apply();
 
-                                       if (fireActionPerformed) {
-                                               fireActionPerformed(listenerCommand);
-                                       }
-                               } catch (Exception e) {
-                                       // TODO: error
-                               }
-                       }
-               };
-               worker.execute();
+               if (fireActionPerformed) {
+                       fireActionPerformed(listenerCommand);
+               }
        }
 
        /**
diff --git a/src/be/nikiroo/fanfix_swing/gui/utils/DataTreeAuthors.java b/src/be/nikiroo/fanfix_swing/gui/utils/DataTreeAuthors.java
deleted file mode 100644 (file)
index a964a8e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-package be.nikiroo.fanfix_swing.gui.utils;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import be.nikiroo.fanfix.Instance;
-import be.nikiroo.fanfix_swing.gui.book.BookInfo.Type;
-import be.nikiroo.utils.ui.DataNode;
-import be.nikiroo.utils.ui.DataTree;
-
-public class DataTreeAuthors extends DataTreeSources {
-       public DataTreeAuthors(boolean flat) {
-               super(flat);
-       }
-
-       @Override
-       protected boolean checkFilter(String filter, DataNodeBook userData) {
-               return userData.getSubnameOrName().toLowerCase()
-                               .contains(filter.toLowerCase());
-       }
-
-       @Override
-       protected DataNode<DataNodeBook> extractData() throws IOException {
-               if (isFlat()) {
-                       return getNodeFlat(
-                                       Instance.getInstance().getLibrary().getList().getAuthors(),
-                                       Type.AUTHOR);
-               }
-
-               Map<String, List<String>> authorsGrouped = Instance.getInstance()
-                               .getLibrary().getList().getAuthorsGrouped();
-
-               if (authorsGrouped.size() == 1) {
-                       List<String> authors = authorsGrouped.values().iterator().next();
-                       return getNodeFlat(authors, Type.AUTHOR);
-               }
-
-               return getNodeGrouped(authorsGrouped, Type.AUTHOR);
-       }
-}
diff --git a/src/be/nikiroo/fanfix_swing/gui/utils/DataTreeBooks.java b/src/be/nikiroo/fanfix_swing/gui/utils/DataTreeBooks.java
new file mode 100644 (file)
index 0000000..ad0c5c3
--- /dev/null
@@ -0,0 +1,238 @@
+package be.nikiroo.fanfix_swing.gui.utils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import be.nikiroo.fanfix.Instance;
+import be.nikiroo.fanfix.library.BasicLibrary;
+import be.nikiroo.fanfix.library.MetaResultList;
+import be.nikiroo.fanfix_swing.gui.book.BookInfo;
+import be.nikiroo.fanfix_swing.gui.book.BookInfo.Type;
+import be.nikiroo.utils.ui.DataNode;
+import be.nikiroo.utils.ui.DataTree;
+
+public class DataTreeBooks {
+       abstract private class DataTreeSort extends DataTree<DataNodeBook> {
+               // make it PUBLIC instead of PROTECTED
+               @Override
+               abstract public boolean checkFilter(String filter,
+                               DataNodeBook userData);
+
+               @Override
+               public void sort(List<String> values) {
+                       super.sort(values);
+               }
+
+               @Override
+               public DataNode<DataNodeBook> loadData() throws IOException {
+                       return loadData(true);
+               }
+
+               public DataNode<DataNodeBook> loadData(boolean reload)
+                               throws IOException {
+                       if (reload) {
+                               reload();
+                       }
+
+                       return data = extractData();
+               }
+
+               abstract public void reload() throws IOException;
+       }
+
+       private DataTreeSort sources;
+       private DataTreeSort authors;
+       private DataTreeSort tags;
+
+       private MetaResultList list;
+
+       // flat = force flat mode (no [A-B] groups)
+       public DataTreeBooks(final boolean flatSources, final boolean flatAuthors,
+                       final boolean flatTags) {
+               list = new MetaResultList(null);
+
+               sources = new DataTreeSort() {
+                       @Override
+                       public boolean checkFilter(String filter, DataNodeBook userData) {
+                               return userData.getName().toLowerCase()
+                                               .contains(filter.toLowerCase())
+                                               || userData.getSubname().toLowerCase()
+                                                               .contains(filter.toLowerCase());
+                       }
+
+                       @Override
+                       protected DataNode<DataNodeBook> extractData() throws IOException {
+                               if (flatSources) {
+                                       return getNodeFlat(list.getSources(), Type.SOURCE);
+                               }
+
+                               Map<String, List<String>> sourcesGrouped = list
+                                               .getSourcesGrouped();
+                               return getNodeGrouped(this, sourcesGrouped, Type.SOURCE);
+                       }
+
+                       @Override
+                       public void reload() throws IOException {
+                               reloadList();
+                       }
+               };
+
+               authors = new DataTreeSort() {
+                       @Override
+                       public boolean checkFilter(String filter, DataNodeBook userData) {
+                               return userData.getSubnameOrName().toLowerCase()
+                                               .contains(filter.toLowerCase());
+                       }
+
+                       @Override
+                       protected DataNode<DataNodeBook> extractData() throws IOException {
+                               if (flatAuthors) {
+                                       return getNodeFlat(list.getAuthors(), Type.AUTHOR);
+                               }
+
+                               Map<String, List<String>> authorsGrouped = list
+                                               .getAuthorsGrouped();
+
+                               if (authorsGrouped.size() == 1) {
+                                       List<String> authors = authorsGrouped.values().iterator()
+                                                       .next();
+                                       return getNodeFlat(authors, Type.AUTHOR);
+                               }
+
+                               return getNodeGrouped(this, authorsGrouped, Type.AUTHOR);
+                       }
+
+                       @Override
+                       public void reload() throws IOException {
+                               reloadList();
+                       }
+               };
+
+               tags = new DataTreeSort() {
+                       @Override
+                       public boolean checkFilter(String filter, DataNodeBook userData) {
+                               return userData.getSubnameOrName().toLowerCase()
+                                               .contains(filter.toLowerCase());
+                       }
+
+                       @Override
+                       protected DataNode<DataNodeBook> extractData() throws IOException {
+                               if (flatTags) {
+                                       return getNodeFlat(list.getTags(), Type.TAG);
+                               }
+
+                               return getNodeGrouped(this, list.getTagsGrouped(), Type.TAG);
+                       }
+
+                       @Override
+                       public void reload() throws IOException {
+                               reloadList();
+                       }
+               };
+       }
+
+       public DataTree<DataNodeBook> getSources() {
+               return sources;
+       }
+
+       public DataTree<DataNodeBook> getAuthors() {
+               return authors;
+       }
+
+       public DataTree<DataNodeBook> getTags() {
+               return tags;
+       }
+
+       public DataNode<DataNodeBook> loadData() throws IOException {
+               reloadList();
+
+               List<? extends DataNode<DataNodeBook>> children = null;
+
+               children = sources.loadData(false).getChildren();
+               DataNode<DataNodeBook> sources = new DataNode<DataNodeBook>(children,
+                               new DataNodeBook(Type.SOURCE, "Sources", true,
+                                               !children.isEmpty()));
+
+               children = authors.loadData(false).getChildren();
+               DataNode<DataNodeBook> authors = new DataNode<DataNodeBook>(children,
+                               new DataNodeBook(Type.AUTHOR, "Authors", true,
+                                               !children.isEmpty()));
+
+               children = tags.loadData(false).getChildren();
+               DataNode<DataNodeBook> tags = new DataNode<DataNodeBook>(children,
+                               new DataNodeBook(Type.TAG, "Tags", true, !children.isEmpty()));
+
+               return new DataNode<DataNodeBook>(Arrays.asList(sources, authors, tags),
+                               new DataNodeBook(null, false));
+       }
+
+       public boolean checkFilter(String filter, DataNodeBook userData) {
+               if (userData.getType() != null) {
+                       switch (userData.getType()) {
+                       case SOURCE:
+                               return sources.checkFilter(filter, userData);
+                       case AUTHOR:
+                               return authors.checkFilter(filter, userData);
+                       case TAG:
+                               return tags.checkFilter(filter, userData);
+                       default:
+                               break;
+                       }
+               }
+
+               return false;
+       }
+
+       private void reloadList() throws IOException {
+               list = Instance.getInstance().getLibrary().getList();
+       }
+
+       private DataNode<DataNodeBook> getNodeFlat(List<String> flatData,
+                       Type type) {
+               List<DataNode<DataNodeBook>> nodes = new ArrayList<DataNode<DataNodeBook>>();
+
+               for (String data : flatData) {
+                       nodes.add(new DataNode<DataNodeBook>(null,
+                                       new DataNodeBook(type, data)));
+               }
+
+               return new DataNode<DataNodeBook>(nodes,
+                               new DataNodeBook(type, !nodes.isEmpty()));
+       }
+
+       private DataNode<DataNodeBook> getNodeGrouped(DataTreeSort tree,
+                       Map<String, List<String>> sourcesGrouped, Type type) {
+               List<DataNode<DataNodeBook>> nodes = new ArrayList<DataNode<DataNodeBook>>();
+
+               List<String> sources = new ArrayList<String>(sourcesGrouped.keySet());
+               tree.sort(sources);
+               for (String source : sources) {
+                       List<String> children = sourcesGrouped.get(source);
+                       boolean hasChildren = (children.size() > 1) || (children.size() == 1
+                                       && !children.get(0).trim().isEmpty());
+
+                       List<DataNode<DataNodeBook>> subnodes = new ArrayList<DataNode<DataNodeBook>>();
+                       if (hasChildren) {
+                               tree.sort(children);
+                               for (String subSource : children) {
+                                       boolean baseSubSource = subSource.isEmpty()
+                                                       && children.size() > 1;
+                                       DataNodeBook book = new DataNodeBook(type, source,
+                                                       subSource, false);
+                                       if (baseSubSource)
+                                               book.setDisplay("*");
+                                       subnodes.add(new DataNode<DataNodeBook>(null, book));
+                               }
+                       }
+
+                       nodes.add(new DataNode<DataNodeBook>(subnodes,
+                                       new DataNodeBook(type, source, "", hasChildren)));
+               }
+
+               return new DataNode<DataNodeBook>(nodes,
+                               new DataNodeBook(type, !nodes.isEmpty()));
+       }
+}
diff --git a/src/be/nikiroo/fanfix_swing/gui/utils/DataTreeSources.java b/src/be/nikiroo/fanfix_swing/gui/utils/DataTreeSources.java
deleted file mode 100644 (file)
index f465196..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-package be.nikiroo.fanfix_swing.gui.utils;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import be.nikiroo.fanfix.Instance;
-import be.nikiroo.fanfix_swing.gui.book.BookInfo.Type;
-import be.nikiroo.utils.ui.DataNode;
-import be.nikiroo.utils.ui.DataTree;
-
-public class DataTreeSources extends DataTree<DataNodeBook> {
-       private boolean flat;
-
-       public DataTreeSources(boolean flat) {
-               this.flat = flat;
-       }
-
-       protected boolean isFlat() {
-               return flat;
-       }
-
-       @Override
-       protected boolean checkFilter(String filter, DataNodeBook userData) {
-               return userData.getName().toLowerCase().contains(filter.toLowerCase())
-                               || userData.getSubname().toLowerCase()
-                                               .contains(filter.toLowerCase());
-       }
-
-       @Override
-       protected DataNode<DataNodeBook> extractData() throws IOException {
-               if (isFlat()) {
-                       return getNodeFlat(
-                                       Instance.getInstance().getLibrary().getList().getSources(),
-                                       Type.SOURCE);
-               }
-
-               Map<String, List<String>> sourcesGrouped = Instance.getInstance()
-                               .getLibrary().getSourcesGrouped();
-               return getNodeGrouped(sourcesGrouped, Type.SOURCE);
-       }
-
-       protected DataNode<DataNodeBook> getNodeFlat(List<String> flatData,
-                       Type type) throws IOException {
-               List<DataNode<DataNodeBook>> nodes = new ArrayList<DataNode<DataNodeBook>>();
-
-               for (String data : flatData) {
-                       nodes.add(new DataNode<DataNodeBook>(null,
-                                       new DataNodeBook(type, data)));
-               }
-
-               return new DataNode<DataNodeBook>(nodes,
-                               new DataNodeBook(type, !nodes.isEmpty()));
-       }
-
-       protected DataNode<DataNodeBook> getNodeGrouped(
-                       Map<String, List<String>> sourcesGrouped, Type type)
-                       throws IOException {
-               List<DataNode<DataNodeBook>> nodes = new ArrayList<DataNode<DataNodeBook>>();
-
-               List<String> sources = new ArrayList<String>(sourcesGrouped.keySet());
-               sort(sources);
-               for (String source : sources) {
-                       List<String> children = sourcesGrouped.get(source);
-                       boolean hasChildren = (children.size() > 1) || (children.size() == 1
-                                       && !children.get(0).trim().isEmpty());
-
-                       List<DataNode<DataNodeBook>> subnodes = new ArrayList<DataNode<DataNodeBook>>();
-                       if (hasChildren) {
-                               sort(children);
-                               for (String subSource : children) {
-                                       boolean baseSubSource = subSource.isEmpty()
-                                                       && children.size() > 1;
-                                       DataNodeBook book = new DataNodeBook(type, source,
-                                                       subSource, false);
-                                       if (baseSubSource)
-                                               book.setDisplay("*");
-                                       subnodes.add(new DataNode<DataNodeBook>(null, book));
-                               }
-                       }
-
-                       nodes.add(new DataNode<DataNodeBook>(subnodes,
-                                       new DataNodeBook(type, source, "", hasChildren)));
-               }
-
-               return new DataNode<DataNodeBook>(nodes,
-                               new DataNodeBook(type, !nodes.isEmpty()));
-       }
-}
diff --git a/src/be/nikiroo/fanfix_swing/gui/utils/DataTreeTag.java b/src/be/nikiroo/fanfix_swing/gui/utils/DataTreeTag.java
deleted file mode 100644 (file)
index f94c105..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-package be.nikiroo.fanfix_swing.gui.utils;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import be.nikiroo.fanfix.Instance;
-import be.nikiroo.fanfix.data.MetaData;
-import be.nikiroo.fanfix.library.MetaResultList;
-import be.nikiroo.fanfix_swing.gui.book.BookInfo.Type;
-import be.nikiroo.utils.ui.DataNode;
-
-public class DataTreeTag extends DataTreeSources {
-       public DataTreeTag(boolean flat) {
-               super(flat);
-       }
-
-       @Override
-       protected boolean checkFilter(String filter, DataNodeBook userData) {
-               return userData
-                               .getSubnameOrName().toLowerCase().contains(filter.toLowerCase());
-       }
-
-       @Override
-       protected DataNode<DataNodeBook> extractData() throws IOException {
-               if (isFlat()) {
-                       return getNodeFlat(
-                                       Instance.getInstance().getLibrary().getList().getTags(),
-                                       Type.TAG);
-               }
-
-               return getNodeGrouped(
-                               Instance.getInstance().getLibrary().getList().getTagsGrouped(),
-                               Type.TAG);
-       }
-}