Changeset 36174


Ignore:
Timestamp:
2022-05-10T14:35:59+12:00 (2 years ago)
Author:
kjdon
Message:

we decided to get rid of the add_all button

File:
1 edited

Legend:

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

    r36164 r36174  
    6969      this.nip_edit_index_key = "CDM.IndexManager.Edit_Index";
    7070      this.nip_source_label_key = "CDM.IndexManager.Source";
     71      this.nip_source_tooltip_key = "CDM.IndexManager.Source_Tooltip";
    7172      this.nip_add_index_button_key = "CDM.IndexManager.Add_Index";
    7273      this.nip_add_index_tooltip_key = "CDM.IndexManager.Add_Index_Tooltip";
     
    307308         private JButton select_all_button;
    308309         private JButton select_none_button;
    309          private JButton add_all_button;
     310          //private JButton add_all_button;
    310311       
    311312        private boolean mgpp_enabled = false;
     
    332333              }
    333334            });
    334             if (existing_index == null && mgpp_enabled) {
    335               button_pane.setLayout(new GridLayout(2,3,5,0));
    336               JPanel tmp = new JPanel();
    337               tmp.setComponentOrientation(Dictionary.getOrientation());
    338               button_pane.add(tmp);
    339             } else {
     335            // if (existing_index == null && mgpp_enabled) {
     336            //   button_pane.setLayout(new GridLayout(2,3,5,0));
     337            //   JPanel tmp = new JPanel();
     338            //   tmp.setComponentOrientation(Dictionary.getOrientation());
     339            //   button_pane.add(tmp);
     340            // } else {
    340341              button_pane.setLayout(new GridLayout(2,2,5,0));
    341             }
     342              //}
    342343           
    343344            select_all_button = new GLIButton(Dictionary.get("CDM.IndexManager.Select_All"), Dictionary.get("CDM.IndexManager.Select_All_Tooltip"));
     
    365366            button_pane.add(select_none_button);
    366367
    367             if (existing_index == null && mgpp_enabled) {
    368               add_all_button = new GLIButton(Dictionary.get("CDM.IndexManager.Add_All"), Dictionary.get("CDM.IndexManager.Add_All_Tooltip"));
    369               add_all_button.setEnabled(true);
    370               add_all_button.addActionListener(new AddAllIndexActionListener());
    371               button_pane.add(add_all_button);
    372             }
     368            // if (existing_index == null && mgpp_enabled) {
     369            //   add_all_button = new GLIButton(Dictionary.get("CDM.IndexManager.Add_All"), Dictionary.get("CDM.IndexManager.Add_All_Tooltip"));
     370            //   add_all_button.setEnabled(true);
     371            //   add_all_button.addActionListener(new AddAllIndexActionListener());
     372            //   button_pane.add(add_all_button);
     373            // }
    373374
    374375            button_pane.add(add_or_replace_button);
     
    493494       
    494495
    495         /** add all sources as separate indexes (fields).  */
    496         private class AddAllIndexActionListener
    497         implements ActionListener {
    498 
    499         public void actionPerformed(ActionEvent event) {
    500             ArrayList all_sources = source_list.getAll();
    501             all_sources.add(0, StaticStrings.TEXT_STR);
    502             ArrayList new_sources = new ArrayList();
    503             for(int i = 0; i < all_sources.size(); i++) {
    504             Object source = all_sources.get(i);
    505 
    506             // Create new index
    507             new_sources.clear();
    508             new_sources.add(source);
    509             Index index = new Index(new_sources);
    510             if(!index_model.contains(index)) {
    511                 // Determine the metadatum value
    512                 String name = source.toString();
    513                 if(name.startsWith(StaticStrings.EXTRACTED_NAMESPACE) && name.indexOf(StaticStrings.NS_SEP, StaticStrings.EXTRACTED_NAMESPACE.length()) == -1) {
    514                 name = name.substring(StaticStrings.EXTRACTED_NAMESPACE.length());
    515                 }
    516                 // Create new metadatum
    517                 CollectionMeta metadatum = new CollectionMeta(StaticStrings.STOP_CHARACTER + index.getID());
    518                 metadatum.setValue(name);
    519                 name = null;
    520                 // Assign new index
    521                 addIndex(index, metadatum);
    522             }
    523             source = null;
    524             index = null;
    525             }
    526             new_sources = null;
    527             new_index_prompt.dispose();
     496        // /** add all sources as separate indexes (fields).  */
     497        // private class AddAllIndexActionListener
     498        //     implements ActionListener {
     499
     500        //     public void actionPerformed(ActionEvent event) {
     501        //         ArrayList all_sources = source_list.getAll();
     502        //         all_sources.add(0, StaticStrings.TEXT_STR);
     503        //         ArrayList new_sources = new ArrayList();
     504        //         for(int i = 0; i < all_sources.size(); i++) {
     505        //      Object source = all_sources.get(i);
     506
     507        //      // Create new index
     508        //      new_sources.clear();
     509        //      new_sources.add(source);
     510        //      Index index = new Index(new_sources);
     511        //      if(!index_model.contains(index)) {
     512        //          // Determine the metadatum value
     513        //          String name = source.toString();
     514        //          if(name.startsWith(StaticStrings.EXTRACTED_NAMESPACE) && name.indexOf(StaticStrings.NS_SEP, StaticStrings.EXTRACTED_NAMESPACE.length()) == -1) {
     515        //          name = name.substring(StaticStrings.EXTRACTED_NAMESPACE.length());
     516        //          }
     517        //          // Create new metadatum
     518        //          CollectionMeta metadatum = new CollectionMeta(StaticStrings.STOP_CHARACTER + index.getID());
     519        //          metadatum.setValue(name);
     520        //          name = null;
     521        //          // Assign new index
     522        //          addIndex(index, metadatum);
     523        //      }
     524        //      source = null;
     525        //      index = null;
     526        //         }
     527        //         new_sources = null;
     528        //         new_index_prompt.dispose();
    528529       
    529         }
    530         }
     530        //     }
     531        // }
    531532   
    532533        private class AllFieldsBoxListener
Note: See TracChangeset for help on using the changeset viewer.