Ignore:
Timestamp:
2003-05-27T15:17:19+12:00 (21 years ago)
Author:
mdewsnip
Message:

Added check for null builder in setSelectedMetadata().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/table/GTableModel.java

    r4329 r4350  
    421421     public Rectangle setSelectedMetadata(Metadata data) {
    422422          Rectangle bounds = null;
    423           if(builder.complete) {
    424                 for(int i = 0; i < getRowCount(); i++) {
    425                      if(getMetadataAtRow(i).equals(data)) {
    426                           ///ystem.err.println("Found matching metadata at row " + i + " (of " + getRowCount() + " rows)");
    427                           ///ystem.err.println("Table shows " + table.getRowCount() + " rows!");
    428                           bounds = table.getCellRect(i, 0, true);
    429                           table.scrollRectToVisible(bounds);
    430                           table.setRowSelectionInterval(i, i);
    431                      }
    432                 }
    433           }
    434           else {
    435                 builder.selected_metadata = data;
     423          if (builder != null) {
     424              if(builder.complete) {
     425              for(int i = 0; i < getRowCount(); i++) {
     426                  if(getMetadataAtRow(i).equals(data)) {
     427                  ///ystem.err.println("Found matching metadata at row " + i + " (of " + getRowCount() + " rows)");
     428                  ///ystem.err.println("Table shows " + table.getRowCount() + " rows!");
     429                  bounds = table.getCellRect(i, 0, true);
     430                  table.scrollRectToVisible(bounds);
     431                  table.setRowSelectionInterval(i, i);
     432                  }
     433              }
     434              }
     435              else {
     436              builder.selected_metadata = data;
     437              }
    436438          }
    437439          return bounds;
Note: See TracChangeset for help on using the changeset viewer.