Ignore:
Timestamp:
2001-03-26T19:07:55+12:00 (23 years ago)
Author:
daven
Message:

added QueryHistory, tooltips on collectionInfoButton. Altered
CSModel to retain CollectionInfo objects and longCollectionNames
for performance. Added files for a BerryBasket - to be turned on
soon. Added sorting of the QueryHistory via the TableMap and TableSorter
files - from the Java Swing tutorial - not sure about GPL status
of these 2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SearchPanel.java

    r2222 r2225  
    116116
    117117    collectionList = new JComboBox(csModel.getCollectionList()){
    118     public boolean isFocusTraversable() {
    119       return false;
    120     }
    121       };
    122     collectionInfoButton = new JButton("Info...");
     118           public boolean isFocusTraversable() {
     119        return false;
     120        }
     121    };
     122    collectionList.setEditable(false);
     123     
     124    collectionInfoButton = new JButton("Info...") {
     125        public String getToolTipText(MouseEvent e) {
     126        //return "more information on " + collectionList.getSelectedItem();
     127        return "More information on " + csModel.getLongCollectionName((String)collectionList.getSelectedItem());
     128        }
     129    };
     130    ToolTipManager.sharedInstance().registerComponent(collectionInfoButton);
    123131    collectionInfoButton.addActionListener(this);
    124132
     
    194202
    195203  public void actionPerformed(ActionEvent e) {
     204      String collectionName = collectionList.getSelectedItem().toString();
    196205    if (e.getSource() == searchButton ) {
    197206      // cursor not set when RETURN pressed, only when button clicked ?
    198207      windowParent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    199208      String queryString = searchTextField.getText();
    200       String collectionName = collectionList.getSelectedItem().toString();
    201209      System.err.println("Search started (" + collectionName + "): \"" + queryString + "\" ..." );
    202210      //send query to collection
     
    240248    resultsList.setSelectedIndex(0); // should be under Preference control!
    241249      } // end else
     250
     251
     252      csModel.getQueryHistoryModel().add( new QueryHistoryItem(new Query(queryString), new Date(), collectionName, "user"));
     253
    242254      titleMap.clear();
    243255      titleMetaData.clear();
     
    247259    else {
    248260    if (e.getSource() == collectionInfoButton) {
    249         CollectionInfoDialog cid = new CollectionInfoDialog(windowParent, collectionList.getSelectedItem().toString(), nzdl);
     261        CollectionInfoDialog cid = new CollectionInfoDialog(windowParent, collectionName, csModel);
    250262    }
    251263    else {
     
    287299          // treat as HTML
    288300          displayAsHTML(sr);
    289           htmlDoc.getImageData(nzdl, result.getCollectionName());
     301          //htmlDoc.getImageData(nzdl, result.getCollectionName());
    290302      }
    291303
Note: See TracChangeset for help on using the changeset viewer.