- Timestamp:
- 2004-10-13T14:48:20+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r8258 r8313 63 63 import org.greenstone.gatherer.gui.tree.WorkspaceTree; 64 64 import org.greenstone.gatherer.help.HelpFrame; 65 import org.greenstone.gatherer.mem.MetadataEditorManager; 65 import org.greenstone.gatherer.metadata.MetadataSet; 66 import org.greenstone.gatherer.metadata.MetadataSetManager; 66 67 import org.greenstone.gatherer.shell.GShell; 67 68 import org.greenstone.gatherer.util.StaticStrings; … … 166 167 else if(esrc == menu_bar.file_close) { 167 168 boolean cont = showSaveCollectionBox(true, false); 169 // System.err.println("Here 1."); 168 170 if(cont) { 169 171 tab_pane.setSelectedComponent(gather_pane); … … 252 254 // Metadata Options. 253 255 // ***************** 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 // } 272 259 273 260 // ************* … … 658 645 } 659 646 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 }667 647 /** When the load collection option is choosen this method is called to produce the modal file load prompt. 668 648 */ … … 814 794 //case SaveCollectionBox.SAVE_YES: 815 795 Gatherer.c_man.setClosingThread(true); 796 // System.err.println("Here 2."); 816 797 Gatherer.c_man.saveCollection(close_after, exit_after); 798 // System.err.println("Here 3."); 817 799 // Wait until it is closed. 818 800 try { … … 823 805 } 824 806 } 825 catch(Exception error) { 826 DebugStream.println("Exception: " + error); 827 DebugStream.printStackTrace(error); 807 catch (Exception exception) { 808 DebugStream.printStackTrace(exception); 828 809 } 829 810 … … 859 840 } 860 841 // "View assigned metadata" menu item is disabled by default 861 menu_bar.metadata_view.setCanEnable(false);842 // menu_bar.metadata_view.setCanEnable(false); 862 843 menu_bar.setMetaAuditSuffix(null); 863 844 … … 867 848 gather_pane.gainFocus(); 868 849 // "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); 870 851 } 871 852 else if(selected_index == tab_pane.indexOfComponent(enrich_pane)) { 872 853 enrich_pane.gainFocus(); 873 854 // "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); 875 856 } 876 857 else if(selected_index == tab_pane.indexOfComponent(design_pane)) { … … 953 934 954 935 955 private class MDSFileFilter956 extends FileFilter957 {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 981 936 /** 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. 982 937 */
Note:
See TracChangeset
for help on using the changeset viewer.