Changeset 9017 for trunk/gli


Ignore:
Timestamp:
2005-02-14T11:07:52+13:00 (19 years ago)
Author:
mdewsnip
Message:

Moved some GUI stuff out of CollectionManager and into GUIManager.

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

Legend:

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

    r8846 r9017  
    5353import org.greenstone.gatherer.cdm.CollectionMetaManager;
    5454import org.greenstone.gatherer.cdm.CommandTokenizer;
    55 import org.greenstone.gatherer.file.WorkspaceTree;  // !!! Don't like this here
    5655import org.greenstone.gatherer.gui.LockFileDialog;
    5756import org.greenstone.gatherer.gui.NewCollectionMetadataPrompt;
     
    469468        DebugStream.printStackTrace(error);
    470469    }
    471 
    472     // Done, so refresh interface
    473     if (Gatherer.g_man != null) {
    474         // Return to some initial pane (Gather)
    475         Gatherer.g_man.returnToInitialPane();
    476 
    477         // Refresh the workspace tree to allow for the new collection
    478         Gatherer.g_man.refreshWorkspaceTree(WorkspaceTree.LIBRARY_CONTENTS_CHANGED);
    479 
    480         Gatherer.refresh(Gatherer.COLLECTION_OPENED);
    481     }
    482470    }
    483471
     
    519507    }
    520508
    521     if (Utility.delete(collection_directory)) {
    522         // Refresh the collections shown in the workspace tree
    523         Gatherer.g_man.refreshWorkspaceTree(WorkspaceTree.LIBRARY_CONTENTS_CHANGED);
    524         return true;
    525     }
    526 
    527     return false;
     509    return Utility.delete(collection_directory);
    528510    }
    529511
  • trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java

    r8805 r9017  
    4848import org.greenstone.gatherer.Gatherer;
    4949import org.greenstone.gatherer.LocalLibraryServer;
     50import org.greenstone.gatherer.file.WorkspaceTree;  // !!! Don't like this here
    5051import org.greenstone.gatherer.gui.GLIButton;
    5152import org.greenstone.gatherer.gui.ModalDialog;
     
    348349
    349350        if (Gatherer.c_man.deleteCollection(collection.getShortName())) {
     351        // Refresh the collections shown in the workspace tree
     352        Gatherer.g_man.refreshWorkspaceTree(WorkspaceTree.LIBRARY_CONTENTS_CHANGED);
     353
    350354        if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals(Gatherer.c_man.getCollection().getName())) {
    351355            current_coll_deleted = true;
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r8992 r9017  
    5757import org.greenstone.gatherer.collection.ExportCollectionPrompt;
    5858import org.greenstone.gatherer.file.FileOpenActionListener;
     59import org.greenstone.gatherer.file.WorkspaceTree;
    5960import org.greenstone.gatherer.gui.metaaudit.MetaAuditFrame;
    6061import org.greenstone.gatherer.gui.tree.DragTree;
     
    695696    ncm_prompt = null;
    696697    }
     698
     699
    697700    private class CreationTask
    698         extends Thread {
     701        extends Thread
     702    {
    699703    private NewCollectionDetailsPrompt ncd_prompt = null;
    700704    private NewCollectionMetadataPrompt ncm_prompt = null;
    701     public CreationTask(NewCollectionDetailsPrompt ncd_prompt, NewCollectionMetadataPrompt ncm_prompt) {
     705
     706    public CreationTask(NewCollectionDetailsPrompt ncd_prompt, NewCollectionMetadataPrompt ncm_prompt)
     707    {
    702708        this.ncd_prompt = ncd_prompt;
    703709        this.ncm_prompt = ncm_prompt;
    704710    }
    705711
    706     public void run() {
    707         ///ystem.err.println("Running CreationTask...");
    708         if(ncm_prompt == null) {
     712    public void run()
     713    {
     714        if (ncm_prompt == null) {
    709715        Gatherer.c_man.createCollection(ncd_prompt.getDescription(), Configuration.getEmail(), ncd_prompt.getName(), ncd_prompt.getTitle(), ncd_prompt.getBase(), null);
    710716        }
    711717        else {
    712718        Gatherer.c_man.createCollection(ncd_prompt.getDescription(), Configuration.getEmail(), ncd_prompt.getName(), ncd_prompt.getTitle(), null, ncm_prompt.getSets());
    713         }
    714         // Now that the collection specific settings are loaded we can set the 'view extracted metadata' property
    715         // do we want to have this in here???
    716         //Configuration.set("general.view_extracted_metadata", Configuration.COLLECTION_SPECIFIC, true);
     719        ncm_prompt.dispose();
     720        ncm_prompt = null;
     721        }
     722
    717723        ncd_prompt.dispose();
    718724        ncd_prompt = null;
    719         if(ncm_prompt != null) {
    720         ncm_prompt.dispose();
    721         ncm_prompt = null;
    722         }
     725
     726        // Return to some initial pane (Gather)
     727        returnToInitialPane();
     728
     729        // Refresh the workspace tree to allow for the new collection
     730        refreshWorkspaceTree(WorkspaceTree.LIBRARY_CONTENTS_CHANGED);
     731
     732        // Refresh the rest of the GLI
     733        Gatherer.refresh(Gatherer.COLLECTION_OPENED);
    723734    }
    724735    }
Note: See TracChangeset for help on using the changeset viewer.