Changeset 4517


Ignore:
Timestamp:
2003-06-09T12:59:32+12:00 (21 years ago)
Author:
mdewsnip
Message:

Moved some table selection update code into its own thread, to hopefully prevent some AWT deadlocks. Not very confident about it.

File:
1 edited

Legend:

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

    r4444 r4517  
    313313        for(int i = 0; i < getRowCount(); i++) {
    314314            if(getMetadataAtRow(i).equals(data)) {
    315             ///ystem.err.println("Found matching metadata at row " + i + " (of " + getRowCount() + " rows)");
    316             ///ystem.err.println("Table shows " + table.getRowCount() + " rows!");
    317             bounds = table.getCellRect(i, 0, true);
    318             table.scrollRectToVisible(bounds);
    319             table.setRowSelectionInterval(i, i);
     315            // System.err.println("Found matching metadata at row " + i + " (of " + getRowCount() + " rows)");
     316            // bounds = table.getCellRect(i, 0, true);
     317            // table.scrollRectToVisible(bounds);
     318            SelectionTask task = new SelectionTask(i);
     319            SwingUtilities.invokeLater(task);
     320            break;
    320321            }
    321322        }
     
    326327    }
    327328    return bounds;
     329    }
     330
     331    private class SelectionTask
     332    extends Thread {
     333    private int selected_row;
     334    SelectionTask(int selected_row) {
     335        this.selected_row = selected_row;
     336    }
     337    public void run() {
     338        Rectangle bounds = table.getCellRect(selected_row, 0, true);
     339        table.scrollRectToVisible(bounds);
     340        table.setRowSelectionInterval(selected_row, selected_row);
     341        System.err.println("Done setRowSelectionInterval...");
     342    }
    328343    }
    329344
Note: See TracChangeset for help on using the changeset viewer.