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;
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;
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");
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());
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) {
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);
-package be.nikiroo.fanfix_swing.gui.browser;
+package be.nikiroo.fanfix_swing.gui;
import java.awt.BorderLayout;
import java.awt.Component;
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;
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;
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());
}
}
- BasicTab.this.selectedElements = elements;
+ BrowserTab.this.selectedElements = elements;
- fireActionPerformed(BasicTab.this.listenerCommand);
+ fireActionPerformed(BrowserTab.this.listenerCommand);
}
});