Ignore:
Timestamp:
2006-04-07T16:56:05+12:00 (18 years ago)
Author:
mdewsnip
Message:

The collection tree object is now created and owned by CollectionManager.

File:
1 edited

Legend:

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

    r11625 r11627  
    9191    /** The collection this manager is managing! */
    9292    static private Collection collection = null;
    93     /** The collection_model. */
    94     private CollectionTreeModel collection_model = null;
     93    /** The collection tree (used in both Gather and Enrich panes). */
     94    static private CollectionTree collection_tree = null;
     95    /** The collection tree model. */
     96    private CollectionTreeModel collection_tree_model = null;
    9597    /** An inner class listener responsible for noting tree changes and resetting saved when they occur. */
    9698    private FMTreeModelListener fm_tree_model_listener = null;
     
    237239
    238240    collection = null;
    239     collection_model = null;
     241    collection_tree_model = null;
    240242    Configuration.setCollectionConfiguration(null);
    241243    Gatherer.refresh(Gatherer.COLLECTION_CLOSED);
     
    643645
    644646
     647    public CollectionTree getCollectionTree()
     648    {
     649    if (collection_tree == null) {
     650        collection_tree = new CollectionTree(collection_tree_model, true);
     651    }
     652
     653    return collection_tree;
     654    }
     655
     656
    645657    /** Retrieve the tree model associated with the current collection. */
    646658    public CollectionTreeModel getCollectionTreeModel()
    647659    {
    648     if (collection_model == null && collection != null) {
     660    if (collection_tree_model == null && collection != null) {
    649661        // Use the import directory to generate a new CollectionTreeModel
    650         collection_model = new CollectionTreeModel(new CollectionTreeNode(new File(getCollectionImportDirectoryPath())));
     662        collection_tree_model = new CollectionTreeModel(new CollectionTreeNode(new File(getCollectionImportDirectoryPath())));
    651663        // Ensure that the manager is a change listener for the tree.
    652664        if (fm_tree_model_listener == null) {
    653665        fm_tree_model_listener = new FMTreeModelListener();
    654666        }
    655         collection_model.addTreeModelListener(fm_tree_model_listener);
    656     }
    657     return collection_model;
     667        collection_tree_model.addTreeModelListener(fm_tree_model_listener);
     668    }
     669    return collection_tree_model;
    658670    }
    659671
Note: See TracChangeset for help on using the changeset viewer.