2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
22 package jalview.fts.core;
24 import jalview.fts.api.FTSDataColumnI;
25 import jalview.fts.api.GFTSPanelI;
26 import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
27 import jalview.gui.Desktop;
28 import jalview.gui.IProgressIndicator;
29 import jalview.gui.JvSwingUtils;
30 import jalview.gui.SequenceFetcher;
31 import jalview.io.cache.JvCacheableInputBox;
32 import jalview.util.MessageManager;
34 import java.awt.BorderLayout;
35 import java.awt.CardLayout;
36 import java.awt.Dimension;
37 import java.awt.event.ActionEvent;
38 import java.awt.event.ActionListener;
39 import java.awt.event.FocusAdapter;
40 import java.awt.event.FocusEvent;
41 import java.awt.event.FocusListener;
42 import java.awt.event.ItemEvent;
43 import java.awt.event.ItemListener;
44 import java.awt.event.KeyAdapter;
45 import java.awt.event.KeyEvent;
46 import java.awt.event.MouseAdapter;
47 import java.awt.event.MouseEvent;
48 import java.text.DecimalFormat;
49 import java.util.ArrayList;
50 import java.util.Arrays;
51 import java.util.Collection;
52 import java.util.Collections;
53 import java.util.Comparator;
54 import java.util.HashSet;
55 import java.util.List;
57 import javax.swing.ImageIcon;
58 import javax.swing.JButton;
59 import javax.swing.JCheckBox;
60 import javax.swing.JComboBox;
61 import javax.swing.JFrame;
62 import javax.swing.JInternalFrame;
63 import javax.swing.JLabel;
64 import javax.swing.JPanel;
65 import javax.swing.JScrollPane;
66 import javax.swing.JTabbedPane;
67 import javax.swing.JTable;
68 import javax.swing.Timer;
69 import javax.swing.event.ChangeEvent;
70 import javax.swing.event.ChangeListener;
71 import javax.swing.event.DocumentEvent;
72 import javax.swing.event.DocumentListener;
73 import javax.swing.event.InternalFrameEvent;
74 import javax.swing.table.DefaultTableModel;
75 import javax.swing.table.TableColumn;
76 import javax.swing.text.JTextComponent;
79 * This class provides the swing GUI layout for FTS Panel and implements most of
80 * the contracts defined in GFSPanelI
86 @SuppressWarnings("serial")
87 public abstract class GFTSPanel extends JPanel implements GFTSPanelI
89 protected JInternalFrame mainFrame = new JInternalFrame(
92 protected JTabbedPane tabs = new JTabbedPane();
93 protected IProgressIndicator progressIndicator;
95 protected JComboBox<FTSDataColumnI> cmb_searchTarget = new JComboBox<>();
97 protected JButton btn_ok = new JButton();
99 protected JButton btn_back = new JButton();
101 protected JButton btn_cancel = new JButton();
103 protected JCheckBox btn_autosearch = new JCheckBox();
105 protected JvCacheableInputBox<String> txt_search;
107 protected SequenceFetcher seqFetcher;
109 protected Collection<FTSDataColumnI> wantedFields;
111 private String lastSearchTerm = "";
113 protected JButton btn_next_page = new JButton();
115 protected JButton btn_prev_page = new JButton();
117 protected StringBuilder errorWarning = new StringBuilder();
119 protected ImageIcon warningImage = new ImageIcon(
120 getClass().getResource("/images/warning.gif"));
122 protected ImageIcon loadingImage = new ImageIcon(
123 getClass().getResource("/images/loading.gif"));
125 protected ImageIcon balnkPlaceholderImage = new ImageIcon(
126 getClass().getResource("/images/blank_16x16_placeholder.png"));
128 protected JLabel lbl_warning = new JLabel(warningImage);
130 protected JLabel lbl_loading = new JLabel(loadingImage);
132 protected JLabel lbl_blank = new JLabel(balnkPlaceholderImage);
134 private JTabbedPane tabbedPane = new JTabbedPane();
136 private JPanel pnl_actions = new JPanel();
138 private JPanel pnl_results = new JPanel(new CardLayout());
140 private JPanel pnl_inputs = new JPanel();
142 private BorderLayout mainLayout = new BorderLayout();
144 protected Object[] previousWantedFields;
146 protected int resultSetCount;
148 protected int totalResultSetCount;
150 protected int offSet;
152 protected int pageLimit;
154 protected HashSet<String> paginatorCart = new HashSet<>();
156 private static final int MIN_WIDTH = 670;
158 private static final int MIN_HEIGHT = 300;
160 protected static final DecimalFormat totalNumberformatter = new DecimalFormat(
163 private JTable tbl_summary = new JTable()
165 private boolean inLayout;
168 public boolean getScrollableTracksViewportWidth()
170 return hasExcessWidth();
175 public void doLayout()
177 if (hasExcessWidth())
179 autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS;
184 autoResizeMode = AUTO_RESIZE_OFF;
187 protected boolean hasExcessWidth()
189 return getPreferredSize().width < getParent().getWidth();
193 public void columnMarginChanged(ChangeEvent e)
199 TableColumn resizingColumn = getTableHeader().getResizingColumn();
200 // Need to do this here, before the parent's
201 // layout manager calls getPreferredSize().
202 if (resizingColumn != null && autoResizeMode == AUTO_RESIZE_OFF
205 resizingColumn.setPreferredWidth(resizingColumn.getWidth());
206 String colHeader = resizingColumn.getHeaderValue().toString();
207 getTempUserPrefs().put(colHeader, resizingColumn.getWidth());
213 public String getToolTipText(MouseEvent evt)
215 String toolTipText = null;
216 java.awt.Point pnt = evt.getPoint();
217 int rowIndex = rowAtPoint(pnt);
218 int colIndex = columnAtPoint(pnt);
222 if (getValueAt(rowIndex, colIndex) == null)
226 toolTipText = getValueAt(rowIndex, colIndex).toString();
228 } catch (Exception e)
232 toolTipText = (toolTipText == null ? null
233 : (toolTipText.length() > 500
234 ? JvSwingUtils.wrapTooltip(true,
235 toolTipText.subSequence(0, 500) + "...")
236 : JvSwingUtils.wrapTooltip(true, toolTipText)));
242 protected JScrollPane scrl_searchResult = new JScrollPane(tbl_summary);
249 public GFTSPanel(SequenceFetcher fetcher)
260 tabs.addTab(MessageManager.getString("label.retrieve_ids"),
262 fetcher.setDatabaseChooserVisible(false);
263 fetcher.embedWithFTSPanel(this);
265 mainFrame.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
266 final JPanel ftsPanel = this;
267 mainFrame.addFocusListener(new FocusAdapter()
270 public void focusGained(FocusEvent e)
272 // TODO: make selected tab gain focus in correct widget
274 && tabs.getSelectedComponent() == ftsPanel)
276 txt_search.requestFocusInWindow();
280 mainFrame.invalidate();
282 } catch (Exception e)
289 * Initializes the GUI default properties
293 private void jbInit() throws Exception
296 txt_search = new JvCacheableInputBox<>(getCacheKey());
297 populateCmbSearchTargetOptions();
298 Integer width = getTempUserPrefs().get("FTSPanel.width") == null ? 800
299 : getTempUserPrefs().get("FTSPanel.width");
300 Integer height = getTempUserPrefs().get("FTSPanel.height") == null ? 400
301 : getTempUserPrefs().get("FTSPanel.height");
302 lbl_warning.setVisible(false);
303 lbl_warning.setFont(new java.awt.Font("Verdana", 0, 12));
304 lbl_loading.setVisible(false);
305 lbl_loading.setFont(new java.awt.Font("Verdana", 0, 12));
306 lbl_blank.setVisible(true);
307 lbl_blank.setFont(new java.awt.Font("Verdana", 0, 12));
309 tbl_summary.setAutoCreateRowSorter(true);
310 tbl_summary.getTableHeader().setReorderingAllowed(false);
311 tbl_summary.addMouseListener(new MouseAdapter()
314 public void mouseClicked(MouseEvent e)
320 public void mouseReleased(MouseEvent e)
325 tbl_summary.addKeyListener(new KeyAdapter()
328 public void keyPressed(KeyEvent evt)
331 switch (evt.getKeyCode())
333 case KeyEvent.VK_ESCAPE: // escape key
334 btn_back_ActionPerformed();
336 case KeyEvent.VK_ENTER: // enter key
337 if (btn_ok.isEnabled())
343 case KeyEvent.VK_TAB: // tab key
344 if (evt.isShiftDown())
346 tabbedPane.requestFocus();
350 btn_back.requestFocus();
360 btn_autosearch.setText(MessageManager.getString("option.autosearch"));
361 btn_autosearch.setToolTipText(
362 MessageManager.getString("option.enable_disable_autosearch"));
363 btn_autosearch.setSelected(
364 jalview.bin.Cache.getDefault(getAutosearchPreference(), true));
365 btn_autosearch.addActionListener(new java.awt.event.ActionListener()
368 public void actionPerformed(ActionEvent e)
370 jalview.bin.Cache.setProperty(getAutosearchPreference(),
371 Boolean.toString(btn_autosearch.isSelected()));
374 btn_back.setFont(new java.awt.Font("Verdana", 0, 12));
375 btn_back.setText(MessageManager.getString("action.back"));
376 btn_back.addActionListener(new java.awt.event.ActionListener()
379 public void actionPerformed(ActionEvent e)
381 btn_back_ActionPerformed();
384 btn_back.addKeyListener(new KeyAdapter()
387 public void keyPressed(KeyEvent evt)
389 if (evt.getKeyCode() == KeyEvent.VK_ENTER)
391 btn_back_ActionPerformed();
396 btn_ok.setEnabled(false);
397 btn_ok.setFont(new java.awt.Font("Verdana", 0, 12));
398 btn_ok.setText(MessageManager.getString("action.ok"));
399 btn_ok.addActionListener(new java.awt.event.ActionListener()
402 public void actionPerformed(ActionEvent e)
407 btn_ok.addKeyListener(new KeyAdapter()
410 public void keyPressed(KeyEvent evt)
412 if (evt.getKeyCode() == KeyEvent.VK_ENTER)
418 btn_next_page.setEnabled(false);
419 btn_next_page.setToolTipText(
420 MessageManager.getString("label.next_page_tooltip"));
421 btn_next_page.setFont(new java.awt.Font("Verdana", 0, 12));
422 btn_next_page.setText(MessageManager.getString("action.next_page"));
423 btn_next_page.addActionListener(new java.awt.event.ActionListener()
426 public void actionPerformed(ActionEvent e)
431 btn_next_page.addKeyListener(new KeyAdapter()
434 public void keyPressed(KeyEvent evt)
436 if (evt.getKeyCode() == KeyEvent.VK_ENTER)
443 btn_prev_page.setEnabled(false);
444 btn_prev_page.setToolTipText(
445 MessageManager.getString("label.prev_page_tooltip"));
446 btn_prev_page.setFont(new java.awt.Font("Verdana", 0, 12));
447 btn_prev_page.setText(MessageManager.getString("action.prev_page"));
448 btn_prev_page.addActionListener(new java.awt.event.ActionListener()
451 public void actionPerformed(ActionEvent e)
456 btn_prev_page.addKeyListener(new KeyAdapter()
459 public void keyPressed(KeyEvent evt)
461 if (evt.getKeyCode() == KeyEvent.VK_ENTER)
468 if (isPaginationEnabled())
470 btn_prev_page.setVisible(true);
471 btn_next_page.setVisible(true);
475 btn_prev_page.setVisible(false);
476 btn_next_page.setVisible(false);
479 btn_cancel.setFont(new java.awt.Font("Verdana", 0, 12));
480 btn_cancel.setText(MessageManager.getString("action.cancel"));
481 btn_cancel.addActionListener(new java.awt.event.ActionListener()
484 public void actionPerformed(ActionEvent e)
486 btn_cancel_ActionPerformed();
489 btn_cancel.addKeyListener(new KeyAdapter()
492 public void keyPressed(KeyEvent evt)
494 if (evt.getKeyCode() == KeyEvent.VK_ENTER)
496 btn_cancel_ActionPerformed();
500 scrl_searchResult.setPreferredSize(new Dimension(width, height));
502 cmb_searchTarget.setFont(new java.awt.Font("Verdana", 0, 12));
503 cmb_searchTarget.addItemListener(new ItemListener()
506 public void itemStateChanged(ItemEvent e)
508 if (e.getStateChange() == ItemEvent.SELECTED)
511 if ("all".equalsIgnoreCase(
512 getCmbSearchTarget().getSelectedItem().toString()))
514 tooltipText = MessageManager.getString("label.search_all");
516 else if ("pdb id".equalsIgnoreCase(
517 getCmbSearchTarget().getSelectedItem().toString()))
519 tooltipText = MessageManager
520 .getString("label.separate_multiple_accession_ids");
524 tooltipText = MessageManager.formatMessage(
525 "label.separate_multiple_query_values", new Object[]
526 { getCmbSearchTarget().getSelectedItem().toString() });
528 txt_search.setToolTipText(
529 JvSwingUtils.wrapTooltip(true, tooltipText));
535 txt_search.setFont(new java.awt.Font("Verdana", 0, 12));
537 txt_search.getEditor().getEditorComponent()
538 .addKeyListener(new KeyAdapter()
541 public void keyPressed(KeyEvent e)
543 if (e.getKeyCode() == KeyEvent.VK_ENTER)
545 if (getTypedText() == null || getTypedText().isEmpty())
549 String primaryKeyName = getFTSRestClient()
550 .getPrimaryKeyColumn().getName();
551 if (primaryKeyName.equalsIgnoreCase(getCmbSearchTarget()
552 .getSelectedItem().toString()))
554 // TODO: nicer to show the list in the result set before
555 // viewing in Jalview perhaps ?
556 transferToSequenceFetcher(getTypedText());
560 performSearchAction();
565 final DeferredTextInputListener listener = new DeferredTextInputListener(
566 1500, new ActionListener()
569 public void actionPerformed(ActionEvent e)
571 if (btn_autosearch.isSelected()
572 || txt_search.wasEnterPressed())
574 performSearchAction();
578 ((JTextComponent) txt_search.getEditor().getEditorComponent())
579 .getDocument().addDocumentListener(listener);
581 txt_search.addFocusListener(new FocusListener()
584 public void focusGained(FocusEvent e)
590 public void focusLost(FocusEvent e)
596 txt_search.addActionListener(new ActionListener()
600 public void actionPerformed(ActionEvent e)
602 performSearchAction();
605 final String searchTabTitle = MessageManager
606 .getString("label.search_result");
607 final String configureCols = MessageManager
608 .getString("label.configure_displayed_columns");
609 ChangeListener changeListener = new ChangeListener()
612 public void stateChanged(ChangeEvent changeEvent)
614 JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent
616 int index = sourceTabbedPane.getSelectedIndex();
618 btn_back.setVisible(true);
619 btn_cancel.setVisible(true);
620 btn_ok.setVisible(true);
621 if (sourceTabbedPane.getTitleAt(index).equals(configureCols))
623 btn_back.setVisible(false);
624 btn_cancel.setVisible(false);
625 btn_ok.setVisible(false);
626 btn_back.setEnabled(false);
627 btn_cancel.setEnabled(false);
628 btn_ok.setEnabled(false);
629 btn_next_page.setEnabled(false);
630 btn_prev_page.setEnabled(false);
631 txt_search.setEnabled(false);
632 cmb_searchTarget.setEnabled(false);
633 previousWantedFields = getFTSRestClient()
634 .getAllDefaultDisplayedFTSDataColumns()
635 .toArray(new Object[0]);
637 if (sourceTabbedPane.getTitleAt(index).equals(searchTabTitle))
639 btn_back.setEnabled(true);
640 btn_cancel.setEnabled(true);
641 refreshPaginatorState();
642 txt_search.setEnabled(true);
643 cmb_searchTarget.setEnabled(true);
644 if (wantedFieldsUpdated())
647 paginatorCart.clear();
656 tabbedPane.addChangeListener(changeListener);
657 tabbedPane.setPreferredSize(new Dimension(width, height));
658 tabbedPane.add(searchTabTitle, scrl_searchResult);
659 tabbedPane.add(configureCols, new FTSDataColumnPreferences(
660 PreferenceSource.SEARCH_SUMMARY, getFTSRestClient()));
662 pnl_actions.add(btn_back);
663 pnl_actions.add(btn_ok);
664 pnl_actions.add(btn_cancel);
666 pnl_results.add(tabbedPane);
667 pnl_inputs.add(cmb_searchTarget);
668 pnl_inputs.add(txt_search);
669 pnl_inputs.add(btn_autosearch);
670 pnl_inputs.add(lbl_loading);
671 pnl_inputs.add(lbl_warning);
672 pnl_inputs.add(lbl_blank);
673 pnl_inputs.add(btn_prev_page);
674 pnl_inputs.add(btn_next_page);
676 this.setLayout(mainLayout);
677 this.add(pnl_inputs, java.awt.BorderLayout.NORTH);
678 this.add(pnl_results, java.awt.BorderLayout.CENTER);
679 this.add(pnl_actions, java.awt.BorderLayout.SOUTH);
680 mainFrame.setVisible(true);
683 tabs.setOpaque(true);
684 tabs.insertTab(MessageManager.getString("label.free_text_search"),
686 mainFrame.setContentPane(tabs);
687 tabs.setVisible(true);
691 mainFrame.setContentPane(this);
693 mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
694 mainFrame.addInternalFrameListener(
695 new javax.swing.event.InternalFrameAdapter()
698 public void internalFrameClosing(InternalFrameEvent e)
703 mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
704 Integer x = getTempUserPrefs().get("FTSPanel.x");
705 Integer y = getTempUserPrefs().get("FTSPanel.y");
706 if (x != null && y != null)
708 mainFrame.setLocation(x, y);
710 Desktop.addInternalFrame(mainFrame, getFTSFrameTitle(), width, height);
713 protected void closeAction()
715 getTempUserPrefs().put("FTSPanel.width", this.getWidth());
716 getTempUserPrefs().put("FTSPanel.height", pnl_results.getHeight());
717 getTempUserPrefs().put("FTSPanel.x", mainFrame.getX());
718 getTempUserPrefs().put("FTSPanel.y", mainFrame.getY());
720 txt_search.persistCache();
723 public class DeferredTextInputListener implements DocumentListener
725 private final Timer swingTimer;
727 public DeferredTextInputListener(int timeOut, ActionListener listener,
730 swingTimer = new Timer(timeOut, listener);
731 swingTimer.setRepeats(repeats);
745 public void insertUpdate(DocumentEvent e)
747 swingTimer.restart();
751 public void removeUpdate(DocumentEvent e)
753 swingTimer.restart();
757 public void changedUpdate(DocumentEvent e)
759 swingTimer.restart();
764 void performSearchAction()
766 String typed = getTypedText();
767 if (typed != null && typed.length() > 0
768 && !typed.equalsIgnoreCase(lastSearchTerm))
771 paginatorCart.clear();
772 lastSearchTerm = typed;
776 public boolean wantedFieldsUpdated()
778 if (previousWantedFields == null)
783 return Arrays.equals(getFTSRestClient()
784 .getAllDefaultDisplayedFTSDataColumns().toArray(new Object[0]),
785 previousWantedFields) ? false : true;
789 public void validateSelection()
791 if (tbl_summary.getSelectedRows().length > 0
792 || !paginatorCart.isEmpty())
794 btn_ok.setEnabled(true);
798 btn_ok.setEnabled(false);
802 public JComboBox<FTSDataColumnI> getCmbSearchTarget()
804 return cmb_searchTarget;
807 public JComboBox<String> getTxtSearch()
812 public JInternalFrame getMainFrame()
817 protected void delayAndEnableActionButtons()
827 } catch (InterruptedException e)
831 btn_ok.setEnabled(true);
832 btn_back.setEnabled(true);
833 btn_cancel.setEnabled(true);
838 protected void checkForErrors()
840 lbl_warning.setVisible(false);
841 lbl_blank.setVisible(true);
842 if (errorWarning.length() > 0)
844 lbl_loading.setVisible(false);
845 lbl_blank.setVisible(false);
846 lbl_warning.setToolTipText(
847 JvSwingUtils.wrapTooltip(true, errorWarning.toString()));
848 lbl_warning.setVisible(true);
852 public void btn_back_ActionPerformed()
855 new SequenceFetcher(progressIndicator);
858 protected void disableActionButtons()
860 btn_ok.setEnabled(false);
861 btn_back.setEnabled(false);
862 btn_cancel.setEnabled(false);
865 public void btn_cancel_ActionPerformed()
871 * Populates search target combo-box options
873 public void populateCmbSearchTargetOptions()
875 List<FTSDataColumnI> searchableTargets = new ArrayList<>();
878 Collection<FTSDataColumnI> foundFTSTargets = getFTSRestClient()
879 .getSearchableDataColumns();
880 searchableTargets.addAll(foundFTSTargets);
881 } catch (Exception e)
886 Collections.sort(searchableTargets, new Comparator<FTSDataColumnI>()
889 public int compare(FTSDataColumnI o1, FTSDataColumnI o2)
891 return o1.getName().compareTo(o2.getName());
895 for (FTSDataColumnI searchTarget : searchableTargets)
897 cmb_searchTarget.addItem(searchTarget);
901 public void transferToSequenceFetcher(String ids)
903 seqFetcher.getTextArea().setText(ids);
904 Thread worker = new Thread(seqFetcher);
909 public String getTypedText()
911 return txt_search.getUserInput();
915 public JTable getResultTable()
922 lbl_loading.setVisible(false);
923 errorWarning.setLength(0);
924 lbl_warning.setVisible(false);
925 lbl_blank.setVisible(true);
926 btn_ok.setEnabled(false);
927 mainFrame.setTitle(getFTSFrameTitle());
929 tbl_summary.setModel(new DefaultTableModel());
930 tbl_summary.setVisible(false);
934 public void setPrevPageButtonEnabled(boolean isEnabled)
936 btn_prev_page.setEnabled(isEnabled);
940 public void setNextPageButtonEnabled(boolean isEnabled)
942 btn_next_page.setEnabled(isEnabled);
946 public void setErrorMessage(String message)
948 errorWarning.append(message);
952 public void updateSearchFrameTitle(String title)
954 mainFrame.setTitle(title);
958 public void setSearchInProgress(Boolean isSearchInProgress)
960 lbl_blank.setVisible(!isSearchInProgress);
961 lbl_loading.setVisible(isSearchInProgress);
962 txt_search.setEditable(!isSearchInProgress);
966 public void prevPageAction()
968 updatePaginatorCart();
969 if (offSet >= pageLimit)
971 offSet = offSet - pageLimit;
976 refreshPaginatorState();
981 public void nextPageAction()
983 updatePaginatorCart();
984 offSet = offSet + pageLimit;
988 public void updatePaginatorCart()
990 int primaryKeyColIndex = 0;
991 JTable resultTable = getResultTable();
992 int totalRows = resultTable.getRowCount();
995 primaryKeyColIndex = getFTSRestClient()
996 .getPrimaryKeyColumIndex(wantedFields, false);
997 } catch (Exception e)
1002 for (int row = 0; row < totalRows; row++)
1004 String id = (String) resultTable.getValueAt(row, primaryKeyColIndex);
1005 if (paginatorCart.contains(id))
1007 paginatorCart.remove(id);
1010 int[] selectedRows = resultTable.getSelectedRows();
1011 for (int summaryRow : selectedRows)
1013 String idStr = resultTable.getValueAt(summaryRow, primaryKeyColIndex)
1015 paginatorCart.add(idStr);
1019 public void updateSummaryTableSelections()
1021 JTable resultTable = getResultTable();
1022 if (paginatorCart.isEmpty())
1026 int primaryKeyColIndex = 0;
1029 primaryKeyColIndex = getFTSRestClient()
1030 .getPrimaryKeyColumIndex(wantedFields, false);
1031 } catch (Exception e)
1033 e.printStackTrace();
1035 int totalRows = resultTable.getRowCount();
1036 for (int row = 0; row < totalRows; row++)
1038 String id = (String) resultTable.getValueAt(row, primaryKeyColIndex);
1039 if (paginatorCart.contains(id))
1041 resultTable.addRowSelectionInterval(row, row);
1044 validateSelection();
1047 public void refreshPaginatorState()
1049 setPrevPageButtonEnabled(false);
1050 setNextPageButtonEnabled(false);
1051 if (resultSetCount == 0 && pageLimit == 0)
1055 if (resultSetCount >= pageLimit)
1057 setNextPageButtonEnabled(true);
1059 if (offSet >= pageLimit)
1061 setPrevPageButtonEnabled(true);
1065 public void referesh()
1067 mainFrame.setTitle(getFTSFrameTitle());