Ignore:
Timestamp:
2003-10-03T17:09:38+12:00 (21 years ago)
Author:
mdewsnip
Message:

More small updates and tooltips added.

File:
1 edited

Legend:

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

    r5564 r5571  
    4545import org.greenstone.gatherer.Dictionary;
    4646import org.greenstone.gatherer.Gatherer;
    47 import org.greenstone.gatherer.Message;
    4847import org.greenstone.gatherer.cdm.CollectionDesignManager;
    4948import org.greenstone.gatherer.cdm.CommandTokenizer;
     
    7574import org.greenstone.gatherer.util.Utility;
    7675import org.w3c.dom.*;
     76
    7777/** This class manages many aspects of the collection, from its creation via scripts, data access via methods and its importing and building into the final collection. It is also resposible for firing appropriate event when significant changes have occured within the collection, and for creating a new metadata set manager as necessary.
    7878 * @author John Thompson
     
    112112    static final public int NO_SPECIAL_CASE = -1;
    113113    static final public int SPECIAL_DLS = 0;
     114
     115    /** Used to indicate the source of the message is the file collection methods. */
     116    static final public int COLLECT   = 3;
     117    /** Used to indicate the source of the message is the building methods. */
     118    static final public int BUILDING  = 5;
     119
    114120    /** Constructor. */
    115121    public CollectionManager() {
     
    164170    }
    165171    args = ArrayTools.add(args, collection.build_options.getBuildValues());
    166     GShell shell = new GShell(args, GShell.BUILD, Message.BUILDING, this, build_monitor, GShell.GSHELL_BUILD);
     172    GShell shell = new GShell(args, GShell.BUILD, BUILDING, this, build_monitor, GShell.GSHELL_BUILD);
    167173    shell.addGShellListener(Gatherer.g_man.create_pane);
    168174    shell.start();
     
    726732        collection_import = null;
    727733        args = ArrayTools.add(args, collection.build_options.getImportValues());
    728         GShell shell = new GShell(args, GShell.IMPORT, Message.BUILDING, this, import_monitor, GShell.GSHELL_IMPORT);
     734        GShell shell = new GShell(args, GShell.IMPORT, BUILDING, this, import_monitor, GShell.GSHELL_IMPORT);
    729735        shell.addGShellListener(Gatherer.g_man.create_pane);
    730736        shell.start();
     
    871877        }
    872878    }
    873     GShell process = new GShell(command, GShell.NEW, Message.COLLECT, this, null, GShell.GSHELL_NEW);
     879    GShell process = new GShell(command, GShell.NEW, COLLECT, this, null, GShell.GSHELL_NEW);
    874880    process.addGShellListener(this);
    875881    process.run(); // Don't bother threading this... yet
     
    877883
    878884    /** Any implementation of GShellListener must include this method to allow the GShell to send messages to listeners. However in this case the CollectionManager is in no way interested in what the messages are, just the import events which have a specific type and are handled elsewhere. Thus we can safely ignore this event.
    879       * @param event A <strong>GShellEvent</strong> which contains a the message.
    880       */
     885     * @param event A <strong>GShellEvent</strong> which contains a the message.
     886     */
    881887    public synchronized void message(GShellEvent event) {
    882888    }
    883889    /** Called whenever the metadata value changes in some way, such as the addition of a new value. We want to mark the collection so that it needs saving again.
    884       * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    885       * @see org.greenstone.gatherer.collection.Collection
    886       */
     890     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
     891     * @see org.greenstone.gatherer.collection.Collection
     892     */
    887893    public void metadataChanged(MSMEvent event) {
    888894    // Again this change means we need to save the collection again.
     
    890896    }
    891897    /** This call is fired whenever a process within a GShell created by this class begins.
    892       * @param event A <strong>GShellEvent</strong> containing information about the GShell process.
    893       * @see org.greenstone.gatherer.Gatherer
    894       * @see org.greenstone.gatherer.gui.GUIManager
    895       * @see org.greenstone.gatherer.shell.GShell
    896       */
     898     * @param event A <strong>GShellEvent</strong> containing information about the GShell process.
     899     * @see org.greenstone.gatherer.Gatherer
     900     * @see org.greenstone.gatherer.gui.GUIManager
     901     * @see org.greenstone.gatherer.shell.GShell
     902     */
    897903    public synchronized void processBegun(GShellEvent event) {
    898904    Gatherer.println("CollectionManager.processBegun(" + event.getType() + ")");
     
    11861192    catch (Exception exception) {
    11871193        JOptionPane.showMessageDialog(Gatherer.g_man, "Exception detected during collection install.\nMost likely caused by Windows or Local Library holding locks on files:\n" + exception.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
    1188     }
    1189     }
    1190 
    1191     /** Creates and dispatches a message given the initial details.
    1192      * @param level An <i>int</i> indicating the message level for this message.
    1193      * @param message A <strong>String</strong> which contains the payload of this message.
    1194      * @see org.greenstone.gatherer.Log
    1195      * @see org.greenstone.gatherer.Message
    1196      */
    1197     private void message(int level, String message) {
    1198     Message msg = new Message(Message.COLLECT, level, message);
    1199     if(Gatherer.g_man != null) {
    1200         Gatherer.log.add(msg);
    1201     } else {
    1202         Gatherer.println(msg.toString());
    12031194    }
    12041195    }
     
    14041395    /** Any action that changes one of the tree models within a collection, which are the only models we listen to, mean the collections contents have changed and so saved should be set to false.
    14051396     * @param event A <strong>TreeModelEvent</strong> encompassing all the information about the event which has changed the tree.
    1406             */
     1397     */
    14071398    public void treeNodesChanged(TreeModelEvent event) {
    14081399        if(collection != null) {
     
    14111402    }
    14121403    /** Any action that changes one of the tree models within a collection, which are the only models we listen to, mean the collections contents have changed and so saved should be set to false.
    1413             * @param event A <strong>TreeModelEvent</strong> encompassing all the information about the event which has changed the tree.
    1414             */
     1404     * @param event A <strong>TreeModelEvent</strong> encompassing all the information about the event which has changed the tree.
     1405     */
    14151406    public void treeNodesInserted(TreeModelEvent event) {
    14161407        if(collection != null) {
     
    14191410    }
    14201411    /** Any action that changes one of the tree models within a collection, which are the only models we listen to, mean the collections contents have changed and so saved should be set to false.
    1421             * @param event A <strong>TreeModelEvent</strong> encompassing all the information about the event which has changed the tree.
    1422             */
     1412     * @param event A <strong>TreeModelEvent</strong> encompassing all the information about the event which has changed the tree.
     1413     */
    14231414    public void treeNodesRemoved(TreeModelEvent event) {
    14241415        if(collection != null) {
     
    14271418    }
    14281419    /** Any action that changes one of the tree models within a collection, which are the only models we listen to, mean the collections contents have changed and so saved should be set to false.
    1429             * @param event A <strong>TreeModelEvent</strong> encompassing all the information about the event which has changed the tree.
    1430             */
     1420     * @param event A <strong>TreeModelEvent</strong> encompassing all the information about the event which has changed the tree.
     1421     */
    14311422    public void treeStructureChanged(TreeModelEvent event) {
    14321423        if(collection != null) {
Note: See TracChangeset for help on using the changeset viewer.