Changeset 2227 for trunk/java-client


Ignore:
Timestamp:
2001-03-27T10:57:26+12:00 (23 years ago)
Author:
daven
Message:

Custom cell renderer for the QueryHistoryPanel - with long collection
names as tooltips.

Location:
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient
Files:
3 edited

Legend:

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

    r2225 r2227  
    4646    }
    4747
     48    public Class getColumnClass(int c) {
     49    return getValueAt(0, c).getClass();
     50    }
     51
    4852    public int getRowCount() {
    4953    return historyItems.size();
     
    6771
    6872
    69     class CollectionName extends Object {
     73    public class CollectionName extends Object {
    7074    String string;
    7175
  • trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/QueryHistoryPanel.java

    r2225 r2227  
    3434
    3535    QueryHistoryModel personalQueryHistoryModel;
     36    CSModel csModel;
    3637
    3738    JTable personalQueryHistoryTable;
     
    4041    TableSorter tableSorter;
    4142
    42     public QueryHistoryPanel(CSModel csModel) {
     43    public QueryHistoryPanel(CSModel newCSModel) {
    4344    super();
     45    csModel = newCSModel;
    4446    setLayout( new BorderLayout() );
    4547    setBorder(BorderFactory.createTitledBorder("Query History"));
     
    5658    personalScrollQueryPane = new JScrollPane(personalQueryHistoryTable);
    5759   
     60    personalQueryHistoryTable.getColumnModel().getColumn(0).setMaxWidth(100);
     61
     62
    5863    tabbedPane= new JTabbedPane();
    5964    tabbedPane.addTab("Personal", personalScrollQueryPane);
     
    7075                                               boolean hasFocus,
    7176                                               int row,
    72                                                int column) {
    73                                                this.setText("**" + value.toString());
    74                                                                                    return this;
    75     } // end getTableCellRendererComponent
     77                         int column) {
     78      this.setText(value.toString());
     79      this.setFont(queryHistoryFont);
     80      this.setToolTipText(csModel.getLongCollectionName(value.toString()));
     81      return this;
     82  } // end getTableCellRendererComponent
    7683 
    7784   
  • trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SearchPanel.java

    r2225 r2227  
    124124    collectionInfoButton = new JButton("Info...") {
    125125        public String getToolTipText(MouseEvent e) {
    126         //return "more information on " + collectionList.getSelectedItem();
    127         return "More information on " + csModel.getLongCollectionName((String)collectionList.getSelectedItem());
     126        return "Collection information for '" + csModel.getLongCollectionName((String)collectionList.getSelectedItem()) +"'";
    128127        }
    129128    };
Note: See TracChangeset for help on using the changeset viewer.