Changeset 36230


Ignore:
Timestamp:
2022-05-31T11:07:49+12:00 (5 weeks ago)
Author:
kjdon
Message:

previously we were removing metadata from the fragmenttablemodel by index - but the metadata arraylist is not in the same order as teh table rows - table ordered by language - so we need to remove the metadata by passing the object not the index

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/TranslationView.java

    r36193 r36230  
    518518            CollectionMeta metadata = fragment_table_model.getMetadata(index);
    519519            if (metadata instanceof SearchMeta) {
    520             CollectionDesignManager.searchmeta_manager.removeMetadata(metadata);     
     520                CollectionDesignManager.searchmeta_manager.removeMetadata(metadata);     
    521521            } else {
    522             CollectionDesignManager.collectionmeta_manager.removeMetadata(metadata);
    523             }
    524             fragment_table_model.remove(index);
     522                CollectionDesignManager.collectionmeta_manager.removeMetadata(metadata);
     523            }
     524                    fragment_table_model.remove(metadata);
    525525            // If a remove occured then enable add
    526526            add_button.setEnabled(true);
     
    759759        }
    760760
    761         public void remove(int index) {
    762         metadata.remove(index);
    763         fireTableRowsDeleted(index, index);
    764         }
     761          // we can't remove by index, as the table index doesn't relate to the index in the metadata list
     762          public void remove(CollectionMeta meta) {
     763            metadata.remove(meta);
     764          }
     765         
    765766
    766767        public void setData(String feature_name, String feature_type, TreeSet languages, ArrayList metadata) {
Note: See TracChangeset for help on using the changeset viewer.