Ignore:
Timestamp:
2004-10-13T14:48:20+13:00 (20 years ago)
Author:
mdewsnip
Message:

Finally committing the (many) changes to the GLI to use the new metadata code... I hope this doesn't have too many bugs in it and committing it now doesn't stuff anyone up! (Katherine said I could commit it, so blame her if anything goes wrong).

File:
1 edited

Legend:

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

    r8243 r8313  
    3939import org.greenstone.gatherer.gui.GComboBox;
    4040import org.greenstone.gatherer.gui.GLIButton;
    41 import org.greenstone.gatherer.msm.ElementWrapper;
     41import org.greenstone.gatherer.metadata.MetadataElement;
     42import org.greenstone.gatherer.metadata.MetadataSetManager;
    4243import org.greenstone.gatherer.util.ExclusiveListSelectionListener;
    4344import org.greenstone.gatherer.util.StaticStrings;
     
    383384            Object source_object = sources_list.get(j);
    384385            String source_str = null;
    385             if(source_object instanceof ElementWrapper) {
    386                 source_str = ((ElementWrapper)source_object).getName();
     386            if(source_object instanceof MetadataElement) {
     387                source_str = ((MetadataElement) source_object).getFullName();
    387388            }
    388389            else {
     
    519520        ArrayList new_data = new ArrayList();
    520521        new_data.add(CollectionConfiguration.TEXT_STR);
    521         new_data.addAll(Gatherer.c_man.getCollection().msm.getAssignedElements());
    522 
     522        new_data.addAll(MetadataSetManager.getEveryMetadataSetElement());
    523523        // Creation
    524524        JPanel mgindexes_panel = new JPanel();
     
    688688        ArrayList new_data = new ArrayList();
    689689        new_data.add(CollectionConfiguration.TEXT_STR);
    690         new_data.addAll(Gatherer.c_man.getCollection().msm.getAssignedElements());
     690        new_data.addAll(MetadataSetManager.getEveryMetadataSetElement());
    691691        // reset the model in the list and combobox
    692692        source_list.setListData(new_data.toArray());
     
    772772         * @param event A <strong>ListSelectionEvent</strong> containing further information about the list selection.
    773773         */
    774         public void valueChanged(ListSelectionEvent event) {
     774        public void valueChanged(ListSelectionEvent event)
     775        {
     776        if (event.getValueIsAdjusting()) {
     777            return;
     778        }
     779
    775780        Object value = index_list.getSelectedValue();
    776781        move_down_button.setEnabled(value != null);
     
    12001205        index_combobox.addItem(CollectionConfiguration.METADATA_STR);
    12011206        index_combobox.addItem(CollectionConfiguration.TEXT_STR);
    1202         java.util.List assigned_elements = Gatherer.c_man.getCollection().msm.getAssignedElements();
    1203         int assigned_elements_size = assigned_elements.size();
    1204         for(int i = 0; i < assigned_elements_size; i++) {
    1205         index_combobox.addItem(assigned_elements.get(i));
    1206         }
    1207         assigned_elements = null;
     1207        ArrayList every_metadata_set_element = MetadataSetManager.getEveryMetadataSetElement();
     1208        for(int i = 0; i < every_metadata_set_element.size(); i++) {
     1209        index_combobox.addItem(every_metadata_set_element.get(i));
     1210        }
    12081211        // Ensure the level manager has at least documents assigned
    12091212        if(levels_model.getSize() == 0) {
     
    13831386            // Unfortunately we have to generate a valid id
    13841387            String id = null;
    1385             if(selected_object instanceof ElementWrapper) {
    1386             id = ((ElementWrapper)selected_object).getName();
     1388            if (selected_object instanceof MetadataElement) {
     1389            id = ((MetadataElement) selected_object).getFullName();
    13871390            }
    13881391            else {
Note: See TracChangeset for help on using the changeset viewer.