Changeset 8353


Ignore:
Timestamp:
2004-10-18T11:50:18+13:00 (20 years ago)
Author:
mdewsnip
Message:

Changed the collectionChanged() functions to refresh(), and added an extra parameter for more control over refreshing.

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

Legend:

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

    r8313 r8353  
    108108    static final public String LOCK_FILE = "gli.lck";
    109109
     110    static public final int COLLECTION_OPENED  = 10;
     111    static public final int COLLECTION_CLOSED  = 11;
     112    static public final int COLLECTION_REBUILT = 12;
     113
    110114    /** Used to indicate the source of the message is the file collection methods. */
    111115    static final public int COLLECT   = 3;
     
    239243    if (Gatherer.g_man != null) {
    240244        Gatherer.g_man.updateUI();
    241         Gatherer.g_man.collectionChanged(false);
     245        Gatherer.g_man.refresh(COLLECTION_CLOSED, false);
    242246    }
    243247    // All of the consequences of a close should have been processed by now, so others should now see the collection as non-ready.
     
    494498        Gatherer.g_man.refreshWorkspaceTree(WorkspaceTree.LIBRARY_CONTENTS_CHANGED);
    495499
    496         Gatherer.g_man.collectionChanged(ready());
     500        Gatherer.g_man.refresh(COLLECTION_OPENED, ready());
    497501    }
    498502    }
     
    983987        // We're done. Let everyone know.
    984988        if (Gatherer.g_man != null) {
    985         Gatherer.g_man.collectionChanged(ready());
     989        Gatherer.g_man.refresh(COLLECTION_OPENED, ready());
    986990        }
    987991        result = true;
     
    11581162
    11591163        // Fire a collection changed first to update the preview etc buttons
    1160         Gatherer.g_man.collectionChanged(ready());
     1164        Gatherer.g_man.refresh(COLLECTION_REBUILT, ready());
    11611165
    11621166        // Now display a message dialog saying its all built
     
    11691173        else {
    11701174        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Preview_Ready_Failed"), Dictionary.get("CollectionManager.Preview_Ready_Title"), JOptionPane.ERROR_MESSAGE);
    1171         Gatherer.g_man.collectionChanged(ready());
     1175        Gatherer.g_man.refresh(COLLECTION_REBUILT, ready());
    11721176        }
    11731177    }
     
    11781182        } else {
    11791183        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Preview_Ready_Failed"), Dictionary.get("CollectionManager.Preview_Ready_Title"), JOptionPane.ERROR_MESSAGE);
    1180         Gatherer.g_man.collectionChanged(ready());
     1184        Gatherer.g_man.refresh(COLLECTION_REBUILT, ready());
    11811185        }
    11821186       
  • trunk/gli/src/org/greenstone/gatherer/gui/CreatePane.java

    r8243 r8353  
    265265    }
    266266
    267     /** This method is invoked at any time there has been a significant change in the collection, such as saving, loading or creating.
    268      * @param ready A <strong>boolean</strong> indicating if a collection is currently available.
    269      * @see org.greenstone.gatherer.Gatherer
    270      * @see org.greenstone.gatherer.collection.CollectionManager
    271      * @see org.greenstone.gatherer.gui.BuildOptions
    272      * @see org.greenstone.gatherer.gui.OptionsPane
    273      */
    274     public void collectionChanged(boolean ready) {
    275     if(Gatherer.c_man == null || !ready) {
    276         return;
    277     }
    278     Collection current_collection = Gatherer.c_man.getCollection();
    279     if (current_collection != previous_collection && !Gatherer.c_man.isImporting()) {
    280         this.options_pane = new OptionsPane(current_collection.build_options);
    281         if (previous_collection != null) {
    282         // clear the log
    283         Document log_document = log_textarea.getDocument();
    284         if (log_document instanceof AppendLineOnlyFileDocument) {
    285             ((AppendLineOnlyFileDocument) log_document).destroy();
    286         }
    287         }
    288         previous_collection = current_collection;
    289        
    290     }
    291     // If we are in simple mode, we have to rebuild the simple arguments list
    292     if(Configuration.getMode() < THRESHOLD) {
    293         souter_panel.remove(sargument_configuration_scroll);
    294         souter_panel.remove(sinner_panel);
    295         sargument_configuration_panel = options_pane.buildImport(null);
    296         sargument_configuration_panel = options_pane.buildBuild(sargument_configuration_panel);
    297         sargument_configuration_scroll = new JScrollPane(sargument_configuration_panel);
    298         sargument_configuration_scroll.setPreferredSize(ARGUMENT_SIZE);
    299         souter_panel.add(sargument_configuration_scroll);
    300         souter_panel.add(sinner_panel);
    301     }
    302     tree.valueChanged(null);
    303    
    304     // now do the preview stuff
    305     if (!Gatherer.c_man.built() || Configuration.exec_address == null) {
    306         preview_button.setEnabled(false);
    307         simple_preview_button.setEnabled(false);
    308     } else {
    309         preview_button.setEnabled(true);
    310         simple_preview_button.setEnabled(true);
    311     }
    312     }
    313267
    314268    public void destroy() {
     
    573527    }
    574528
     529
     530    /** This method is invoked at any time there has been a significant change in the collection, such as saving, loading or creating.
     531     * @param ready A <strong>boolean</strong> indicating if a collection is currently available.
     532     * @see org.greenstone.gatherer.Gatherer
     533     * @see org.greenstone.gatherer.collection.CollectionManager
     534     * @see org.greenstone.gatherer.gui.BuildOptions
     535     * @see org.greenstone.gatherer.gui.OptionsPane
     536     */
     537    public void refresh(int refresh_reason, boolean ready)
     538    {
     539    if(Gatherer.c_man == null || !ready) {
     540        return;
     541    }
     542    Collection current_collection = Gatherer.c_man.getCollection();
     543    if (current_collection != previous_collection && !Gatherer.c_man.isImporting()) {
     544        this.options_pane = new OptionsPane(current_collection.build_options);
     545        if (previous_collection != null) {
     546        // clear the log
     547        Document log_document = log_textarea.getDocument();
     548        if (log_document instanceof AppendLineOnlyFileDocument) {
     549            ((AppendLineOnlyFileDocument) log_document).destroy();
     550        }
     551        }
     552        previous_collection = current_collection;
     553       
     554    }
     555    // If we are in simple mode, we have to rebuild the simple arguments list
     556    if(Configuration.getMode() < THRESHOLD) {
     557        souter_panel.remove(sargument_configuration_scroll);
     558        souter_panel.remove(sinner_panel);
     559        sargument_configuration_panel = options_pane.buildImport(null);
     560        sargument_configuration_panel = options_pane.buildBuild(sargument_configuration_panel);
     561        sargument_configuration_scroll = new JScrollPane(sargument_configuration_panel);
     562        sargument_configuration_scroll.setPreferredSize(ARGUMENT_SIZE);
     563        souter_panel.add(sargument_configuration_scroll);
     564        souter_panel.add(sinner_panel);
     565    }
     566    tree.valueChanged(null);
     567   
     568    // now do the preview stuff
     569    if (!Gatherer.c_man.built() || Configuration.exec_address == null) {
     570        preview_button.setEnabled(false);
     571        simple_preview_button.setEnabled(false);
     572    } else {
     573        preview_button.setEnabled(true);
     574        simple_preview_button.setEnabled(true);
     575    }
     576    }
     577
     578
    575579    private void configureHomeURL() {   
    576580    // set up the home page for the current collection
  • trunk/gli/src/org/greenstone/gatherer/gui/DesignPane.java

    r7981 r8353  
    5353    /** The collection manager is responsible for parsing in, and allowing the editing of, a single collections configuration file. */
    5454    private CollectionDesignManager cdm = null;
     55
    5556    /** The constructor. */
    5657    public DesignPane() {
    5758    }
    58     /** This method is called whenever the state of the current collection
    59      * changes.
    60      * @param ready <i>true</i> if a collection is loaded and ready, <i>false</i> otherwise.
    61      */
    62     public void collectionChanged(boolean ready) {
    63     ///atherer.println("CollectionChanged(" + ready + ")");
    64     if(ready) {
    65         // Retrieve the new config manager.
    66         cdm = Gatherer.c_man.getCollection().cdm;
    67         // Display it.
    68         cdm.display(this);
    69     }
    70     else {
    71         if(cdm != null) {
    72         cdm.destroy();
    73         cdm = null;
    74         }
    75     }
    76     }
     59
    7760    /** Called to cause the components to lay themselves out and be displayed.
    7861     */
     
    8164    this.setLayout(new BorderLayout());
    8265    }
    83    
     66
    8467    public void gainFocus() {
    85     if(cdm == null && Gatherer.c_man.ready()) {
     68    if (cdm == null && Gatherer.c_man.ready()) {
    8669        // Retrieve the new config manager.
    8770        cdm = Gatherer.c_man.getCollection().cdm;
     
    8972        cdm.display(this);
    9073    }
    91     if(cdm != null) {
     74    if (cdm != null) {
    9275        cdm.gainFocus();
    9376    }
     
    10386
    10487    public void loseFocus() {
    105     if(cdm != null) {
     88    if (cdm != null) {
    10689        cdm.save();
    10790    }
     
    11598    }
    11699
     100    /** This method is called whenever the state of the current collection changes.
     101     */
     102    public void refresh(int refresh_reason, boolean ready)
     103    {
     104    if (ready) {
     105        // Retrieve the new config manager.
     106        cdm = Gatherer.c_man.getCollection().cdm;
     107        // Display it.
     108        cdm.display(this);
     109    }
     110    else {
     111        if (cdm != null) {
     112        cdm.destroy();
     113        cdm = null;
     114        }
     115    }
     116    }
     117
    117118    public void saveConfiguration() {
    118     if(cdm != null) {
     119    if (cdm != null) {
    119120        cdm.save();
    120121    }
  • trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java

    r8313 r8353  
    5050import org.greenstone.gatherer.Dictionary;
    5151import org.greenstone.gatherer.Gatherer;
     52import org.greenstone.gatherer.collection.CollectionManager;
    5253import org.greenstone.gatherer.file.FileNode;
    5354import org.greenstone.gatherer.gui.tree.DragTree;
     
    230231
    231232
    232     /** Called whenever a significant change has occured in the state of the currently loaded collection.
    233      * @param ready <i>true</i> if there is a collection currently ready to be editing, <i>false</i> otherwise.
    234      * @see org.greenstone.gatherer.collection.CollectionManager
    235      * @see org.greenstone.gatherer.util.TreeSynchronizer
    236      */
    237     public void collectionChanged(boolean ready)
    238     {
    239     if (ready) {
    240         // System.err.println("In collectionChanged(true).");
    241         TreeModel collection_model = Gatherer.c_man.getRecordSet();
    242         Dictionary.registerText(collection_label, "Collection.Collection");
    243 
    244         // Update label coloring.
    245         collection_label.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
    246         collection_label.setForeground(Configuration.getColor("coloring.collection_heading_foreground", false));
    247         collection_tree.setModel(collection_model);
    248 
    249         // Update tree coloring.
    250         collection_tree.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
    251         collection_tree.setForeground(Configuration.getColor("coloring.collection_tree_foreground", false));
    252     }
    253     else {
    254         Dictionary.registerText(collection_label, "Collection.No_Collection");
    255         collection_label.setBackground(Color.lightGray);
    256         collection_label.setForeground(Color.black);
    257         collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode(Dictionary.get("Collection.No_Collection"))));
    258     }
    259 
    260     filter.setEnabled(ready);
    261     // Ensure that this collection tree view is synchronized with any others.
    262     tree_sync.add(collection_tree);
    263     }
    264 
    265 
    266233    /** Used to create, connect and layout the components to be shown on this control panel.
    267234     * @see org.greenstone.gatherer.Gatherer
     
    453420    // Select the first node in the tree if nothing is already selected
    454421    if (collection_tree.getSelectionPaths() == null) {
    455         System.err.println("Nothing selected... selecting first tree node.");
    456422        collection_tree.setImmediate(true);
    457423        collection_tree.setSelectionRow(0);
     
    470436    {
    471437    filter.setEditable(mode > Configuration.LIBRARIAN_MODE);
     438    }
     439
     440
     441    public void refresh(int refresh_reason, boolean ready)
     442    {
     443    System.err.println("In EnrichPane.collectionChanged(" + ready + ")...");
     444    if (ready) {
     445        TreeModel collection_model = Gatherer.c_man.getRecordSet();
     446        Dictionary.registerText(collection_label, "Collection.Collection");
     447
     448        // Update label coloring.
     449        collection_label.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
     450        collection_label.setForeground(Configuration.getColor("coloring.collection_heading_foreground", false));
     451        collection_tree.setModel(collection_model);
     452
     453        // Update tree coloring.
     454        collection_tree.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
     455        collection_tree.setForeground(Configuration.getColor("coloring.collection_tree_foreground", false));
     456    }
     457    else {
     458        Dictionary.registerText(collection_label, "Collection.No_Collection");
     459        collection_label.setBackground(Color.lightGray);
     460        collection_label.setForeground(Color.black);
     461        collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode(Dictionary.get("Collection.No_Collection"))));
     462    }
     463
     464    filter.setEnabled(ready);
     465    // Ensure that this collection tree view is synchronized with any others.
     466    tree_sync.add(collection_tree);
    472467    }
    473468
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r8351 r8353  
    5454import org.greenstone.gatherer.Gatherer;
    5555import org.greenstone.gatherer.collection.Collection;
     56import org.greenstone.gatherer.collection.CollectionManager;
    5657import org.greenstone.gatherer.collection.DeleteCollectionPrompt;
    5758import org.greenstone.gatherer.collection.ExportCollectionPrompt;
     
    116117    /** Ensures that expansion events between like workspace trees are synchronized. */
    117118    private TreeSynchronizer workspace_tree_sync = null;
     119
     120    static public final int GUI_REFRESHED = 0;
     121
     122
    118123    /**Constructor. Enable window events and arranges all other components.
    119124     * @param size The intial <strong>Dimension</strong> of the screen.
     
    303308
    304309    }
    305     /** Once a collection has been made available to Gatherer, either by its creation or by it being reloaded, we need to inform all the visual components to update necessary data components (such as tree models), enable certain controls that depend on a collection being accessible, and refresh themselves.
    306      * @param ready <i>true</i> if the collection is ready for editing, <i>false</i> otherwise.
    307      */
    308     public void collectionChanged(final boolean ready) {
    309     if(Configuration.get("workflow.mirror", true)) {
    310         mirror_pane.collectionChanged(ready);
    311     }
    312     menu_bar.collectionChanged(ready); // Inform the menu bar that the collections changed.
    313     gather_pane.collectionChanged(ready); // Used to update the collection workspace.
    314     enrich_pane.collectionChanged(ready); // Very important that metaedit pane shows current collection.
    315     design_pane.collectionChanged(ready);
    316     create_pane.collectionChanged(ready); // Used to indicate a new BuildOptions model should be loaded.
    317 
    318     if(!locked) {
    319         // Now enable tabs as necessary. Do this on event queue to prevent crazy NPEs
    320         if(tab_updater == null) {
    321         tab_updater = new TabUpdater(tab_pane, ready);
    322         }
    323         else {
    324         tab_updater.setReady(ready);
    325         }
    326         SwingUtilities.invokeLater(tab_updater);
    327     }
    328     // Set the title
    329     String collection_title = null;
    330     String collection_name = null;
    331     if (ready) {
    332         Collection collection = Gatherer.c_man.getCollection();
    333         collection_title = collection.getTitle();
    334         collection_name = collection.getName();
    335         collection = null;
    336     }
    337     setTitle(collection_title, collection_name);
    338     collection_title = null;
    339     collection_name = null;
    340     // Now is a good time to force a garbage collect.
    341     ///ystem.err.println("Calling garbage collection.");
    342     System.gc();
    343     }
    344310
    345311    public void destroy() {
     
    447413        Dictionary.register(tab_pane);
    448414        content_pane.add(tab_pane, BorderLayout.CENTER);
    449         // Drive a sessionReady event to update all controls to reflect current collection status.
    450         collectionChanged(Gatherer.c_man.ready());
     415        // Call refresh to update all controls to reflect current collection status.
     416        refresh(-1, Gatherer.c_man.ready());
    451417    }
    452418    catch (Exception e) {
     
    498464    }
    499465
    500 //      public Component getSelectedView() {
    501 //      return tab_pane.getSelectedComponent();
    502 //      }
     466
    503467    /** This method is called when the collection is being built, and is used to disable all controls in all pane which could change the state of the collection.
    504468     */
     
    548512        mirror_pane.modeChanged(mode);
    549513    }
     514    }
     515
     516
     517    public void refresh(int refresh_reason, boolean ready)
     518    {
     519    // Update the menu bar
     520    menu_bar.refresh(refresh_reason, ready);
     521
     522    // Update the loaded panes
     523    if (mirror_pane != null) {
     524        mirror_pane.refresh(refresh_reason, ready);
     525    }
     526    if (gather_pane != null) {
     527        gather_pane.refresh(refresh_reason, ready);
     528    }
     529    if (enrich_pane != null) {
     530        enrich_pane.refresh(refresh_reason, ready);
     531    }
     532    if (design_pane != null) {
     533        design_pane.refresh(refresh_reason, ready);
     534    }
     535    if (create_pane != null) {
     536        create_pane.refresh(refresh_reason, ready);
     537    }
     538
     539    if (!locked) {
     540        // Now enable tabs as necessary. Do this on event queue to prevent crazy NPEs
     541        if(tab_updater == null) {
     542        tab_updater = new TabUpdater(tab_pane, ready);
     543        }
     544        else {
     545        tab_updater.setReady(ready);
     546        }
     547        SwingUtilities.invokeLater(tab_updater);
     548    }
     549
     550    // Set the title
     551    String collection_title = null;
     552    String collection_name = null;
     553    if (ready) {
     554        Collection collection = Gatherer.c_man.getCollection();
     555        collection_title = collection.getTitle();
     556        collection_name = collection.getName();
     557        collection = null;
     558    }
     559    setTitle(collection_title, collection_name);
     560    collection_title = null;
     561    collection_name = null;
     562
     563    // Now is a good time to force a garbage collect
     564    System.gc();
    550565    }
    551566
     
    906921     * @return <i>true</i> if we should wait for a thread, <i>false</i> if it is safe to continue.
    907922     */
    908     private boolean waitForThread() {
    909     Thread active[] = new Thread[thread_group.activeCount()];
    910     int size = thread_group.enumerate(active);
    911     for(int i = 0; i < size; i++) {
    912         if(active[i].getName().equals(GShell.GSHELL_BUILD) ||
    913            active[i].getName().equals(GShell.GSHELL_IMPORT) ||
    914            active[i].getName().equals(GShell.GSHELL_NEW)) {
    915         return true;
    916         }
    917     }
    918     return false;
    919     }
     923//     private boolean waitForThread() {
     924// Thread active[] = new Thread[thread_group.activeCount()];
     925// int size = thread_group.enumerate(active);
     926// for(int i = 0; i < size; i++) {
     927//      if(active[i].getName().equals(GShell.GSHELL_BUILD) ||
     928//         active[i].getName().equals(GShell.GSHELL_IMPORT) ||
     929//         active[i].getName().equals(GShell.GSHELL_NEW)) {
     930//      return true;
     931//      }
     932// }
     933// return false;
     934//     }
    920935
    921936
  • trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r8243 r8353  
    206206    }
    207207
    208     /** Called whenever a significant change occurs in the current collections state, such as a new collection being loaded or the current one being closed. Several actions must occur in the GUI to indicate this change to the user, such as en/disabling the collection tree.
    209      * @param ready <i>true</i> if a collection is loaded and ready to be modified, <i>false</i> otherwise.
    210      * @see org.greenstone.gatherer.Configuration
    211      * @see org.greenstone.gatherer.Gatherer
    212      * @see org.greenstone.gatherer.collection.CollectionManager
    213      * @see org.greenstone.gatherer.gui.Coloring
    214      * @see org.greenstone.gatherer.gui.Filter
    215      * @see org.greenstone.gatherer.util.TreeSynchronizer
    216      */
    217     public void collectionChanged(boolean ready) {
    218     // Try to retrieve the collections record set.
    219     collection = Gatherer.c_man.getRecordSet();
    220     if(collection != null) {
    221         //args = new String[1];
    222         //args[0] = Gatherer.c_man.getCollection().getName();
    223         Dictionary.registerText(collection_label, "Collection.Collection");
    224         collection_tree.setModel(collection);
    225         collection_tree.repaint();
    226         collection_filter.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
    227     }
    228     else {
    229         String args[] = new String[1];
    230         args[0] = Dictionary.get("Collection.No_Collection");
    231         Dictionary.registerText(collection_label, "Collection.Collection", args);
    232         args = null;
    233         collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Error")));
    234         collection_filter.setBackground(Color.lightGray);
    235     }
    236     collection_tree.setEnabled(ready);
    237     collection_filter.setEnabled(ready);
    238     collection_filter.setEditable(Configuration.getMode() > Configuration.LIBRARIAN_MODE);
    239     Dictionary.registerTooltip(collection_filter.getComboBox(), "Collection.Filter_Tooltip");
    240 
    241     // Change the label at the top of collection tree.
    242     setEnabled(collection_label, ready, Configuration.getColor("coloring.collection_heading_foreground", false), Configuration.getColor("coloring.collection_heading_background", false));
    243     // Ensure that this tree view of the collection record set is synchronized with any others.
    244     collection_tree_sync.add(collection_tree);
    245 
    246     // Refresh the collection tree (the workspace tree stays the same)
    247     refreshCollectionTree(DragTree.LOADED_COLLECTION_CHANGED);
    248 
    249     // Enable or disable the control buttons
    250     bin_button.setEnabled(ready);
    251     new_folder.setEnabled(ready);
    252     }
    253208
    254209    /** Generates the pane on controls used to 'collect' files into the collection. Resposible for creating, connecting and laying out these controls. */
     
    487442    collection_filter.setEditable(mode > Configuration.LIBRARIAN_MODE);
    488443    workspace_filter.setEditable(mode > Configuration.LIBRARIAN_MODE);
     444    }
     445
     446
     447    /** Called whenever a significant change occurs in the current collections state, such as a new collection being loaded or the current one being closed. Several actions must occur in the GUI to indicate this change to the user, such as en/disabling the collection tree.
     448     * @param ready <i>true</i> if a collection is loaded and ready to be modified, <i>false</i> otherwise.
     449     * @see org.greenstone.gatherer.Configuration
     450     * @see org.greenstone.gatherer.Gatherer
     451     * @see org.greenstone.gatherer.collection.CollectionManager
     452     * @see org.greenstone.gatherer.gui.Coloring
     453     * @see org.greenstone.gatherer.gui.Filter
     454     * @see org.greenstone.gatherer.util.TreeSynchronizer
     455     */
     456    public void refresh(int refresh_reason, boolean ready)
     457    {
     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();
     464        Dictionary.registerText(collection_label, "Collection.Collection");
     465        collection_tree.setModel(collection);
     466        collection_tree.repaint();
     467        collection_filter.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
     468    }
     469    else {
     470        String args[] = new String[1];
     471        args[0] = Dictionary.get("Collection.No_Collection");
     472        Dictionary.registerText(collection_label, "Collection.Collection", args);
     473        args = null;
     474        collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Error")));
     475        collection_filter.setBackground(Color.lightGray);
     476    }
     477    collection_tree.setEnabled(ready);
     478    collection_filter.setEnabled(ready);
     479    collection_filter.setEditable(Configuration.getMode() > Configuration.LIBRARIAN_MODE);
     480    Dictionary.registerTooltip(collection_filter.getComboBox(), "Collection.Filter_Tooltip");
     481
     482    // Change the label at the top of collection tree.
     483    setEnabled(collection_label, ready, Configuration.getColor("coloring.collection_heading_foreground", false), Configuration.getColor("coloring.collection_heading_background", false));
     484    // Ensure that this tree view of the collection record set is synchronized with any others.
     485    collection_tree_sync.add(collection_tree);
     486
     487    // Refresh the collection tree (the workspace tree stays the same)
     488    refreshCollectionTree(DragTree.LOADED_COLLECTION_CHANGED);
     489
     490    // Enable or disable the control buttons
     491    bin_button.setEnabled(ready);
     492    new_folder.setEnabled(ready);
    489493    }
    490494
  • trunk/gli/src/org/greenstone/gatherer/gui/MenuBar.java

    r8313 r8353  
    256256    }
    257257
    258     public void collectionChanged(boolean ready) {
    259     file_close.setEnabled(ready);
    260     file_save.setEnabled(ready);
    261     }
    262 
    263258    /** Once a quit has been requested by the user, prevent any further menu selections. */
    264259    public void exit() {
     
    266261    edit.setEnabled(false);
    267262    help.setEnabled(false);
     263    }
     264
     265    public void refresh(int refresh_reason, boolean ready)
     266    {
     267    file_close.setEnabled(ready);
     268    file_save.setEnabled(ready);
    268269    }
    269270
  • trunk/gli/src/org/greenstone/gatherer/gui/MirrorPane.java

    r8243 r8353  
    198198    }
    199199
    200     public void collectionChanged(boolean ready) {
    201     }
    202200
    203201    /** This method is called whenever the Mirror pane is brought into focus and is a good time to display a warning message if WGet is not available or of an older, problematic, version.
     
    240238    if (current_mode >= THRESHOLD) {
    241239        options_pane.add(requisite_checkbox);
    242     } else {
     240    }
     241    else {
    243242        options_pane.remove(requisite_checkbox);
    244243        requisite_checkbox.setSelected(false);
    245244    }
    246    
     245    }
     246
     247
     248    public void refresh(int refresh_reason, boolean ready)
     249    {
    247250    }
    248251
     
    386389    }
    387390    }
    388 
    389 
    390391}
Note: See TracChangeset for help on using the changeset viewer.