Changeset 12043


Ignore:
Timestamp:
2006-07-06T17:32:37+12:00 (18 years ago)
Author:
kjdon
Message:

made the table cell renderer work properly if the user has changed the positions of the columns

File:
1 edited

Legend:

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

    r10593 r12043  
    322322        JComponent component = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    323323
     324        int real_column = table.convertColumnIndexToModel(column);
    324325        // First column: inherited metadata icon
    325         if (column == 0 && value != null) {
     326        if (real_column == 0 && value != null) {
    326327            component = new JLabel(JarTools.getImage("upfolder.gif"));
    327328        }
    328329
    329330        // Make sure the focus always stay in the value cell of the selected row
    330         if (column == 2 && isSelected) {
     331        if (real_column == 2 && isSelected) {
    331332            table.editCellAt(row, column);
    332333            if (table.isEditing()) {
     
    351352        }
    352353        else {
    353             if (column < 2) {
     354            if (real_column < 2) {
    354355            component.setBackground(Configuration.getColor("coloring.collection_heading_background", true));
    355356            }
     
    360361
    361362        // The value column of cells never paints focus
    362         if (column == 2) {
     363        if (real_column == 2) {
    363364            component.setBorder(BorderFactory.createEmptyBorder(0,2,0,0));
    364365        }
Note: See TracChangeset for help on using the changeset viewer.