Changeset 5157


Ignore:
Timestamp:
2003-08-18T14:00:55+12:00 (21 years ago)
Author:
jmt12
Message:

Fix 203B008

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java

    r4678 r5157  
    4343import org.greenstone.gatherer.Gatherer;
    4444import org.greenstone.gatherer.collection.Collection;
     45import org.greenstone.gatherer.collection.CollectionManager;
    4546import org.greenstone.gatherer.gui.ModalDialog;
    4647import org.greenstone.gatherer.gui.SimpleMenuBar;
    4748import org.greenstone.gatherer.util.ArrayTools;
    4849import org.greenstone.gatherer.util.GSDLSiteConfig;
     50import org.greenstone.gatherer.util.StaticStrings;
    4951import org.greenstone.gatherer.util.Utility;
    5052/** This class provides the functionality to delete current collections from the GSDLHOME/collect/ directory. The user chooses the collection from a list, where each entry also displays details about itself, confirms the delete of a collection by checking a checkbox then presses the ok button to actually delete the collection.
     
    117119    /** Destructor. */
    118120    public void destroy() {
     121    list_model.clear();
     122    list_model = null;
    119123    close_button = null;
    120124    confirmation = null;
    121125    details = null;
    122126    details_label = null;
    123     list_model.clear();
    124     list_model = null;
    125127    list = null;
    126128    ok_button = null;
     
    216218        ArrayTools.sort(collections);
    217219        for(int i = 0; collections != null && i < collections.length; i++) {
    218         File config_file = Utility.findConfigFile(collections[i]);
    219         if (config_file != null) {
    220             CollectionConfiguration config = new CollectionConfiguration(config_file);
    221             if (config != null) {
    222             CollectionEntry col = new CollectionEntry(collections[i].getName(), config);
    223             list_model.addElement(col);
    224             }   
     220        if(!collections[i].getName().equals(StaticStrings.MODEL_COLLECTION_NAME)) {
     221            File config_file = Utility.findConfigFile(collections[i]);
     222            if (config_file != null) {
     223            CollectionConfiguration config = new CollectionConfiguration(config_file);
     224            if (config != null) {
     225                CollectionEntry col = new CollectionEntry(collections[i].getName(), config);
     226                list_model.addElement(col);
     227            }   
     228            }
    225229        }
    226230        }
     
    235239            */
    236240    public void actionPerformed(ActionEvent event) {
     241        // Ask the collection manager to refresh the 'Greenstone Collections' folder
     242        Gatherer.c_man.refreshGreenstoneCollections();
     243        // Done
    237244        prompt.dispose();
    238245    }
     
    243250    implements ListSelectionListener {
    244251    /** Any implementation of ListSelectionListener must include this method so we can be informed when the list selection changes.
    245      * @param event A <strong>ListSelectionEvent</strong> containing all the relevant information garnered from the event itself.
    246             */
     252     * @param  event a <strong>ListSelectionEvent</strong> containing all the relevant information garnered from the event itself
     253     */
    247254    public void valueChanged(ListSelectionEvent event) {
     255        ok_button.setEnabled(false);
     256        confirmation.setSelected(false);
    248257        if(!list.isSelectionEmpty()) {
    249258        confirmation.setEnabled(true);
  • trunk/gli/src/org/greenstone/gatherer/gui/CollectionPane.java

    r5057 r5157  
    239239    collection_tree_sync.add(collection_tree);
    240240
    241     workspace = Gatherer.c_man.getWorkspace();
    242     workspace_tree.setModel(workspace);
    243     workspace_tree_sync.add(workspace_tree);
     241    refreshWorkspace();
    244242
    245243    // Enable or disable the control buttons
     
    491489    public void refreshTrees() {
    492490    collection_tree.refresh(null);
     491    workspace_tree.refresh(null);
     492    }
     493
     494    public void refreshWorkspace() {
     495    workspace = Gatherer.c_man.getWorkspace();
     496    workspace_tree.setModel(workspace);
     497    workspace_tree_sync.add(workspace_tree);
    493498    }
    494499
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r4965 r5157  
    4747import javax.swing.plaf.*;
    4848import javax.swing.text.*;
     49import org.greenstone.gatherer.Configuration;
    4950import org.greenstone.gatherer.Gatherer;
    5051import org.greenstone.gatherer.collection.Collection;
     
    177178    else if(esrc == menu_bar.file_delete) {
    178179        DeleteCollectionPrompt dcp = new DeleteCollectionPrompt();
    179         dcp.display();
     180        if(dcp.display()) {
     181        Gatherer.c_man.closeCollection();
     182        }
    180183        dcp.destroy();
    181184        dcp = null;
     
    544547    // Of course we may not have this tab available.
    545548    if(index != -1) {
    546                 // Some tabs are also dependant on if a collection is ready
     549        // Some tabs are also dependant on if a collection is ready
    547550        Component component = tab_pane.getComponentAt(index);
    548551        if(component == preview_pane) {
     
    569572        }
    570573        }
     574    }
     575    // If the rawname was mirror then rebuild workspace tree to remove caches.
     576    if(rawname.equals("Mirroring")) {
     577        collection_pane.refreshWorkspace();
    571578    }
    572579    }
     
    683690        Gatherer.c_man.createCollection(ncd_prompt.getDescription(), ncd_prompt.getEmail(), ncd_prompt.getName(), ncd_prompt.getTitle(), null, ncm_prompt.getSets());
    684691        }
     692        // Now that the collection specific settings are loaded we can set the 'view extracted metadata' property
     693        Gatherer.config.set("general.view_extracted_metadata", Configuration.COLLECTION_SPECIFIC, ncd_prompt.viewExtractedMetadata());
     694
    685695        ncd_prompt.dispose();
    686696        ncd_prompt = null;
  • trunk/gli/src/org/greenstone/gatherer/gui/MirrorPane.java

    r4675 r5157  
    347347    }
    348348
     349    public void refreshTrees() {
     350    workspace_tree.refresh(null);
     351    }
     352
    349353    public void setURL(String url) {
    350354    source_url.setText(url);
Note: See TracChangeset for help on using the changeset viewer.