JAL-2101 JAL-2071 JAL-1563 Added fix to enable searching for old entry names in Unipr...
[jalview.git] / src / jalview / fts / service / pdb / PDBFTSPanel.java
index 4f308e3..0dd1369 100644 (file)
@@ -107,7 +107,8 @@ public class PDBFTSPanel extends GFTSPanel
 
           long endTime = System.currentTimeMillis();
           totalResultSetCount = resultList.getNumberOfItemsFound();
-          resultSetCount = resultList.getSearchSummary().size();
+          resultSetCount = resultList.getSearchSummary() == null ? 0
+                  : resultList.getSearchSummary().size();
           String result = (resultSetCount > 0) ? MessageManager
                   .getString("label.results") : MessageManager
                   .getString("label.result");
@@ -115,9 +116,14 @@ public class PDBFTSPanel extends GFTSPanel
           if (isPaginationEnabled() && resultSetCount > 0)
           {
             updateSearchFrameTitle(defaultFTSFrameTitle + " - " + result
-                    + " " + (offSet + 1) + " to "
-                    + (offSet + resultSetCount) + " of "
-                    + totalResultSetCount
+                    + " "
+                    + totalNumberformatter.format((Number) (offSet + 1))
+                    + " to "
+                    + totalNumberformatter
+                            .format((Number) (offSet + resultSetCount))
+                    + " of "
+                    + totalNumberformatter
+                            .format((Number) totalResultSetCount)
                     + " " + " (" + (endTime - startTime) + " milli secs)");
           }
           else
@@ -129,6 +135,7 @@ public class PDBFTSPanel extends GFTSPanel
           
           setSearchInProgress(false);
           refreshPaginatorState();
+          updateSummaryTableSelections();
         }
       }
     }.start();
@@ -188,12 +195,17 @@ public class PDBFTSPanel extends GFTSPanel
       e.printStackTrace();
     }
     int[] selectedRows = getResultTable().getSelectedRows();
+    String searchTerm = txt_search.getText();
     for (int summaryRow : selectedRows)
     {
       String idStr = getResultTable().getValueAt(summaryRow,
               primaryKeyColIndex)
               .toString();
-      String searchTerm = txt_search.getText();
+      selectedIdsSet.add(getPDBIdwithSpecifiedChain(idStr, searchTerm));
+    }
+
+    for (String idStr : paginatorCart)
+    {
       selectedIdsSet.add(getPDBIdwithSpecifiedChain(idStr, searchTerm));
     }