Changeset 8354


Ignore:
Timestamp:
2004-10-18T12:05:26+13:00 (20 years ago)
Author:
mdewsnip
Message:

The collection tree is no longer closed down annoyingly when the collection is built.

Location:
trunk/gli/src/org/greenstone/gatherer/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java

    r8353 r8354  
    441441    public void refresh(int refresh_reason, boolean ready)
    442442    {
    443     System.err.println("In EnrichPane.collectionChanged(" + ready + ")...");
    444443    if (ready) {
    445         TreeModel collection_model = Gatherer.c_man.getRecordSet();
     444        // Update label
    446445        Dictionary.registerText(collection_label, "Collection.Collection");
    447 
    448         // Update label coloring.
    449446        collection_label.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
    450447        collection_label.setForeground(Configuration.getColor("coloring.collection_heading_foreground", false));
    451         collection_tree.setModel(collection_model);
    452 
    453         // Update tree coloring.
     448
     449        // Update tree
    454450        collection_tree.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
    455451        collection_tree.setForeground(Configuration.getColor("coloring.collection_tree_foreground", false));
     452        if (refresh_reason != CollectionManager.COLLECTION_REBUILT) {
     453        collection_tree.setModel(Gatherer.c_man.getRecordSet());
     454        }
    456455    }
    457456    else {
     457        // Update label
    458458        Dictionary.registerText(collection_label, "Collection.No_Collection");
    459459        collection_label.setBackground(Color.lightGray);
    460460        collection_label.setForeground(Color.black);
     461
     462        // Update tree
    461463        collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode(Dictionary.get("Collection.No_Collection"))));
    462464    }
  • trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r8353 r8354  
    4848import org.greenstone.gatherer.Dictionary;
    4949import org.greenstone.gatherer.Gatherer;
     50import org.greenstone.gatherer.collection.CollectionManager;
    5051import org.greenstone.gatherer.file.FileNode;
    5152import org.greenstone.gatherer.file.FileOpenActionListener;
     
    456457    public void refresh(int refresh_reason, boolean ready)
    457458    {
    458     System.err.println("In GatherPane.collectionChanged(" + ready + ")...");
    459     // Try to retrieve the collections record set.
    460     collection = Gatherer.c_man.getRecordSet();
    461     if(collection != null) {
    462         //args = new String[1];
    463         //args[0] = Gatherer.c_man.getCollection().getName();
     459    if (ready) {
     460        // Update label
    464461        Dictionary.registerText(collection_label, "Collection.Collection");
    465         collection_tree.setModel(collection);
    466         collection_tree.repaint();
     462
     463        // Update tree
     464        if (refresh_reason != CollectionManager.COLLECTION_REBUILT) {
     465        collection_tree.setModel(Gatherer.c_man.getRecordSet());
     466        collection_tree.repaint();
     467        }
     468
     469        // Update filter
    467470        collection_filter.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
    468471    }
    469472    else {
     473        // Update label
    470474        String args[] = new String[1];
    471475        args[0] = Dictionary.get("Collection.No_Collection");
    472476        Dictionary.registerText(collection_label, "Collection.Collection", args);
    473477        args = null;
     478
     479        // Update tree
    474480        collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Error")));
     481
     482        // Update filter
    475483        collection_filter.setBackground(Color.lightGray);
    476484    }
Note: See TracChangeset for help on using the changeset viewer.