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/gui/GUIManager.java

    r8258 r8313  
    6363import org.greenstone.gatherer.gui.tree.WorkspaceTree;
    6464import org.greenstone.gatherer.help.HelpFrame;
    65 import org.greenstone.gatherer.mem.MetadataEditorManager;
     65import org.greenstone.gatherer.metadata.MetadataSet;
     66import org.greenstone.gatherer.metadata.MetadataSetManager;
    6667import org.greenstone.gatherer.shell.GShell;
    6768import org.greenstone.gatherer.util.StaticStrings;
     
    166167    else if(esrc == menu_bar.file_close) {
    167168        boolean cont = showSaveCollectionBox(true, false);
     169        // System.err.println("Here 1.");
    168170        if(cont) {
    169171        tab_pane.setSelectedComponent(gather_pane);
     
    252254    // Metadata Options.
    253255    // *****************
    254     else if (esrc == menu_bar.metadata_import) {
    255         JFileChooser chooser = new JFileChooser(new File(Utility.METADATA_DIR));
    256         MDSFileFilter filter = new MDSFileFilter();
    257         chooser.setFileFilter(filter);
    258         int returnVal = chooser.showDialog(Gatherer.g_man, Dictionary.get("MSMPrompt.File_Import"));
    259         if (returnVal == JFileChooser.APPROVE_OPTION) {
    260         Gatherer.c_man.getCollection().msm.importMDS(chooser.getSelectedFile(), true);
    261         }
    262     }
    263     else if(esrc == menu_bar.metadata_edit) {
    264         showEditMetadataBox();
    265     }
    266     else if(esrc == menu_bar.metadata_export) {
    267         Gatherer.c_man.getCollection().msm.exportMDS();
    268     }
    269     else if(esrc == menu_bar.metadata_view) {
    270         showMetaAuditBox();
    271     }
     256//  else if (esrc == menu_bar.metadata_view) {
     257//      showMetaAuditBox();
     258//  }
    272259
    273260    // *************
     
    658645    }
    659646
    660     /** When the edit metadata option is choosen from the menu, this method is called to ensure we only edit the metadata if there is metadata loaded.
    661      */
    662     private void showEditMetadataBox() {
    663     if(Gatherer.c_man.getCollection() != null) {
    664         Gatherer.c_man.getCollection().msm.editMDS(null, MetadataEditorManager.NORMAL);
    665     }
    666     }
    667647    /** When the load collection option is choosen this method is called to produce the modal file load prompt.
    668648     */
     
    814794    //case SaveCollectionBox.SAVE_YES:
    815795    Gatherer.c_man.setClosingThread(true);
     796    // System.err.println("Here 2.");
    816797    Gatherer.c_man.saveCollection(close_after, exit_after);
     798    // System.err.println("Here 3.");
    817799    // Wait until it is closed.
    818800    try {
     
    823805        }
    824806    }
    825     catch(Exception error) {
    826         DebugStream.println("Exception: " + error);
    827         DebugStream.printStackTrace(error);
     807    catch (Exception exception) {
     808        DebugStream.printStackTrace(exception);
    828809    }
    829810   
     
    859840    }
    860841    // "View assigned metadata" menu item is disabled by default
    861     menu_bar.metadata_view.setCanEnable(false);
     842    // menu_bar.metadata_view.setCanEnable(false);
    862843    menu_bar.setMetaAuditSuffix(null);
    863844
     
    867848        gather_pane.gainFocus();
    868849        // "View assigned metadata" menu item is enabled for the "Gather" pane
    869         menu_bar.metadata_view.setCanEnable(true);
     850        // menu_bar.metadata_view.setCanEnable(true);
    870851    }
    871852    else if(selected_index == tab_pane.indexOfComponent(enrich_pane)) {
    872853        enrich_pane.gainFocus();
    873854        // "View assigned metadata" menu item is enabled for the "Enrich" pane
    874         menu_bar.metadata_view.setCanEnable(true);
     855        // menu_bar.metadata_view.setCanEnable(true);
    875856    }
    876857    else if(selected_index == tab_pane.indexOfComponent(design_pane)) {
     
    953934
    954935
    955     private class MDSFileFilter
    956     extends FileFilter
    957     {
    958     /** Override this method to return <i>true</i> only if the file extension is .mds.
    959      * @param f A possible mds <strong>File</strong>.
    960      * @return <i>true</i> if we should show this file, <i>false</i> otherwise.
    961      */
    962     public boolean accept(File f)
    963     {
    964         String file_name = f.getName().toLowerCase();
    965         if (file_name.endsWith(".mds") || file_name.indexOf(".") == -1) {
    966         return true;
    967         }
    968         return false;
    969     }
    970 
    971     /** Retrieve the description for this filter.
    972      * @return The description as a <strong>String</strong>.
    973      */
    974     public String getDescription()
    975     {
    976         return Dictionary.get("MSMPrompt.File_Filter_Description");
    977     }
    978     }
    979 
    980 
    981936    /** Listens to actions upon the menu bar, and if it detects a click over the help menu brings the help window to the front if it has become hidden.
    982937     */
Note: See TracChangeset for help on using the changeset viewer.