rename BasicTab -> BrowserTab
authorNiki Roo <niki@nikiroo.be>
Sun, 26 Apr 2020 18:09:12 +0000 (20:09 +0200)
committerNiki Roo <niki@nikiroo.be>
Sun, 26 Apr 2020 18:09:12 +0000 (20:09 +0200)
src/be/nikiroo/fanfix_swing/gui/BrowserPanel.java
src/be/nikiroo/fanfix_swing/gui/BrowserTab.java [moved from src/be/nikiroo/fanfix_swing/gui/browser/BasicTab.java with 95% similarity]

index c84e946e606d3be5de56147ff44d35db22622ac0..12840f526441adf3ba49683c5a298e420a068ad9 100644 (file)
@@ -16,7 +16,6 @@ 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.browser.BasicTab;
 import be.nikiroo.fanfix_swing.gui.utils.DataTreeAuthors;
 import be.nikiroo.fanfix_swing.gui.utils.DataTreeSources;
 import be.nikiroo.fanfix_swing.gui.utils.DataTreeTag;
@@ -62,9 +61,9 @@ public class BrowserPanel extends ListenerPanel {
        static public final String TAB_CHANGE = "tab_change";
 
        private JTabbedPane tabs;
-       private BasicTab sourceTab;
-       private BasicTab authorTab;
-       private BasicTab tagsTab;
+       private BrowserTab sourceTab;
+       private BrowserTab authorTab;
+       private BrowserTab tagsTab;
 
        private boolean keepSelection;
 
@@ -78,11 +77,11 @@ public class BrowserPanel extends ListenerPanel {
                tabs = new JTabbedPane();
 
                int index = 0;
-               tabs.add(sourceTab = new BasicTab(new DataTreeSources(false), index++,
+               tabs.add(sourceTab = new BrowserTab(new DataTreeSources(false), index++,
                                SOURCE_SELECTION));
-               tabs.add(authorTab = new BasicTab(new DataTreeAuthors(true), index++,
+               tabs.add(authorTab = new BrowserTab(new DataTreeAuthors(true), index++,
                                AUTHOR_SELECTION));
-               tabs.add(tagsTab = new BasicTab(new DataTreeTag(true), index++,
+               tabs.add(tagsTab = new BrowserTab(new DataTreeTag(true), index++,
                                TAGS_SELECTION));
 
                configureTab(tabs, sourceTab, "Sources", "Tooltip for Sources");
@@ -128,12 +127,12 @@ public class BrowserPanel extends ListenerPanel {
                        if (i == tabs.getSelectedIndex())
                                continue;
 
-                       BasicTab tab = (BasicTab) tabs.getComponent(i);
+                       BrowserTab tab = (BrowserTab) tabs.getComponent(i);
                        tab.unselect();
                }
        }
 
-       private void configureTab(JTabbedPane tabs, BasicTab tab, String name,
+       private void configureTab(JTabbedPane tabs, BrowserTab tab, String name,
                        String tooltip) {
                tab.setBaseTitle(name);
                tabs.setTitleAt(tab.getIndex(), tab.getTitle());
@@ -141,7 +140,7 @@ public class BrowserPanel extends ListenerPanel {
                listenTabs(tabs, tab);
        }
 
-       private void listenTabs(final JTabbedPane tabs, final BasicTab tab) {
+       private void listenTabs(final JTabbedPane tabs, final BrowserTab tab) {
                tab.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
@@ -163,9 +162,9 @@ public class BrowserPanel extends ListenerPanel {
        public BookInfo getHighlight() {
                String selected1 = null;
                Component selectedTab = tabs.getSelectedComponent();
-               if (selectedTab instanceof BasicTab) {
+               if (selectedTab instanceof BrowserTab) {
                        @SuppressWarnings({ "unchecked", "rawtypes" })
-                       List<String> selectedAll = ((BasicTab) selectedTab)
+                       List<String> selectedAll = ((BrowserTab) selectedTab)
                                        .getSelectedElements();
                        if (!selectedAll.isEmpty()) {
                                selected1 = selectedAll.get(0);
similarity index 95%
rename from src/be/nikiroo/fanfix_swing/gui/browser/BasicTab.java
rename to src/be/nikiroo/fanfix_swing/gui/BrowserTab.java
index 7e70253e4c869ff9aa6b3ff287e8650e13cb5183..243402b40065ab3b083c174d6410933077c5db7f 100644 (file)
@@ -1,4 +1,4 @@
-package be.nikiroo.fanfix_swing.gui.browser;
+package be.nikiroo.fanfix_swing.gui;
 
 import java.awt.BorderLayout;
 import java.awt.Component;
@@ -19,7 +19,6 @@ import javax.swing.tree.MutableTreeNode;
 import javax.swing.tree.TreeCellRenderer;
 import javax.swing.tree.TreePath;
 
-import be.nikiroo.fanfix_swing.gui.SearchBar;
 import be.nikiroo.fanfix_swing.gui.utils.DataNodeBook;
 import be.nikiroo.fanfix_swing.images.IconGenerator;
 import be.nikiroo.fanfix_swing.images.IconGenerator.Icon;
@@ -31,7 +30,7 @@ import be.nikiroo.utils.ui.TreeCellSpanner;
 import be.nikiroo.utils.ui.TreeSnapshot;
 import be.nikiroo.utils.ui.UIUtils;
 
-public class BasicTab extends ListenerPanel {
+public class BrowserTab extends ListenerPanel {
        private int totalCount = 0;
        private List<String> selectedElements = new ArrayList<String>();
        private String baseTitle;
@@ -43,7 +42,7 @@ public class BasicTab extends ListenerPanel {
        private DataTree<DataNodeBook> data;
        private SearchBar searchBar;
 
-       public BasicTab(DataTree<DataNodeBook> data, int index,
+       public BrowserTab(DataTree<DataNodeBook> data, int index,
                        String listenerCommand) {
                setLayout(new BorderLayout());
 
@@ -83,9 +82,9 @@ public class BasicTab extends ListenerPanel {
                                        }
                                }
 
-                               BasicTab.this.selectedElements = elements;
+                               BrowserTab.this.selectedElements = elements;
 
-                               fireActionPerformed(BasicTab.this.listenerCommand);
+                               fireActionPerformed(BrowserTab.this.listenerCommand);
                        }
                });