Changeset 5589


Ignore:
Timestamp:
2003-10-06T17:55:00+13:00 (21 years ago)
Author:
mdewsnip
Message:

Nearly finished adding tooltips (and thank goodness for that).

Location:
trunk/gli
Files:
50 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/classes/dictionary.properties

    r5582 r5589  
    337337CreatePane.Build_Progress:Build Progress
    338338CreatePane.Cancel_Build:Cancel Build
    339 CreatePane.Cancel_Build_Tooltip:Cancel the collection formation process
     339CreatePane.Cancel_Build_Tooltip:Stop the collection formation process
    340340CreatePane.Copy_Progress:Copy Progress
    341341CreatePane.Document_Count:Collection contains {0} files.
     
    567567#*******Metadata Edit Manager **************
    568568MEM.Add:Add
     569MEM.Add_Attribute_Tooltip:Add a new attribute to the selected item
     570MEM.Add_Element_Tooltip:Add a new element to the selected set
     571MEM.Add_Set_Tooltip:Add a new metadata set
     572MEM.Add_Value_Tooltip:Add a new value to the selected element
    569573MEM.AddAttribute:Add Attribute
    570574MEM.AddSet:Add Set
    571575MEM.AddValue:Add Value
    572576MEM.Alias:Alias
     577MEM.Alias_Tooltip:An alias for this value
    573578MEM.Attribute:Attribute
    574579MEM.Attribute_Already_Exists:This attribute already exists.
     580MEM.Attribute_Name_Tooltip:The name of the new attribute
     581MEM.Attribute_Language_Tooltip:The language of the new attribute
     582MEM.Attribute_Value_Tooltip:The value of the new attribute
    575583MEM.Attributes:Attributes
    576584MEM.Cannot_Add_Elements_To_Greenstone_MDS:You cannot manually add elements to the Greenstone Metadata. If\nnecessary create a new set, then add your new element to it instead.
     
    578586MEM.Confirm_Removal_Title:Confirm Removal
    579587MEM.Edit:Edit
     588MEM.Edit_Attribute_Tooltip:Change the value of the selected attribute
     589MEM.Edit_Value_Tooltip:Change the selected value
    580590MEM.EditAttribute:Edit Attribute
    581591MEM.EditValue:Edit Value
    582592MEM.Element:Element
     593MEM.Element_Name_Tooltip:The name of the new element
    583594MEM.Element_Details:Metadata Element Details
    584595MEM.File:Profile
     
    592603MEM.Profile_Details:Profile Details
    593604MEM.Remove:Remove
     605MEM.Remove_Attribute_Tooltip:Remove the selected attribute
     606MEM.Remove_Element_Tooltip:Remove the selected element from the set
     607MEM.Remove_Set_Tooltip:Remove the selected set
     608MEM.Remove_Value_Tooltip:Remove the selected value
    594609MEM.Set:Set
    595610MEM.Set_Details:Metadata Set Details
     611MEM.Set_Name_Tooltip:The name of the new metadata set
     612MEM.Set_Namespace_Tooltip:The unique namespace for the new metadata set
    596613MEM.Source:From
    597614MEM.Subject:Subject
     
    599616MEM.Title:Edit Metadata Sets
    600617MEM.Value:Value
     618MEM.Value_Tooltip:The new value
    601619MEM.Values:Values
    602620#**************************
     
    738756MSMPrompt.Attribute:Attribute
    739757MSMPrompt.AssignedValues:\nAssigned Values:\n{0}
    740 MSMPrompt.Cancel:Cancel
    741758MSMPrompt.Current_Details:Details of existing Metadata Element
    742759MSMPrompt.Current_Values:Current Values
     
    765782MSMPrompt.New_Details:Details of new Metadata Element
    766783MSMPrompt.New_Name:New Name
     784MSMPrompt.New_Name_Tooltip:Enter the new element name
    767785MSMPrompt.New_Value:Imported Value
    768786MSMPrompt.No_Details:No Details Available
     
    779797MSMPrompt.Select:Merge with Element
    780798MSMPrompt.Select_Element_Add:Add
     799MSMPrompt.Select_Element_Add_Tooltip:Add the metadata element to the selected set
    781800MSMPrompt.Select_Element_Element:Select Element:
     801MSMPrompt.Select_Element_Element_Tooltip:Select the metadata element to import as
    782802MSMPrompt.Select_Element_Ignore:Ignore
    783 MSMPrompt.Select_Element_Instructions:The metadata element {0} cannot be automatically imported into the collection. Select a metadata set and either:\n(1) press 'Add' to add the metadata to that set (only if there is not already {0} metadata in the set), or\n(2) choose an element and press 'Merge' to import {0} metadata to this element.
     803MSMPrompt.Select_Element_Ignore_Tooltip:Ignore this metadata element
     804MSMPrompt.Select_Element_Instructions:The metadata element {0} cannot be automatically imported into the collection. Select a metadata set and either:\n(1) press 'Add' to add the metadata to that set (only if there is not already {0} metadata in the set), or\n(2) choose an element and press 'Merge' to import {0} metadata to this element, or\n(3) ignore this metadata element.
    784805MSMPrompt.Select_Element_Merge:Merge
     806MSMPrompt.Select_Element_Merge_Tooltip:Map the metadata element to the specified element in the selected set
    785807MSMPrompt.Select_Element_Original:Original element name:
    786808MSMPrompt.Select_Element_Set:Select Set:
     809MSMPrompt.Select_Element_Set_Tooltip:Select the metadata set to import into
    787810MSMPrompt.Select_Element_Title:Importing Metadata
    788811MSMPrompt.Select_Set_Instructions:The metadata element {0} cannot be automatically imported into the collection, as it matches no existing metadata set. Select a default metadata set to add this and subsequent metadata elements to.
     
    852875Preferences.Connection.Library_Path:Library path
    853876Preferences.Connection.Proxy_Host:Proxy host
     877Preferences.Connection.Proxy_Host_Tooltip:The address of your proxy server
    854878Preferences.Connection.Proxy_Port:Proxy port
     879Preferences.Connection.Proxy_Port_Tooltip:The port number of your proxy server
    855880Preferences.Connection.Use_Proxy:Use proxy connection?
    856881Preferences.General:General
  • trunk/gli/src/org/greenstone/gatherer/gui/AboutDialog.java

    r5345 r5589  
    1 package org.greenstone.gatherer.gui;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui;
     38
    3839import java.awt.*;
    3940import java.awt.event.*;
     
    4243import org.greenstone.gatherer.Gatherer;
    4344import org.greenstone.gatherer.util.Utility;
     45
    4446/**
    4547 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    4850
    4951// RICOH SOURCE CODE PUBLIC LICENSE - http://www.risource.org/RPL/RPL-1.0A.shtml
    50 
    5152public class AboutDialog
    5253    extends JDialog {
     
    5859
    5960    public AboutDialog(JFrame parent) {
    60     super(parent, get("AboutDialog.Title"), true);
     61    super(parent, Dictionary.newget("AboutDialog.Title"), true);
    6162    this.self = this;
    6263    setSize(SIZE);
     
    6869    JLabel icon_label = new JLabel(scaled_icon);
    6970    JPanel title_pane = new JPanel();
    70     JLabel title_one_label = new JLabel(get("AboutDialog.Title_One"));
    71     JLabel title_two_label = new JLabel(Utility.PROGRAM_NAME + " " + Utility.PROGRAM_VERSION + " " + get("AboutDialog.Date"));
    72     JLabel title_three_label = new JLabel(get("AboutDialog.Title_Two"));
    73     JLabel copyright_label = new JLabel(get("AboutDialog.Copyright"));
     71    JLabel title_one_label = new JLabel();
     72    Dictionary.setText(title_one_label, "AboutDialog.Title_One");
     73    JLabel title_two_label = new JLabel(Utility.PROGRAM_NAME + " " + Utility.PROGRAM_VERSION + " " + Dictionary.newget("AboutDialog.Date"));
     74    JLabel title_three_label = new JLabel();
     75    Dictionary.setText(title_three_label, "AboutDialog.Title_Two");
     76    JLabel copyright_label = new JLabel();
     77    Dictionary.setText(copyright_label, "AboutDialog.Copyright");
     78
    7479    JTextArea text = new JTextArea();
    7580    text.setLineWrap(true);
    7681    text.setWrapStyleWord(true);
     82
    7783    JPanel button_pane = new JPanel();
    78     close_button = new JButton(get("General.Close"));
     84    close_button = new JButton();
     85    Dictionary.setBoth(close_button, "General.Close", "General.Close_Tooltip");
    7986
    8087    // Connection
     
    104111    content_pane.add(new JScrollPane(text), BorderLayout.CENTER);
    105112    content_pane.add(button_pane, BorderLayout.SOUTH);
     113
    106114    // Build text content
    107     text.append(get("AboutDialog.Java_Req"));
     115    text.append(Dictionary.newget("AboutDialog.Java_Req"));
    108116    text.append("\n");
    109     text.append(get("AboutDialog.Java_Req_One"));
     117    text.append(Dictionary.newget("AboutDialog.Java_Req_One"));
    110118    text.append("\n");
    111     text.append(get("AboutDialog.Java_Req_Two"));
     119    text.append(Dictionary.newget("AboutDialog.Java_Req_Two"));
    112120    text.append("\n\n");
    113     text.append("*****" + get("AboutDialog.Acknowledgement") + "*****");
     121    text.append("*****" + Dictionary.newget("AboutDialog.Acknowledgement") + "*****");
    114122    text.append("\n\n");
    115     text.append(get("AboutDialog.Item0"));
     123    text.append(Dictionary.newget("AboutDialog.Item0"));
    116124    text.append("\n\n");
    117     text.append(get("AboutDialog.Item1"));
     125    text.append(Dictionary.newget("AboutDialog.Item1"));
    118126    text.append("\n\n");
    119     text.append(get("AboutDialog.Item2"));
     127    text.append(Dictionary.newget("AboutDialog.Item2"));
    120128    text.append("\n\n");
    121     text.append(get("AboutDialog.Item3"));
     129    text.append(Dictionary.newget("AboutDialog.Item3"));
    122130    text.append("\n\n");
    123     text.append("*****" + get("AboutDialog.Thanks") + "*****");
     131    text.append("*****" + Dictionary.newget("AboutDialog.Thanks") + "*****");
    124132    text.append("\n\n");
    125     text.append(get("AboutDialog.Item4"));
     133    text.append(Dictionary.newget("AboutDialog.Item4"));
    126134    text.append("\n\n");
    127     text.append(get("AboutDialog.Item5"));
     135    text.append(Dictionary.newget("AboutDialog.Item5"));
    128136    text.append("\n\n");
    129     text.append(get("AboutDialog.Item6"));
     137    text.append(Dictionary.newget("AboutDialog.Item6"));
    130138    text.append("\n\n");
    131     text.append(get("AboutDialog.Item7"));
     139    text.append(Dictionary.newget("AboutDialog.Item7"));
    132140    text.append("\n\n");
    133     text.append(get("AboutDialog.Item8"));
    134    
     141    text.append(Dictionary.newget("AboutDialog.Item8"));
    135142    text.setCaretPosition(0);
    136143
     
    148155    }
    149156    }
    150 
    151     static private String get(String key) {
    152     if(key.indexOf(".") == -1) {
    153         key = "AboutDialog." + key;
    154     }
    155     return Gatherer.dictionary.get(key);
    156     }
    157157}
  • trunk/gli/src/org/greenstone/gatherer/gui/BuildOptions.java

    r4933 r5589  
    1 package org.greenstone.gatherer.gui;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui;
     38
    3839import java.io.*;
    3940import java.util.*;
     
    4142import org.greenstone.gatherer.util.ArrayTools;
    4243import org.greenstone.gatherer.util.Utility;
     44
    4345/** This data-only class contains all of the import and build options which persist between sessions, which currently is all of them.
    4446 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    163165    }
    164166    /** This method returns a copy of this current <strong>BuildOptions</strong> object. Tried using stupid <i>Clonable</i> interface but it didn't work.
    165       * @return A <strong>BuildOptions</strong> object with the same settings as this one.
    166       */
     167     * @return A <strong>BuildOptions</strong> object with the same settings as this one.
     168     */
    167169    public BuildOptions copy() {
    168170    BuildOptions options = new BuildOptions();
     
    201203    }
    202204    /** When called this method returns the required arguments selected by the user. Only those arguments that are selected are returned, and even then some are never returned (i.e -out which is handled within the GShells instead).
    203       * @param type The type of process that will recieve these arguments as a <strong>byte</strong>.
    204       * @return A <strong>String[]</strong> containing the arguments and any required parameters as set by the user.
    205       */
     205     * @param type The type of process that will recieve these arguments as a <strong>byte</strong>.
     206     * @return A <strong>String[]</strong> containing the arguments and any required parameters as set by the user.
     207     */
    206208    public String[] getArguments(byte type) {
    207209    ArrayList arguments = new ArrayList();
  • trunk/gli/src/org/greenstone/gatherer/gui/Coloring.java

    r4675 r5589  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.gui;
    3738
    38  
    39 
    40 
    41 
    42 
    43 /* GPL_HEADER */
    44 package org.greenstone.gatherer.gui;
    4539/**************************************************************************************
    4640 * Title:        Gatherer
  • trunk/gli/src/org/greenstone/gatherer/gui/ComboArea.java

    r4832 r5589  
    1 package org.greenstone.gatherer.gui;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui;
     38
    3839import java.awt.*;
    3940import java.awt.event.*;
     
    4445import org.greenstone.gatherer.gui.SmarterTextArea;
    4546import org.greenstone.gatherer.util.Utility;
     47
    4648/** Combines the idea of a combobox with a text area so that multiline entries can be displayed properly. Basically takes a JCombobox, (or in this case a SteppedComboBox that allows us to control the popup window that appears), butchers out the JTextField editor while retaining the button and the data model, then uses a JTextArea for the editor instead.
    4749 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    100102    add(text_pane, BorderLayout.CENTER);
    101103    }
     104
    102105    /** Add an element to our combobox model. Remember to tell the listeners to ignore this action unless you want an infinite loop.
    103       * @param item The <strong>Object</strong> to add.
    104       */
     106     * @param item The <strong>Object</strong> to add.
     107     */
    105108    public void add(Object item) {
    106109    ignore = true;
     
    108111    ignore = false;
    109112    }
     113
    110114    /** Clear the combobox model.
    111       */
     115     */
    112116    public void clear() {
    113117    combobox.clear();
    114118    }
     119
    115120    /** Retrieve the text currently displayed in the text area.
    116       * @return A <strong>String</strong> containing the required text.
    117       */
     121     * @return A <strong>String</strong> containing the required text.
     122     */
    118123    public String getText() {
    119124    return text_area.getText();
    120125    }
     126
    121127    /** Retrieve a reference to the text area.
    122       * @return A <strong>JTextComponent</strong> reference.
    123       */
     128     * @return A <strong>JTextComponent</strong> reference.
     129     */
    124130    public JTextComponent getTextComponent() {
    125131    return text_area;
    126132    }
     133
    127134    /** Change the selected item in the combobox to the one given. If such an object doesn't exist in the model, ignore it. Notice that this time we don't ignore, as we want a selection to update the text field.
    128       * @param item The <strong>Object</strong> that we want to select from the combobox.
    129       */
     135     * @param item The <strong>Object</strong> that we want to select from the combobox.
     136     */
    130137    public void setSelectedItem(Object item) {
    131138    combobox.setSelectedItem(item);
    132139    }
     140
    133141    /** Set the text shown in the text area to the value provided. Note that this has no effect on the combobox, nor will this value be stored in the model.
    134       * @param text The <strong>String</strong> to display.
    135       */
     142     * @param text The <strong>String</strong> to display.
     143     */
    136144    public void setText(String text) {
    137145    text_area.setText(text);
    138146    }
     147
    139148    /** This clas listens for changes in the selected item in the combobox and if applicable updates the text area to match. */
    140149    private class ComboAreaListener
  • trunk/gli/src/org/greenstone/gatherer/gui/CreatePane.java

    r5571 r5589  
    139139    /** An identifier for the progress panel within the card layout. */
    140140    static private String PROGRESS      = "Progress";
     141
    141142    /** The constructor creates important helper classes, and initializes all the components.
    142143     * @see org.greenstone.gatherer.collection.CollectionManager
     
    159160    // Control Pane
    160161    control_pane = new JPanel();
    161     args = new String[1];
    162     args[0] = "0";
    163     document_count = new JLabel(get("CreatePane.Document_Count", args));
    164162    tree = new OptionTree();
     163
    165164    // Progress Pane
    166165    progress_pane = new JPanel();
    167166
    168     progress_copy_label = new JLabel(get("CreatePane.Copy_Progress"));
     167    progress_copy_label = new JLabel();
    169168    progress_copy_label.setForeground(Color.black);
    170169    progress_copy_label.setHorizontalAlignment(JLabel.LEFT);
     
    172171    progress_copy_label.setMinimumSize(LABEL_SIZE);
    173172    progress_copy_label.setSize(LABEL_SIZE);
     173    Dictionary.registerText(progress_copy_label, "CreatePane.Copy_Progress");
    174174
    175175    copy_monitor = new GBasicProgressMonitor();
    176176    Gatherer.c_man.registerCopyMonitor(copy_monitor);
    177177
    178     progress_import_label = new JLabel(get("CreatePane.Import_Progress"));
     178    progress_import_label = new JLabel();
    179179    progress_import_label.setForeground(Color.black);
    180180    progress_import_label.setHorizontalAlignment(JLabel.LEFT);
     
    182182    progress_import_label.setMinimumSize(LABEL_SIZE);
    183183    progress_import_label.setSize(LABEL_SIZE);
     184    Dictionary.registerText(progress_import_label, "CreatePane.Import_Progress");
    184185
    185186    import_monitor = new GImportProgressMonitor(); //GBasicProgressMonitor();
    186187    Gatherer.c_man.registerImportMonitor(import_monitor);
    187188
    188     progress_build_label = new JLabel(get("CreatePane.Build_Progress"));
     189    progress_build_label = new JLabel();
    189190    progress_build_label.setForeground(Color.black);
    190191    progress_build_label.setHorizontalAlignment(JLabel.LEFT);
     
    192193    progress_build_label.setMinimumSize(LABEL_SIZE);
    193194    progress_build_label.setSize(LABEL_SIZE);
     195    Dictionary.registerText(progress_build_label, "CreatePane.Build_Progress");
    194196
    195197    build_monitor = new GBuildProgressMonitor((GImportProgressMonitor)import_monitor); //GBasicProgressMonitor();
     
    234236
    235237    // Build control_pane
    236     JPanel stats_area = new JPanel();
    237     stats_area.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,5,5,5), BorderFactory.createTitledBorder(get("CreatePane.Statistics_Title"))));
    238     stats_area.setLayout(new GridLayout(1,1));
    239     stats_area.add(document_count);
    240 
    241238    JPanel left = new JPanel();
    242239    left.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
     
    249246
    250247    JPanel options_area = new JPanel();
    251     options_area.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,5,5,5), BorderFactory.createTitledBorder(get("CreatePane.Options_Title"))));
     248    options_area.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,5,5,5), BorderFactory.createTitledBorder(Dictionary.newget("CreatePane.Options_Title"))));
    252249    options_area.setLayout(new BorderLayout());
    253250    options_area.add(left, BorderLayout.WEST);
     
    301298    this.add(button_pane, BorderLayout.SOUTH);
    302299    }
     300
    303301    /** This method is called whenever the 'Create' tab is selected from the view bar. It allows this view to perform any preactions required prior to display. In this case this entails gathering up to date information about the status of the collection including number of documents etc.
    304302     * @see org.greenstone.gatherer.Gatherer
     
    315313    tree.setSelectionPath(path);
    316314    }
     315
    317316    /** Method to acquire the progress monitor associated with builds.
    318317     * @return The build <strong>GShellProgressMonitor</strong>.
     
    321320    return build_monitor;
    322321    }
     322
    323323    /** Method to acquire the progress monitor associated with copying.
    324324     * @return The copying <strong>GShellProgressMonitor</strong>.
     
    327327    return copy_monitor;
    328328    }
     329
    329330    /** Method to acquire the progress monitor associated with import.
    330331     * @return The import <strong>GShellProgressMonitor</strong>.
     
    381382        card_layout.show(main_pane, CONTROL);
    382383    }
    383     }
    384     /** This method retrieves a phrase from the dictionary based apon the key.
    385      * @param key A <strong>String</strong> used as a reference to the correct phrase.
    386      * @return A phrase, matching the key, as a <strong>String</strong>.
    387      */
    388     private String get(String key) {
    389     return get(key, null);
    390     }
    391     /** This method retrieves a phrase from the dictionary based apon the key and arguments.
    392      * @param key A <strong>String</strong> used as a reference to the correct phrase.
    393      * @param args A <strong>String[]</strong> whose contents are often substituted into the phrase before it is returned.
    394      * @return A phrase, matching the key and constructed using the arguments, as a <strong>String</strong>.
    395      * @see org.greenstone.gatherer.Dictionary
    396      * @see org.greenstone.gatherer.Gatherer
    397      */
    398     private String get(String key, String args[]) {
    399     if(key.indexOf(".") == -1) {
    400         key = "CreatePane." + key;
    401     }
    402     return Gatherer.dictionary.get(key, args);
    403384    }
    404385
     
    485466    public OptionTree() {
    486467        super();
     468
     469        ToolTipManager.sharedInstance().registerComponent(this);
    487470        addTreeSelectionListener(this);
    488471        getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
     
    490473        setRootVisible(false);
    491474        setToggleClickCount(1);
     475
    492476        // Create tree.
    493         building = new OptionTreeNode(get("CreatePane.Build"));
    494         building.setToolTipText(get("CreatePane.Build_Tooltip"));
    495         importing = new OptionTreeNode(get("CreatePane.Import"));
    496         importing.setToolTipText(get("CreatePane.Import_Tooltip"));
    497         log = new OptionTreeNode(get("CreatePane.Log"));
    498         log.setToolTipText(get("CreatePane.Log_Tooltip"));
    499         options = new OptionTreeNode(get("CreatePane.Options"));
     477        building = new OptionTreeNode(Dictionary.newget("CreatePane.Build"));
     478        building.setToolTipText(Dictionary.newget("CreatePane.Build_Tooltip"));
     479        importing = new OptionTreeNode(Dictionary.newget("CreatePane.Import"));
     480        importing.setToolTipText(Dictionary.newget("CreatePane.Import_Tooltip"));
     481        log = new OptionTreeNode(Dictionary.newget("CreatePane.Log"));
     482        log.setToolTipText(Dictionary.newget("CreatePane.Log_Tooltip"));
     483        options = new OptionTreeNode(Dictionary.newget("CreatePane.Options"));
    500484
    501485        model = new DefaultTreeModel(options);
     
    556540    }
    557541    }
     542
    558543    /** The <strong>OptionTree</strong> is built from these nodes, each of which has several methods used in creating the option panes.
    559       */
     544     */
    560545    private class OptionTreeNode
    561546    extends DefaultMutableTreeNode
     
    572557        this.title = title;
    573558    }
     559
    574560    /** This method compares two nodes for ordering.
    575561     * @param obj The <strong>Object</strong> to compare to.
     
    579565        return title.compareTo(obj.toString());
    580566    }
    581     /** This method checks if two nodes are equivelent.
     567
     568    /** This method checks if two nodes are equivalent.
    582569     * @param obj The <strong>Object</strong> to be tested against.
    583570     * @return A <strong>boolean</strong> which is <i>true</i> if the objects are equal, <i>false</i> otherwise.
     
    594581        return tool_tip;
    595582    }
    596        
     583
    597584    /** set the tool tip */
    598585    public void setToolTipText(String tip) {
    599586        tool_tip = tip;
    600587    }
    601 
    602588   
    603589    /** Method to translate this node into a textual representation.
     
    609595    }
    610596
    611     // this is supposed to add tool tips to teh nodes in the tree but it doesn't work. michael - fix me!!
    612     private class ToolTipTreeCellRenderer 
     597    // Adds tooltips to the tree nodes
     598    private class ToolTipTreeCellRenderer
    613599    extends DefaultTreeCellRenderer {
    614600
     
    620606                              int row,
    621607                              boolean hasFocus) {
    622    
     608
    623609        super.getTreeCellRendererComponent(tree, value, sel,
    624610                           expanded, leaf, row,
    625611                           hasFocus);
    626         ///ystem.out.println("getting component");
    627612        if (value instanceof OptionTreeNode) {
    628         String tip = ((OptionTreeNode)value).getToolTipText();
    629         ///ystem.out.println("setting tool tip to "+tip);
    630         this.setToolTipText(tip);
     613        String tip = ((OptionTreeNode) value).getToolTipText();
     614        if (tip != null) {
     615            setToolTipText(tip);
     616        }
    631617        }
    632618        return this;
  • trunk/gli/src/org/greenstone/gatherer/gui/FileAssociationDialog.java

    r5571 r5589  
    327327    /** When a click on OK is detected, save the current information, then dispose.
    328328     * @param event An <strong>ActionEvent</strong> with details about the button press.
    329             */
     329     */
    330330    public void actionPerformed(ActionEvent event) {
    331331        if(save_required) {
  • trunk/gli/src/org/greenstone/gatherer/gui/GComboBox.java

    r4833 r5589  
    1 package org.greenstone.gatherer.gui;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui;
     38
    3839import java.awt.*;
    3940import java.util.*;
     
    6667    public GComboBox(ComboBoxModel model) {
    6768    super(model);
    68     init();
    69     }
    70 
    71     /** Legacy constructor. */
    72     public GComboBox(Gatherer gatherer) {
    73     super();
    7469    init();
    7570    }
  • trunk/gli/src/org/greenstone/gatherer/gui/GConfigPane.java

    r5340 r5589  
    1 package org.greenstone.gatherer.gui;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui;
     38
    3839import java.awt.*;
    3940import java.io.*;
     
    5758    }
    5859    /** 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       */
     60     * changes.
     61     * @param ready <i>true</i> if a collection is loaded and ready, <i>false</i> otherwise.
     62     */
    6263    public void collectionChanged(boolean ready) {
    6364    ///atherer.println("CollectionChanged(" + ready + ")");
     
    7677    }
    7778    /** Called to cause the components to lay themselves out and be displayed.
    78       */
     79     */
    7980    public void display() {
    8081    // Layout
  • trunk/gli/src/org/greenstone/gatherer/gui/LongProgressBar.java

    r4675 r5589  
    1 package org.greenstone.gatherer.gui;
    21/**
    32 *#########################################################################
     
    2625 *########################################################################
    2726 */
     27package org.greenstone.gatherer.gui;
     28
    2829import java.math.BigInteger;
    2930import javax.swing.JProgressBar;
    3031import javax.swing.SwingUtilities;
     32
    3133/** A progress bar that doesn't pack a sad when you feed it longs (such as the sizes of files) which get mangled into negative numbers. I know how it feels, as I often have negative progress. Also tries to be efficent when updating the JProgressBar, so only updates when the value actually changes, which become necessary when you move a large number of files with millions of bytes (where upon shifting a file of a thousand bytes would be pretty insignificant, maybe not even a percent, but would fire several progress updates).
    3234 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    4345    private SafeSetString safe_set_string = null;
    4446    private SafeSetValue safe_set_value = null;
     47
    4548    public LongProgressBar() {
    4649    super(0, 100);
  • trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java

    r5564 r5589  
    1 package org.greenstone.gatherer.gui;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui;
     38
    3839import java.awt.*;
    3940import java.awt.event.*;
  • trunk/gli/src/org/greenstone/gatherer/gui/ModalDialog.java

    r5304 r5589  
    3232 */
    3333package org.greenstone.gatherer.gui;
     34
    3435import java.awt.*;
    3536import javax.swing.*;
     
    4243    /** true if this dialog is currently waiting some thread. */
    4344    protected boolean waiting = false;
     45
    4446    /** Constructor.
    4547     */
    4648    public ModalDialog() {
    4749    super((Frame)null, "", false);
    48    
    4950    }
     51
    5052    /** Constructor.
    5153     * @param parent the Dialog which is the owener of this dialog.
     
    5456    super(parent, "", false);
    5557    }
     58
    5659    /** Constructor.
    5760     * @param parent the Dialog which is the owener of this dialog.
     
    6164    super(parent, "", false);
    6265    this.modal = modal;
    63          
    6466    }
    6567   
     
    8991    super(parent, "", false);
    9092    }
     93
    9194    /** Constructor.
    9295     * @param parent the Frame which is the owener of this dialog.
     
    106109    super (parent, title, false);
    107110    }
     111
    108112    /** Constructor.
    109113     * @param parent the Frame which is the owener of this dialog.
  • trunk/gli/src/org/greenstone/gatherer/gui/NewFolderPrompt.java

    r5564 r5589  
    4949    Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    5050    cancel_button = new JButton();
    51     Dictionary.setBoth(cancel_button, "General.Cancel", "General.Good_Cancel_Tooltip");
     51    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    5252
    5353    // Connection
  • trunk/gli/src/org/greenstone/gatherer/gui/NonWhitespaceField.java

    r4939 r5589  
    2626 */
    2727package org.greenstone.gatherer.gui;
     28
    2829/**************************************************************************************
    2930 * Written:     04/07/03
  • trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java

    r5571 r5589  
    1414import org.greenstone.gatherer.checklist.Entry;
    1515import org.greenstone.gatherer.gui.ModalDialog;
    16 import org.greenstone.gatherer.gui.NumberField;
    1716import org.greenstone.gatherer.gui.SimpleMenuBar;
    1817import org.greenstone.gatherer.util.StaticStrings;
     
    4847    private JTextField library_path_field;
    4948    private JTextField proxy_host_field;
    50     private JTextField proxy_port_field;
     49    private JSpinner proxy_port_field;
    5150    private Preferences self;
    5251
     
    144143    proxy_port_label = new JLabel();
    145144    proxy_port_label.setPreferredSize(LABEL_SIZE);
    146     Dictionary.registerText(proxy_port_label, "Preferences.Connection.Proxy_Port");
    147     proxy_port_field = new NumberField(Gatherer.config.getString("general.proxy_port", true));
     145    Dictionary.registerText(proxy_port_label, "Preferences.Connection.Proxy_Port");
     146    String port_value = Gatherer.config.getString("general.proxy_port", true);
     147    proxy_port_field = new JSpinner(new SpinnerNumberModel((new Integer(port_value)).intValue(), 0, 65535, 1));
    148148    proxy_port_field.setEnabled(currently_enabled);
    149149    Dictionary.registerTooltip(proxy_port_field, "Preferences.Connection.Proxy_Port_Tooltip");
     
    417417        Gatherer.config.set("general.use_proxy", true, use_proxy_checkbox.isSelected());
    418418        Gatherer.config.setString("general.proxy_host", true, proxy_host_field.getText());
    419         Gatherer.config.setString("general.proxy_port", true, proxy_port_field.getText());
     419        Gatherer.config.setString("general.proxy_port", true, proxy_port_field.getValue() + "");
    420420        Gatherer.setProxy();
    421421
  • trunk/gli/src/org/greenstone/gatherer/gui/SmarterTable.java

    r4675 r5589  
    3535 *########################################################################
    3636 */
    37 
    38  
    39 
    40 
    41 
    42 
    4337package org.greenstone.gatherer.gui;
    4438
    45 import java.awt.Color;
    46 import java.awt.Component;
     39import java.awt.*;
    4740import javax.swing.JTable;
    48 import javax.swing.table.DefaultTableCellRenderer;
    49 import javax.swing.table.JTableHeader;
    50 import javax.swing.table.TableCellRenderer;
    51 import javax.swing.table.TableColumn;
     41import javax.swing.table.*;
    5242
    5343/** An extension of a JTable that allows for the background, foreground, heading and selection colors to be set in single actions. */
  • trunk/gli/src/org/greenstone/gatherer/gui/SmarterTextArea.java

    r5564 r5589  
    8484    }
    8585    }
    86 
    87    
    8886}
  • trunk/gli/src/org/greenstone/gatherer/gui/SmarterTree.java

    r4675 r5589  
    3535 *########################################################################
    3636 */
    37 
    38  
    39 
    40 
    41 
    42 
    4337package org.greenstone.gatherer.gui;
    4438
    4539import java.awt.Color;
    4640import javax.swing.JTree;
    47 import javax.swing.tree.DefaultTreeCellRenderer;
    48 import javax.swing.tree.TreeModel;
     41import javax.swing.tree.*;
    4942
    5043/** An extension of a JTree that allows for the background, foreground and selection colors to be set in single actions. */
  • trunk/gli/src/org/greenstone/gatherer/gui/Splash.java

    r4675 r5589  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.gui;
    3738
    38  
     39import java.awt.*;
     40import javax.swing.*;
     41import org.greenstone.gatherer.util.Utility;
    3942
    40 
    41 
    42 
    43 package org.greenstone.gatherer.gui;
    44 import java.awt.BorderLayout;
    45 import java.awt.Dimension;
    46 import java.awt.Toolkit;
    47 import javax.swing.BorderFactory;
    48 import javax.swing.JDialog;
    49 import javax.swing.JLabel;
    50 import javax.swing.JPanel;
    51 import org.greenstone.gatherer.util.Utility;
    5243final public class Splash
    5344    extends JDialog {
    5445    private Dimension size = new Dimension(450,450);
     46
    5547    public Splash() {
    5648    super();
     
    6254    content_pane.setLayout(new BorderLayout());
    6355    content_pane.add(logo, BorderLayout.CENTER);
     56
    6457    // Center and display
    6558    Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize();
    6659    setLocation((screen_size.width - size.width) / 2, (screen_size.height - size.height) / 2);
    67     show();            
     60    show();     
    6861    }
    69     /** Destructor. */
     62
     63    /** Destructor */
    7064    public void destroy() {
    7165    dispose();
  • trunk/gli/src/org/greenstone/gatherer/gui/WarningDialog.java

    r5571 r5589  
    7777    JLabel icon_label = new JLabel(Utility.getImage("gatherer_medium.gif"));
    7878
    79     // SmarterTextArea text_area = new SmarterTextArea("", false);
    8079    JTextArea text_area = new JTextArea();
    8180    text_area.setCaretPosition(0);
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/Autofilter.java

    r5156 r5589  
    2626 */
    2727package org.greenstone.gatherer.gui.metaaudit;
     28
    2829/**************************************************************************************
    2930 * Title:        Gatherer
     
    3839import java.util.ArrayList;
    3940import org.greenstone.gatherer.util.StaticStrings;
     41
    4042/** An Autofilter object stores the filters set on a single column, and provides a method for determining if a certain value passes the filter.
    4143 * @author John Thompson
     
    384386    }
    385387}
    386 
    387 
    388 
    389 
    390 
    391 
    392 
    393 
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/AutofilterDialog.java

    r5564 r5589  
    393393    }
    394394}
    395 
    396 
    397 
    398 
    399 
    400 
    401 
    402 
    403 
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/Filter.java

    r4366 r5589  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.gui.metaaudit;
    3738
    38  
    39 
    40 
    41 
    42 
    43 /* GPL_HEADER */
    44 package org.greenstone.gatherer.gui.metaaudit;
    4539/**************************************************************************************
    4640 * Title:        Gatherer
     
    5852import javax.swing.table.TableModel;
    5953import org.greenstone.gatherer.gui.metaaudit.Autofilter;
     54
    6055/** This class essentially manages the autofilters applied to the metaaudit table.
    6156 * @author John Thompson
     
    7065    /** Constructor.
    7166     * @param columns The number of columns this Filter will be expected to filter, as an <i>int</i>.
    72       */
     67     */
    7368    public Filter(int columns) {
    7469    filters = new Autofilter[columns];
    7570    }
    7671    /** Add a TableModelFilterListener to the TableModelFilter.
    77       * @param listener The <strong>TableModelFilterListener</strong> to add, if it isn't already registered.
    78       */
     72     * @param listener The <strong>TableModelFilterListener</strong> to add, if it isn't already registered.
     73     */
    7974    public synchronized void addTableModelFilterListener(TableModelFilterListener listener) {
    8075    if (!listeners.contains(listener)) {
     
    8378    }
    8479    /** Remove a filter from a column.
    85       * @param column The column number to remove the filter from, as an <i>int</i>.
    86       */
     80     * @param column The column number to remove the filter from, as an <i>int</i>.
     81     */
    8782    public void clearFilter(int column) {
    8883    if(filters[column] != null) {
     
    9186    }
    9287    /** Determine if a certain row should be shown in the table by checking it against all the current filters.
    93       * @param model The <strong>TableModel</strong> the row is from.
    94       * @param row The row number as an <i>int</i>
    95       * @return <i>true</i> if the rows data matches all autofilters set and should be displayed, <i>false</i> otherwise.
    96       */
     88     * @param model The <strong>TableModel</strong> the row is from.
     89     * @param row The row number as an <i>int</i>
     90     * @return <i>true</i> if the rows data matches all autofilters set and should be displayed, <i>false</i> otherwise.
     91     */
    9792    public boolean filter(TableModel model, int row) {
    9893    boolean result = true;
     
    106101    }
    107102    /** Retrieve the autofilter associated with a certain column.
    108       * @param column The column number as an <i>int</i>.
    109       * @return The <strong>Autofilter</strong> assigned to that column.
    110       */
     103     * @param column The column number as an <i>int</i>.
     104     * @return The <strong>Autofilter</strong> assigned to that column.
     105     */
    111106    public Autofilter getFilter(int column) {
    112107    Autofilter filter = filters[column];
     
    118113    }
    119114    /** Determine if a certain column is filtered.
    120       * @param column The column number as an <i>int</i>.
    121       * @return <i>true</i> if there is an active autofilter assigned to this column, <i>false</i> otherwise.
    122       */
     115     * @param column The column number as an <i>int</i>.
     116     * @return <i>true</i> if there is an active autofilter assigned to this column, <i>false</i> otherwise.
     117     */
    123118    public boolean isFiltered(int column) {
    124119    boolean result = false;
     
    129124    }
    130125    /** Remove a TableModelFilterListener from the TableModelFilter.
    131       * @param listener The <strong>TableModelFilterListener</strong> to remove.
    132       */
     126     * @param listener The <strong>TableModelFilterListener</strong> to remove.
     127     */
    133128    public synchronized  void removeTableModelFilterListener(TableModelFilterListener listener) {
    134129    listeners.removeElement(listener);
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/HeaderListener.java

    r4366 r5589  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.gui.metaaudit;
    3738
    38  
    39 
    40 
    41 
    42 
    43 /* GPL_HEADER */
    44 package org.greenstone.gatherer.gui.metaaudit;
    4539/**************************************************************************************
    4640 * Title:        Gatherer
     
    9185    }
    9286}
    93 
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/HeaderRenderer.java

    r4366 r5589  
    1 package org.greenstone.gatherer.gui.metaaudit;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui.metaaudit;
     38
    3839import java.awt.*;
    3940import javax.swing.*;
     
    4243import org.greenstone.gatherer.gui.metaaudit.MetaAuditTable;
    4344import org.greenstone.gatherer.util.Utility;
     45
    4446/** This custom button renderer replaces the boring old column headers with clickable versions which are based on JToggleButtons.
    4547 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    4951    extends JToggleButton
    5052    implements TableCellRenderer {
     53
    5154    /** The constructor sets up a margin around the button, and adds the filter icons.
    5255     * @see org.greenstone.gatherer.util.Utility
     
    5760    setSelectedIcon(Utility.getImage("filter-on.gif"));
    5861    }
     62
    5963    /** Called to create the component to be used as the 'rubber-stamp' for the table cell given the follwing arguments.
    60       * @param table The <strong>JTable</strong> that is asking the renderer to draw; can be <i>null</i>.
    61       * @param value The value of the cell to be rendered as an <strong>Object</strong>. It is up to the specific renderer to interpret and draw the value. For example, if value is the string "true", it could be rendered as a string or it could be rendered as a check box that is checked. null is a valid value.
    62       * @param isSelected <i>true</i> if the cell is to be rendered with the selection highlighted; otherwise <i>false</i>.
    63       * @param hasFocus If <i>true</i>, render cell appropriately. For example, put a special border on the cell, if the cell can be edited, render in the color used to indicate editing.
    64       * @param row The row index of the cell being drawn as an <i>int</i>. When drawing the header, the value of row is -1.
    65       * @param column The column index of the cell being drawn as an <i>int</i>.
    66       * @see org.greenstone.gatherer.gui.metaaudit.MetaAuditTable
    67       */
     64     * @param table The <strong>JTable</strong> that is asking the renderer to draw; can be <i>null</i>.
     65     * @param value The value of the cell to be rendered as an <strong>Object</strong>. It is up to the specific renderer to interpret and draw the value. For example, if value is the string "true", it could be rendered as a string or it could be rendered as a check box that is checked. null is a valid value.
     66     * @param isSelected <i>true</i> if the cell is to be rendered with the selection highlighted; otherwise <i>false</i>.
     67     * @param hasFocus If <i>true</i>, render cell appropriately. For example, put a special border on the cell, if the cell can be edited, render in the color used to indicate editing.
     68     * @param row The row index of the cell being drawn as an <i>int</i>. When drawing the header, the value of row is -1.
     69     * @param column The column index of the cell being drawn as an <i>int</i>.
     70     * @see org.greenstone.gatherer.gui.metaaudit.MetaAuditTable
     71     */
    6872    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    6973    setText(value.toString());
    7074    MetaAuditTable temp = (MetaAuditTable) table;
    71     if(temp != null) { // And it may if this is called during table init.
     75    if (temp != null) { // And it may if this is called during table init.
    7276        setSelected(temp.isFiltered(column));
    7377    }
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/MetaAuditRenderer.java

    r4366 r5589  
    3535 *########################################################################
    3636 */
    37 
    38  
    39 
    40 
    41 
    42 
    4337package org.greenstone.gatherer.gui.metaaudit;
    4438
    45 import java.awt.Component;
    46 import java.awt.GridLayout;
     39import java.awt.*;
    4740import java.util.ArrayList;
    48 import javax.swing.JLabel;
    49 import javax.swing.JPanel;
    50 import javax.swing.JTable;
     41import javax.swing.*;
    5142import javax.swing.table.DefaultTableCellRenderer;
    5243
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/MetaAuditTable.java

    r4640 r5589  
    1 package org.greenstone.gatherer.gui.metaaudit;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui.metaaudit;
     38
    3839import de.qfs.lib.gui.*;
    3940import java.awt.*;
     
    203204    }
    204205}
    205 
  • trunk/gli/src/org/greenstone/gatherer/mem/Attribute.java

    r4365 r5589  
    3535 *########################################################################
    3636 */
    37 
    38  
    39 
    40 
    41 
    42 
    4337package org.greenstone.gatherer.mem;
    4438
  • trunk/gli/src/org/greenstone/gatherer/mem/AttributeTableModel.java

    r4535 r5589  
    1 package org.greenstone.gatherer.mem;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.mem;
     38
    3839import java.awt.*;
    3940import java.util.*;
  • trunk/gli/src/org/greenstone/gatherer/mem/MEMModel.java

    r4501 r5589  
    1 package org.greenstone.gatherer.mem;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.mem;
     38
    3839import javax.swing.tree.DefaultTreeModel;
    3940import org.greenstone.gatherer.Gatherer;
    4041import org.greenstone.gatherer.mem.MEMNode;
    41 import org.greenstone.gatherer.msm.MetadataSet;
    4242import org.greenstone.gatherer.util.SynchronizedTreeModelTools;
    4343/**
  • trunk/gli/src/org/greenstone/gatherer/mem/MetadataEditorManager.java

    r5564 r5589  
    4444import javax.swing.text.*;
    4545import javax.swing.tree.*;
     46import org.greenstone.gatherer.Dictionary;
    4647import org.greenstone.gatherer.Gatherer;
    4748import org.greenstone.gatherer.cdm.LanguageListCellRenderer;
     
    5152import org.greenstone.gatherer.gui.SmarterTable;
    5253import org.greenstone.gatherer.gui.SmarterTree;
     54import org.greenstone.gatherer.gui.SimpleMenuBar;
     55import org.greenstone.gatherer.gui.ModalDialog;
    5356import org.greenstone.gatherer.mem.Attribute;
    5457import org.greenstone.gatherer.mem.AttributeTableModel;
     
    6063import org.greenstone.gatherer.valuetree.GValueNode;
    6164import org.w3c.dom.*;
    62 import org.greenstone.gatherer.gui.SimpleMenuBar;
    63 import org.greenstone.gatherer.gui.ModalDialog;
    6465
    6566/** Provides a GUI and relevant suite of tools for the editing of the metadata set associated with this collection. Again I have tried to capture a file manager type feel, with a tree showing the various set-element relations to the left of the dialog, and the right side showing details on the current tree selection. When a set is selected these details include a list of attributes, while when an element is selected this list is joined by another showing assigned values. In order for the editor to be stable and consistant with the rest of the tool, care must be taken for fire appropriate events whenever the sets are changed. There is also the addded complexity of determining what actions have to occur in order for a users edit of an assigned value to be completed, i.e. if the user chooses to remove a value then a call must be made to record_set.root.removeMetadata() to ensure all such values are actually removed, so it is not enough just to remove the value from the value model.
     
    143144    this.self = this;
    144145
    145     dialog_options[0] = Gatherer.dictionary.get("General.OK");
    146     dialog_options[1] = Gatherer.dictionary.get("General.Cancel");
     146    dialog_options[0] = Dictionary.newget("General.OK");
     147    dialog_options[1] = Dictionary.newget("General.Cancel");
     148
    147149    // Creation
    148150    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    149151    setModal(true);
    150152    setSize(SIZE);
    151     setTitle(get("MEM.Title"));
    152153    setJMenuBar(new SimpleMenuBar("editingmetadatasets"));
     154    Dictionary.setText(this, "MEM.Title");
     155
    153156    JPanel content_pane = (JPanel) getContentPane();
    154157    content_pane.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false));
     
    179182    JPanel set_name_pane = new JPanel();
    180183    set_name_pane.setOpaque(false);
    181     JLabel set_name_label = new JLabel(get("MEM.Name"));
     184    JLabel set_name_label = new JLabel();
    182185    set_name_label.setOpaque(false);
    183186    set_name_label.setPreferredSize(LABEL_SIZE);
     187    Dictionary.setText(set_name_label, "MEM.Name");
    184188    set_name = new JLabel();
    185189    set_name.setBorder(BorderFactory.createLoweredBevelBorder());
     
    207211    JPanel element_name_pane = new JPanel();
    208212    element_name_pane.setOpaque(false);
    209     JLabel element_name_label = new JLabel(get("MEM.Name"));
     213    JLabel element_name_label = new JLabel();
    210214    element_name_label.setOpaque(false);
    211215    element_name_label.setPreferredSize(LABEL_SIZE);
     216    Dictionary.setText(element_name_label, "MEM.Name");
    212217    element_name = new JLabel();
    213218    element_name.setBorder(BorderFactory.createLoweredBevelBorder());
     
    243248
    244249    JPanel element_novalues_pane = new JPanel();
    245        
     250
    246251    keep_root_expanded_listener = new KeepTreeRootExpandedListener();
    247252
     
    250255    JPanel profile_name_pane = new JPanel();
    251256    profile_name_pane.setOpaque(false);
    252     JLabel profile_name_label = new JLabel(get("MEM.Name"));
     257    JLabel profile_name_label = new JLabel();
    253258    profile_name_label.setOpaque(false);
    254259    profile_name_label.setPreferredSize(LABEL_SIZE);
     260    Dictionary.setText(profile_name_label, "MEM.Name");
    255261    profile_name = new JLabel();
    256262    profile_name.setBorder(BorderFactory.createLoweredBevelBorder());
    257263    profile_name.setOpaque(false);
    258          
     264
    259265    JPanel profile_attributes_pane = new JPanel();
    260266    profile_attributes_pane.setOpaque(false);
     
    277283    JPanel button_label_pane = new JPanel();
    278284    button_label_pane.setOpaque(false);
    279     JLabel attribute_label = new JLabel(get("MEM.Attribute"));
     285
     286    JLabel attribute_label = new JLabel();
    280287    attribute_label.setOpaque(false);
    281     //attribute_label.setHorizontalAlignment(JLabel.CENTER);
    282288    attribute_label.setPreferredSize(LABEL_SIZE);
    283     JLabel element_label = new JLabel(get("MEM.Element"));
     289    Dictionary.setText(attribute_label, "MEM.Attribute");
     290
     291    JLabel element_label = new JLabel();
    284292    element_label.setOpaque(false);
    285     //element_label.setHorizontalAlignment(JLabel.CENTER);
    286293    element_label.setPreferredSize(LABEL_SIZE);
    287     JLabel file_label = new JLabel(get("MEM.File"));
     294    Dictionary.setText(element_label, "MEM.Element");
     295
     296    JLabel file_label = new JLabel();
    288297    file_label.setOpaque(false);
    289     //element_label.setHorizontalAlignment(JLabel.CENTER);
    290298    file_label.setPreferredSize(LABEL_SIZE);
    291     JLabel set_label = new JLabel(get("MEM.Set"));
     299    Dictionary.setText(file_label, "MEM.File");
     300
     301    JLabel set_label = new JLabel();
    292302    set_label.setOpaque(false);
    293     //set_label.setHorizontalAlignment(JLabel.CENTER);
    294303    set_label.setPreferredSize(LABEL_SIZE);
    295     JLabel value_label = new JLabel(get("MEM.Value"));
     304    Dictionary.setText(set_label, "MEM.Set");
     305
     306    JLabel value_label = new JLabel();
    296307    value_label.setOpaque(false);
    297     //value_label.setHorizontalAlignment(JLabel.CENTER);
    298308    value_label.setPreferredSize(LABEL_SIZE);
     309    Dictionary.setText(value_label, "MEM.Value");
    299310
    300311    JPanel inner_button_pane = new JPanel();
    301312    inner_button_pane.setOpaque(false);
    302     add_attribute = new JButton(get("MEM.Add"));
    303     add_element = new JButton(get("MEM.Add"));
    304     add_file = new JButton(get("MEM.Add"));
    305     add_set = new JButton(get("MEM.Add"));
    306     add_value = new JButton(get("MEM.Add"));
    307     edit_attribute = new JButton(get("MEM.Edit"));
    308     edit_value = new JButton(get("MEM.Edit"));
    309     remove_attribute = new JButton(get("MEM.Remove"));
    310     remove_element = new JButton(get("MEM.Remove"));
    311     remove_file = new JButton(get("MEM.Remove"));
    312     remove_set = new JButton(get("MEM.Remove"));
    313     remove_value = new JButton(get("MEM.Remove"));
     313    add_attribute = new JButton();
     314    Dictionary.setBoth(add_attribute, "MEM.Add", "MEM.Add_Attribute_Tooltip");
     315    add_element = new JButton();
     316    Dictionary.setBoth(add_element, "MEM.Add", "MEM.Add_Element_Tooltip");
     317    add_file = new JButton();
     318    Dictionary.setBoth(add_file, "MEM.Add", "MEM.Add_File_Tooltip");
     319    add_set = new JButton();
     320    Dictionary.setBoth(add_set, "MEM.Add", "MEM.Add_Set_Tooltip");
     321    add_value = new JButton();
     322    Dictionary.setBoth(add_value, "MEM.Add", "MEM.Add_Value_Tooltip");
     323
     324    edit_attribute = new JButton();
     325    Dictionary.setBoth(edit_attribute, "MEM.Edit", "MEM.Edit_Attribute_Tooltip");
     326    edit_value = new JButton();
     327    Dictionary.setBoth(edit_value, "MEM.Edit", "MEM.Edit_Value_Tooltip");
     328
     329    remove_attribute = new JButton();
     330    Dictionary.setBoth(remove_attribute, "MEM.Remove", "MEM.Remove_Attribute_Tooltip");
     331    remove_element = new JButton();
     332    Dictionary.setBoth(remove_element, "MEM.Remove", "MEM.Remove_Element_Tooltip");
     333    remove_file = new JButton();
     334    Dictionary.setBoth(remove_file, "MEM.Remove", "MEM.Remove_File_Tooltip");
     335    remove_set = new JButton();
     336    Dictionary.setBoth(remove_set, "MEM.Remove", "MEM.Remove_Set_Tooltip");
     337    remove_value = new JButton();
     338    Dictionary.setBoth(remove_value, "MEM.Remove", "MEM.Remove_Value_Tooltip");
    314339    setControls(false, false, false, false, false, false, false, false, false, false, false, false);
    315340
    316     close = new JButton(get("General.Close"));
     341    close = new JButton();
     342    Dictionary.setBoth(close, "General.Close", "General.Close_Tooltip");
    317343
    318344    add_element_action_listener = new AddElementActionListener();
     
    331357    JPanel edit_set_pane = new JPanel();
    332358    edit_set_pane.setOpaque(false);
     359
    333360    // Connection
    334 
    335361    add_attribute.addActionListener(add_or_edit_attribute_action_listener);
    336362    add_element.addActionListener(add_element_action_listener);
     
    361387    set_attributes_scroll.setViewportView(set_attributes);
    362388
    363     set_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Attributes")), BorderFactory.createEmptyBorder(2,2,2,2)));
     389    set_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Attributes")), BorderFactory.createEmptyBorder(2,2,2,2)));
    364390    set_attributes_pane.setLayout(new BorderLayout());
    365391    set_attributes_pane.add(set_attributes_scroll, BorderLayout.CENTER);
    366392       
    367     set_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Set_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
     393    set_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Set_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
    368394    set_details_pane.setLayout(new BorderLayout());
    369395    //set_details_pane.add(set_name_pane, BorderLayout.NORTH);
    370396    set_details_pane.add(set_attributes_pane, BorderLayout.CENTER);
    371          
     397
    372398    element_name_pane.setLayout(new BorderLayout());
    373399    element_name_pane.add(element_name_label, BorderLayout.WEST);
     
    376402    element_attributes_scroll.setViewportView(element_attributes);
    377403
    378     element_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Attributes")), BorderFactory.createEmptyBorder(2,2,2,2)));
     404    element_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Attributes")), BorderFactory.createEmptyBorder(2,2,2,2)));
    379405    element_attributes_pane.setLayout(new BorderLayout());
    380406    element_attributes_pane.add(element_attributes_scroll, BorderLayout.CENTER);
    381407         
    382     element_values_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Values")), BorderFactory.createEmptyBorder(2,2,2,2)));
     408    element_values_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Values")), BorderFactory.createEmptyBorder(2,2,2,2)));
    383409    //element_values_pane.setLayout(new BorderLayout());
    384410    //element_values_pane.add(new JScrollPane(element_values), BorderLayout.CENTER);
     
    386412    element_values_pane.add(element_novalues_pane, BLANK);
    387413    element_values_pane.add(new JScrollPane(element_values), VALUES);
    388          
     414
    389415    element_inner_pane.setLayout(new GridLayout(2,1));
    390416    element_inner_pane.add(element_attributes_pane);
    391417    element_inner_pane.add(element_values_pane);
    392418         
    393     element_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Element_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
     419    element_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Element_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
    394420    element_details_pane.setLayout(new BorderLayout());
    395421    //element_details_pane.add(element_name_pane, BorderLayout.NORTH);
     
    399425    profile_name_pane.add(profile_name_label, BorderLayout.WEST);
    400426    profile_name_pane.add(profile_name, BorderLayout.CENTER);
    401                
     427
    402428    profile_attributes_scroll.setViewportView(profile_attributes);
    403429
    404     profile_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Profiles")), BorderFactory.createEmptyBorder(2,2,2,2)));
     430    profile_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Profiles")), BorderFactory.createEmptyBorder(2,2,2,2)));
    405431    profile_attributes_pane.setLayout(new BorderLayout());
    406432    profile_attributes_pane.add(profile_attributes_scroll, BorderLayout.CENTER);
    407        
    408     profile_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Profile_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
     433
     434    profile_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Profile_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
    409435    profile_details_pane.setLayout(new BorderLayout());
    410436    //profile_details_pane.add(profile_name_pane, BorderLayout.NORTH);
    411437    profile_details_pane.add(profile_attributes_pane, BorderLayout.CENTER);
    412          
     438
    413439    details_pane.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
    414440    details_pane.setLayout(card_layout);
     
    488514    mds_tree = null;
    489515    target = null;
     516
    490517    // Dispose of inner dialogs
    491     if(add_element_action_listener != null) {
     518    if (add_element_action_listener != null) {
    492519        add_element_action_listener.dispose();
    493520        add_element_action_listener = null;
    494521    }
    495     if(add_or_edit_attribute_action_listener != null) {
     522    if (add_or_edit_attribute_action_listener != null) {
    496523        add_or_edit_attribute_action_listener.dispose();
    497524        add_or_edit_attribute_action_listener = null;
    498525    }
    499     if(add_or_edit_value_action_listener != null) {
     526    if (add_or_edit_value_action_listener != null) {
    500527        add_or_edit_value_action_listener.dispose();
    501528        add_or_edit_value_action_listener = null;
    502529    }
    503     ///ystem.err.println("Dispose MetadataEditorManager.");
    504530    super.dispose();
    505531    }
    506532
    507     private String get(String key) {
    508     return get(key, (String[])null);
    509     }
    510      
    511     private String get(String key, String arg) {
    512     String[] args = new String[1];
    513     args[0] = arg;
    514     return get(key, args);
    515     }
    516 
    517     private String get(String key, String[] args) {
    518     if(key.indexOf(".") == -1) {
    519         key = "MEM." + key;
    520     }
    521     return Gatherer.dictionary.get(key, args);
    522     }
    523533     
    524534    private void setControls(boolean a_s, boolean r_s, boolean a_f, boolean r_f, boolean a_e, boolean r_e, boolean a_a, boolean e_a, boolean r_a, boolean a_v, boolean e_v, boolean r_v) {
     
    554564        setSize(ADD_OR_EDIT_ATTRIBUTE_SIZE);
    555565        name_to_values = new HashMap();
     566
    556567        // Creation
    557568        JPanel content_pane = (JPanel) getContentPane();
     
    562573        JPanel target_pane = new JPanel();
    563574        target_pane.setOpaque(false);
    564         JLabel target_label = new JLabel(get("MEM.Target"));
     575        JLabel target_label = new JLabel();
    565576        target_label.setOpaque(false);
    566577        target_label.setPreferredSize(LABEL_SIZE);
     578        Dictionary.setText(target_label, "MEM.Target");
    567579        target = new JLabel();
    568580        target.setOpaque(false);
    569581
    570 
    571582        JPanel name_pane = new JPanel();
    572583        name_pane.setOpaque(false);
    573         JLabel name_label = new JLabel(get("MEM.Name"));
     584        JLabel name_label = new JLabel();
    574585        name_label.setOpaque(false);
    575586        name_label.setPreferredSize(LABEL_SIZE);
     587        Dictionary.setText(name_label, "MEM.Name");
    576588        name = new GComboBox();
    577589        name.setEditable(true);
     590        Dictionary.setTooltip(name, "MEM.Attribute_Name_Tooltip");
    578591
    579592        JPanel language_pane = new JPanel();
    580593        language_pane.setOpaque(false);
    581         JLabel language_label = new JLabel(get("MEM.Language"));
     594        JLabel language_label = new JLabel();
    582595        language_label.setOpaque(false);
    583596        language_label.setPreferredSize(LABEL_SIZE);
     597        Dictionary.setText(language_label, "MEM.Language");
    584598        language_box = new JComboBox(Gatherer.g_man.config_pane.getLanguageCodes().toArray());
    585599        language_box.setRenderer(new LanguageListCellRenderer());
     600        Dictionary.setTooltip(language_box, "MEM.Attribute_Language_Tooltip");
    586601
    587602        JPanel center_pane = new JPanel();
    588603        center_pane.setOpaque(false);
    589         value = new ComboArea(get("MEM.Values"), LABEL_SIZE);
     604        value = new ComboArea(Dictionary.newget("MEM.Values"), LABEL_SIZE);
    590605        value.setOpaque(false);
     606
    591607        JTextArea v_text_area = (JTextArea) value.getTextComponent();
    592608        v_text_area.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    594610        v_text_area.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    595611        v_text_area.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     612        Dictionary.setTooltip(v_text_area, "MEM.Attribute_Value_Tooltip");
     613
    596614        JPanel button_pane = new JPanel();
    597615        button_pane.setOpaque(false);
    598         ok_button = new JButton(get("General.OK"));
    599         cancel_button = new JButton(get("General.Cancel"));
    600                 // Connection
     616        ok_button = new JButton();
     617        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     618        cancel_button = new JButton();
     619        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
     620
     621        // Connection
    601622        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    602623        cancel_button.addActionListener(this);
     
    604625        ok_button.addActionListener(this);
    605626        ok_button_enabler.add((JTextComponent)name.getEditor()); // Assuming the default editor is a JTextField!
    606                 // Layout
     627
     628        // Layout
    607629        target_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    608630        target_pane.setLayout(new BorderLayout());
    609631        target_pane.add(target_label, BorderLayout.WEST);
    610632        target_pane.add(target, BorderLayout.CENTER);
    611                
     633
    612634        language_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    613635        language_pane.setLayout(new BorderLayout());
     
    784806        if(source == add_attribute) {
    785807            add_type = true;
    786             setTitle(get("MEM.AddAttribute"));
     808            Dictionary.setText(this, "MEM.AddAttribute");
    787809            if(current_collection_file != null) {
    788810            // Name is empty in this one, however values must be the current elements in the collection.   
     
    809831            }
    810832            add_type = false;
    811             setTitle(get("MEM.EditAttribute"));
     833            Dictionary.setText(this, "MEM.EditAttribute");
    812834            String name_str = (String) model.getValueAt(current_attribute, 0);
    813835            String value_str = (String) model.getValueAt(current_attribute, model.getColumnCount() - 1);
     
    864886        else {
    865887        cont = false;
    866         JOptionPane.showMessageDialog(self, get("MEM.Attribute_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     888        JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Attribute_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    867889        }
    868890
     
    896918        else {
    897919        cont = false;
    898         JOptionPane.showMessageDialog(self, get("MEM.Attribute_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     920        JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Attribute_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    899921        }
    900922
     
    963985        JPanel center_pane = new JPanel();
    964986        center_pane.setOpaque(false);
     987
    965988        JPanel set_pane = new JPanel();
    966989        set_pane.setOpaque(false);
    967         JLabel set_label = new JLabel(get("MEM.Set"));
     990        JLabel set_label = new JLabel();
    968991        set_label.setOpaque(false);
    969992        set_label.setPreferredSize(LABEL_SIZE);
     993        Dictionary.setText(set_label, "MEM.Set");
    970994        set_field = new JLabel();
    971995        set_field.setOpaque(false);
     996
    972997        JPanel name_pane = new JPanel();
    973998        name_pane.setOpaque(false);
    974         JLabel name_label = new JLabel(get("MEM.Name"));
     999        JLabel name_label = new JLabel();
    9751000        name_label.setOpaque(false);
    9761001        name_label.setPreferredSize(LABEL_SIZE);
     1002        Dictionary.setText(name_label, "MEM.Name");
    9771003        name_field = new JTextField();
    9781004        name_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    9801006        name_field.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    9811007        name_field.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1008        Dictionary.setTooltip(name_field, "MEM.Element_Name_Tooltip");
     1009
    9821010        JPanel button_pane = new JPanel();
    9831011        button_pane.setOpaque(false);
    984         ok_button = new JButton(get("General.OK"));
    985         cancel_button = new JButton(get("General.Cancel"));
     1012
     1013        ok_button = new JButton();
     1014        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     1015        cancel_button = new JButton();
     1016        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
     1017
    9861018        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    987                 // Connection
     1019
     1020        // Connection
    9881021        cancel_button.addActionListener(this);
    9891022        ok_button.addActionListener(this);
    9901023        ok_button_enabler.add(name_field);
    991                 // Layout
     1024
     1025        // Layout
    9921026        set_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    9931027        set_pane.setLayout(new BorderLayout());
     
    10151049        setLocation((Gatherer.config.screen_size.width - ADD_ELEMENT_SIZE.width) / 2, (Gatherer.config.screen_size.height - ADD_ELEMENT_SIZE.height) / 2);
    10161050    }
     1051
    10171052    /** Any implementation of ActionListener must include this method so that we can be informed when an action as occured on our registered component, allowing us to
    10181053     * @param event An <strong>ActionEvent</strong> containing information about the event.
     
    10391074        // Otherwise show an error message and do not proceed.
    10401075        else {
    1041             JOptionPane.showMessageDialog(self, get("MEM.Element_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     1076            JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Element_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    10421077        }
    10431078        name_str = null;
     
    10461081        // Dispose
    10471082        setVisible(false);
    1048        
    10491083        }
    10501084        else {
     
    10591093            // Warn the user that they can't do that dave.
    10601094            else {
    1061             JOptionPane.showMessageDialog(self, get("MEM.Cannot_Add_Elements_To_Greenstone_MDS"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     1095            JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Cannot_Add_Elements_To_Greenstone_MDS"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    10621096            }
    10631097        }
     
    10861120        setModal(true);
    10871121        setSize(ADD_FILE_SIZE);
    1088                 // Creation
     1122        // Creation
    10891123        JPanel content_pane = (JPanel) getContentPane();
    10901124        content_pane.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false));
     
    10931127        JPanel profile_pane = new JPanel();
    10941128        profile_pane.setOpaque(false);
    1095         JLabel profile_label = new JLabel(get("MEM.Profile"));
     1129        JLabel profile_label = new JLabel();
    10961130        profile_label.setOpaque(false);
    10971131        profile_label.setPreferredSize(LABEL_SIZE);
     1132        Dictionary.setText(profile_label, "MEM.Profile");
     1133
    10981134        JPanel name_pane = new JPanel();
    10991135        name_pane.setOpaque(false);
    1100         JLabel name_label = new JLabel(get("MEM.Name"));
     1136        JLabel name_label = new JLabel();
    11011137        name_label.setOpaque(false);
    11021138        name_label.setPreferredSize(LABEL_SIZE);
     1139        Dictionary.setText(name_label, "MEM.Name");
    11031140        name_field = new JTextField();
    11041141        name_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    11061143        name_field.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    11071144        name_field.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1145        Dictionary.setTooltip(name_field, "MEM.Profile_Name_Tooltip");
     1146
    11081147        JPanel button_pane = new JPanel();
    11091148        button_pane.setOpaque(false);
    1110         ok_button = new JButton(get("General.OK"));
    1111         cancel_button = new JButton(get("General.Cancel"));
     1149
     1150        ok_button = new JButton();
     1151        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     1152        cancel_button = new JButton();
     1153        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
     1154
    11121155        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    1113                 // Connection
     1156
     1157        // Connection
    11141158        cancel_button.addActionListener(this);
    11151159        ok_button.addActionListener(this);
    11161160        ok_button_enabler.add(name_field);
    1117                 // Layout
     1161
     1162        // Layout
    11181163        profile_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    11191164        profile_pane.setLayout(new BorderLayout());
     
    11571202        // Otherwise warn the user and don't hide the prompt.
    11581203        else {
    1159             JOptionPane.showMessageDialog(self, get("MEM.File_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     1204            JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.File_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    11601205        }
    11611206        name_str = null;
     
    11631208        else if(source == cancel_button) {
    11641209        setVisible(false);
    1165 
    11661210        }
    11671211        else {
     
    11921236        setModal(true);
    11931237        setSize(ADD_SET_SIZE);
    1194         setTitle(get("MEM.AddSet"));
    1195                 // Creation
     1238        Dictionary.setText(this, "MEM.AddSet");
     1239
     1240        // Creation
    11961241        JPanel content_pane = (JPanel) getContentPane();
    11971242        content_pane.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false));
     
    12011246        JPanel namespace_pane = new JPanel();
    12021247        namespace_pane.setOpaque(false);
    1203         JLabel namespace_label = new JLabel(get("MEM.Namespace"));
     1248        JLabel namespace_label = new JLabel();
    12041249        namespace_label.setOpaque(false);
    12051250        namespace_label.setPreferredSize(LABEL_SIZE);
     1251        Dictionary.setText(namespace_label, "MEM.Namespace");
    12061252        namespace_field = new JTextField();
    12071253        namespace_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    12091255        namespace_field.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    12101256        namespace_field.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1257        Dictionary.setTooltip(namespace_field, "MEM.Set_Namespace_Tooltip");
    12111258
    12121259        JPanel name_pane = new JPanel();
    12131260        name_pane.setOpaque(false);
    1214         JLabel name_label = new JLabel(get("MEM.Name"));
     1261        JLabel name_label = new JLabel();
    12151262        name_label.setOpaque(false);
    12161263        name_label.setPreferredSize(LABEL_SIZE);
     1264        Dictionary.setText(name_label, "MEM.Name");
    12171265        name_field = new JTextField();
    12181266        name_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    12201268        name_field.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    12211269        name_field.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1270        Dictionary.setTooltip(name_field, "MEM.Set_Name_Tooltip");
    12221271
    12231272        JPanel button_pane = new JPanel();
    12241273        button_pane.setOpaque(false);
    1225         ok_button = new JButton(get("General.OK"));
    1226         ok_button.setEnabled(false);
    1227         cancel_button = new JButton(get("General.Cancel"));
     1274
     1275        ok_button = new JButton();
     1276        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     1277        cancel_button = new JButton();
     1278        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    12281279        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    1229                 // Connection
     1280
     1281        // Connection
    12301282        cancel_button.addActionListener(this);
    12311283        ok_button.addActionListener(this);
    12321284        ok_button_enabler.add(name_field);
    12331285        ok_button_enabler.add(namespace_field);
    1234                 // Layout
     1286
     1287        // Layout
    12351288        namespace_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    12361289        namespace_pane.setLayout(new BorderLayout());
     
    12771330        // Otherwise show a warning.
    12781331        else {
    1279             JOptionPane.showMessageDialog(self, get("MEM.Set_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     1332            JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Set_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    12801333        }
    12811334        name_str = null;
     
    13171370        this.setModal(true);
    13181371        this.setSize(ADD_OR_EDIT_VALUE_SIZE);
     1372
    13191373        // Create
    13201374        JPanel content_pane = (JPanel) getContentPane();
     
    13261380        JPanel subject_tree_pane = new JPanel();
    13271381        subject_tree_pane.setOpaque(false);
    1328         JLabel subject_tree_label = new JLabel(get("MEM.Subject"));
     1382        JLabel subject_tree_label = new JLabel();
    13291383        subject_tree_label.setOpaque(false);
     1384        Dictionary.setText(subject_tree_label, "MEM.Subject");
    13301385        subject_tree = new SmarterTree();
    13311386        subject_tree.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    13351390        JPanel value_pane = new JPanel();
    13361391        value_pane.setOpaque(false);
    1337         JLabel value_label = new JLabel(get("MEM.Value"));
     1392        JLabel value_label = new JLabel();
    13381393        value_label.setOpaque(false);
     1394        Dictionary.setText(value_label, "MEM.Value");
    13391395        value = new JTextArea();
    13401396        value.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    13421398        value.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    13431399        value.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1400        Dictionary.setTooltip(value, "MEM.Value_Tooltip");
     1401
    13441402        JPanel alias_pane = new JPanel();
    13451403        alias_pane.setOpaque(false);
    1346         JLabel alias_label = new JLabel(get("MEM.Alias"));
     1404        JLabel alias_label = new JLabel();
    13471405        alias_label.setOpaque(false);
    13481406        alias_label.setPreferredSize(LABEL_SIZE);
     1407        Dictionary.setText(alias_label, "MEM.Alias");
     1408
    13491409        alias = new JTextField();
    13501410        alias.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    13521412        alias.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    13531413        alias.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1414        Dictionary.setText(alias, "MEM.Alias_Tooltip");
     1415
    13541416        JPanel button_pane = new JPanel();
    13551417        button_pane.setOpaque(false);
    1356         ok_button = new JButton(get("General.OK"));
     1418
     1419        ok_button = new JButton();
    13571420        ok_button.setEnabled(false);
     1421        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     1422        cancel_button = new JButton();
     1423        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    13581424        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    1359         cancel_button = new JButton(get("General.Cancel"));
     1425
    13601426        // Connect
    13611427        ok_button_enabler.add(value);
     
    13631429        ok_button.addActionListener(this);
    13641430        subject_tree.addTreeSelectionListener(this);
     1431
    13651432        // Layout
    13661433        subject_tree_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
     
    14851552            value.setText("");
    14861553            alias.setText("");
    1487             setTitle(get("MEM.AddValue"));
     1554            Dictionary.setText(this, "MEM.AddValue");
    14881555        }
    14891556        else {
     
    14971564            value.setText(current_value_node.toString());
    14981565            alias.setText(current_value_node.getAlias());
    1499             setTitle(get("MEM.EditValue"));
     1566            Dictionary.setText(this, "MEM.EditValue");
    15001567        }
    15011568        model = null;
     
    15531620        // I don't know why this is causing a problem even after the dialog has been disposed, but it is.
    15541621        GValueModel value_model = Gatherer.c_man.msm.getValueTree(current_element);
    1555         if(value_model != null) {
     1622        if (value_model != null) {
    15561623        value_model.removeTreeModelListener(keep_root_expanded_listener);
    15571624        }
     
    15861653    public void actionPerformed(ActionEvent event) {
    15871654        if(current_attribute != -1) {
    1588         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.Attribute")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1655        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.Attribute")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    15891656        // Remove this attribute
    15901657        if(result == 0) {
     
    16341701    public void actionPerformed(ActionEvent event) {
    16351702        if(current_element != null) {
    1636         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.Element")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1703        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.Element")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    16371704        // Remove this attribute
    16381705        if(result == 0) {
     
    16621729    public void actionPerformed(ActionEvent event) {
    16631730        if(current_collection_file != null) {
    1664         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.File")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1731        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.File")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    16651732        // Remove the current collection file profile from the profiler.
    16661733        if(result == 0) {
     
    16871754    public void actionPerformed(ActionEvent event) {
    16881755        if(current_set != null) {
    1689         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.Set")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1756        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.Set")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    16901757        // Remove the currently selected set
    16911758        if(result == 0) {
     
    17121779    public void actionPerformed(ActionEvent event) {
    17131780        if(current_value_node != null) {                 
    1714         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.Value")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1781        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.Value")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    17151782        // Remove the current selected value
    17161783        if(result == 0) {
     
    18421909                String source = (String) sources.get(i);
    18431910                String action = Gatherer.c_man.msm.profiler.getAction(current_collection_file, source);
    1844                 if(action == null) {
    1845                 action = get("MEM.Ignore");
     1911                if (action == null) {
     1912                action = Dictionary.newget("MEM.Ignore");
    18461913                }
    18471914                attributes.add(new Attribute(source, action));
    18481915            }
    1849             atm = new AttributeTableModel(attributes, get("MEM.Source"), get("MEM.Target"), get("MEM.Ignore"));
     1916            atm = new AttributeTableModel(attributes, Dictionary.newget("MEM.Source"), Dictionary.newget("MEM.Target"), Dictionary.newget("MEM.Ignore"));
    18501917            //current_node.setModel(atm);
    18511918            }
     
    18611928            atm = current_node.getModel();
    18621929            if(atm == null) {
    1863             atm = new AttributeTableModel(current_element.getAttributes(), get("MEM.Name"), get("MEM.Language_Code"), get("MEM.Value"), "");
     1930            atm = new AttributeTableModel(current_element.getAttributes(), Dictionary.newget("MEM.Name"), Dictionary.newget("MEM.Language_Code"), Dictionary.newget("MEM.Value"), "");
    18641931            //current_node.setModel(atm);
    18651932            }
     
    18991966                attribute = null;
    19001967            }
    1901             atm = new AttributeTableModel(attributes, get("MEM.Name"), get("MEM.Value"), "");
     1968            atm = new AttributeTableModel(attributes, Dictionary.newget("MEM.Name"), Dictionary.newget("MEM.Value"), "");
    19021969            //current_node.setModel(atm);
    19031970            temp = null;
  • trunk/gli/src/org/greenstone/gatherer/msm/ExportMDSPrompt.java

    r5581 r5589  
    144144        export_button = new JButton();
    145145        export_button.setEnabled(false);
     146        export_button.setMnemonic(KeyEvent.VK_E);
    146147        Dictionary.setBoth(export_button, "MSMPrompt.File_Export", "MSMPrompt.File_Export_Tooltip");
    147148    }
     
    149150        export_button = new JButton();
    150151        export_button.setEnabled(true);
     152        export_button.setMnemonic(KeyEvent.VK_I);
    151153        Dictionary.setBoth(export_button, "MSMPrompt.File_Import", "MSMPrompt.File_Import_Tooltip");
    152154    }
    153155
    154156    cancel_button = new JButton();
    155     Dictionary.setBoth(cancel_button, "General.Cancel", "General.Cancel_Tooltip");
     157    cancel_button.setMnemonic(KeyEvent.VK_C);
     158    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    156159
    157160    // Listeners
  • trunk/gli/src/org/greenstone/gatherer/msm/GDMDocument.java

    r5305 r5589  
    1 package org.greenstone.gatherer.msm;
    21/**
    32 *#########################################################################
     
    2625 *########################################################################
    2726 */
     27package org.greenstone.gatherer.msm;
     28
    2829import java.io.*;
    2930import java.util.*;
     
    3738import org.greenstone.gatherer.valuetree.GValueNode;
    3839import org.w3c.dom.*;
     40
    3941/** This class wraps around a DOM Document providing methods for accessing the data within. In this case the DOM represents a Greenstone Directory metadata file. It provides the necessary functionality to create a new metadata.xml file.
    4042 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    5759    static final private String NAME_ATTRIBUTE = "name";
    5860    static final private String OVERWRITE = "overwrite";
     61
    5962    /** Constructor which creates a brand new metadata.xml document. */
    6063    public GDMDocument() {
     
    6265    this.base_document = Utility.parse(Utility.GREENSTONEDIRECTORYMETADATA_TEMPLATE, true);
    6366    }
     67
    6468    /** Constructor which parses an existing metadata.xml document. */
    6569    public GDMDocument(File file) {
     
    7175    }
    7276    }
     77
    7378    /** Constructor which wraps around an existing metadata.xml document. */
    7479    public GDMDocument(Document base_document) {
    7580    this.base_document = base_document;
    7681    }
     82
    7783    /** Add this metadata to the named file. There is one tricky thing to consider. Whenever a metadata entry is added it is taken to be accumulating except if it is the first added, in which case it overwrites! */
    7884    public void addMetadata(String filename, Metadata metadata) {
  • trunk/gli/src/org/greenstone/gatherer/msm/GDMManager.java

    r5581 r5589  
    1 package org.greenstone.gatherer.msm;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.msm;
     38
    3839import java.io.*;
    3940import java.util.*;
     
    4950import org.greenstone.gatherer.util.HashMap3D;
    5051import org.greenstone.gatherer.util.Utility;
    51 // import org.greenstone.gatherer.valuetree.GValueNode;
    5252import org.w3c.dom.*;
     53
    5354/** This object manages the metadata attached to file records. By storing all of the metadata in one place you garner several advantages. Firstly only one copy of each metadata object is retained, all actual entries are converted to references. Next you can immediately determine what metadata is assigned to an entire directory, thus the metadata.xml files can be built more effeciently (whereas the current 'optimal' method uses recursion through the tree contents). Finally, and perhaps most importantly, it allows for dynamic 'on demand' lookup of metadata. This is especially necessary with large collections, where the raw, unconnected metadata files could range into the tens of megabytes of memory and require hundreds of megabytes to read by in using serialization. Dynamic loading allows you to connect the metadata objects on load, reducing value node paths (possibly of hundreds of characters) down to a single reference pointer! At the very worst this object uses far less memory than the current method, and given that the current method is completely incapable of handling large collections, is necessary. The trade off of course is in time needed to load metadata.xml on demand, the worst possible case being the user selecting the root node of the collection tree of a large collection immediately after opening the collection. The subsequent attempt to build the metadata table will result in the metadata being loaded for every single file. But since this process is sequential and a small cache of metadata.xml files is implemented, and given that the table will actually be build on a separate thread, the wait should not be too arduous.<BR>
    5455    As for the size of the GDMParser cache, I was at first tempted to put around five. However after analysis of cache usage, I determined that no gain occured because of caching (in fact if everythings working as it should there should only ever be one call for a certain metadata.xml).
     
    8485    }
    8586    /** Destructor necessary for clean exit, subsequent to saving of metadata.xml files.
    86       * @see org.greenstone.gatherer.Gatherer
    87       * @see org.greenstone.gatherer.collection.CollectionManager
    88       * @see org.greenstone.gatherer.msm.GDMParser
    89       * @see org.greenstone.gatherer.msm.MetadataSetManager
    90       */
     87     * @see org.greenstone.gatherer.Gatherer
     88     * @see org.greenstone.gatherer.collection.CollectionManager
     89     * @see org.greenstone.gatherer.msm.GDMParser
     90     * @see org.greenstone.gatherer.msm.MetadataSetManager
     91     */
    9192    public void destroy() {
    9293    // Destroy all the cached documents.
     
    109110    }
    110111    /** Method that is called whenever an element within a set is changed or modified. Ensure all cached GDMDocuments are marked as stale.
    111       * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    112       */
     112     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
     113     */
    113114    public void elementChanged(MSMEvent event) {
    114115    for(Iterator values = values().iterator(); values.hasNext(); ) {
     
    119120    }
    120121    /** Retrieve the GreenstoneMetadataDocument that is associated with a certain file. If the document is in cache returns it. If the document exists but isn't in cache loads, caches, then returns it. Otherwise it creates a brand new document, caches it, then returns it.
    121       * @see org.greenstone.gatherer.msm.GDMParser
    122       */
     122     * @see org.greenstone.gatherer.msm.GDMParser
     123     */
    123124    public GDMDocument getDocument(File file) {
    124125    ///ystem.err.println("Get the GDMDocument for " + file.getAbsolutePath());
     
    137138    }
    138139    else {
    139                 // Now the two potential cache misses. The first requires us to load an existing metadata.xml
     140        // Now the two potential cache misses. The first requires us to load an existing metadata.xml
    140141        if(metadata_file.exists()) {
    141142        metadata_xml = new GDMDocument(metadata_file);
    142143        }
    143                 // The final case is where no current metadata.xml exists. Create a new one just by creating a new GDMDocument.
     144        // The final case is where no current metadata.xml exists. Create a new one just by creating a new GDMDocument.
    144145        else {
    145146        metadata_xml = new GDMDocument();
     
    206207    ///ystem.err.println("Start directory = " + start_file.getAbsolutePath());
    207208    while(!start_file.equals(collection_dir)) {
    208                 ///ystem.err.println("Blip!");
     209        ///ystem.err.println("Blip!");
    209210        search_files.add(0, new MetadataXMLFileSearch(start_file, filename));
    210211        if(filename != null) {
     
    215216        }
    216217        start_file = start_file.getParentFile();
    217                 ///ystem.err.println("Start directory = " + start_file.getAbsolutePath());
     218        ///ystem.err.println("Start directory = " + start_file.getAbsolutePath());
    218219    }
    219220    // Now search each of these metadata xml for metadata, remembering to accumulate or overwrite as we go along.
    220221    for(int i = 0; i < search_files.size(); i++) {
    221222        MetadataXMLFileSearch a_search = (MetadataXMLFileSearch) search_files.get(i);
    222                 ///ystem.err.println("Search " + a_search.file.getAbsolutePath() + File.separator + "metadata.xml for " + (a_search.filename != null ? a_search.filename : "directory metadata"));
    223                 // Retrieve the document
     223        ///ystem.err.println("Search " + a_search.file.getAbsolutePath() + File.separator + "metadata.xml for " + (a_search.filename != null ? a_search.filename : "directory metadata"));
     224        // Retrieve the document
    224225        GDMDocument document = getDocument(a_search.file);
    225226        if(document != null) {
     
    261262
    262263    /** Called whenever the metadata value changes in some way, such as the addition of a new value. This is the only event type we care about, but we care about it a lot. It tells us what metadata to add, remove, etc from the cached metadata.xml files. Note that this method is synchronized so that the data objects don't need to be.
    263       * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    264       * @see org.greenstone.gatherer.msm.GDMDocument
    265       * @see org.greenstone.gatherer.msm.Metadata
    266       * @see org.greenstone.gatherer.util.HashMap3D
    267       */
     264     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
     265     * @see org.greenstone.gatherer.msm.GDMDocument
     266     * @see org.greenstone.gatherer.msm.Metadata
     267     * @see org.greenstone.gatherer.util.HashMap3D
     268     */
    268269    public synchronized void metadataChanged(MSMEvent event) {
    269270    ///ystem.err.println("Recieved Event: " + event.toString());
     
    308309
    309310    /** Causes all currently loaded GDMDocuments to write themselves out.
    310       * @see org.greenstone.gatherer.msm.GDMDocument
    311       */
     311     * @see org.greenstone.gatherer.msm.GDMDocument
     312     */
    312313    public void save() {
    313314    Iterator iterator = keySet().iterator();
     
    357358
    358359    /** Method that is called whenever the metadata set collection changes in some way, such as the addition of a new set or the merging of two sets. If a set changes, mark all cached GDMDocuments as being stale.
    359       * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    360       */
     360     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
     361     */
    361362    public void setChanged(MSMEvent event) {
    362363    for(Iterator values = values().iterator(); values.hasNext(); ) {
     
    367368    }
    368369    /** Called whenever the value tree of an metadata element changes in some way, such as the addition of a new value. --While the comments below are now obsolete, I'll keep them just to remind me of how easy it is to back yourself into a corner with issues such as caching and persisitant references--. Such an action would require us to painstakingly reload every metadata.xml file using the value model prior to the change, then painstakingly write out each metadata.xml file again using the modified model, but I'm a glutton for punishment so thats ok. The alternative is to not do this and watch in horror as heirarchy references quickly fall into disarray, pointing to the wrong place. This task gets even more complicated by three facts:<br>1. We want to do this is a seperate thread, as we don't want the program to come to a screaming halt while we're updating metadata.xml files.<br>2. We have to prevent any metadata.xml files being removed from cache while we're doing this, as if we encounter these more recently written files their heirarchy references will already be correct and that will balls up our little process. Note that this means the saving process may have to block while pending metadata heirarchy updates are in progress.<br>3. Regarding (2) we don't have to rewrite any metadata.xml files already in cache as they will be correctly written out whenever they happen to be dumped from cache.<br>4. We need the ability to pre-empt the general update to load a user demanded metadata.xml and store it in cache, using the old value tree model as per usual, and<br>5. We have to store a cue of these events, and process them one at a time. Perhaps one day when I'm feeling masacistic I'll figure out someway to merge several updates into one, but for now we have to change the tree one node at a time in order for references to remain correct.<br>Ok, so thats five facts, but you get the gist. Not an easy task, but crucial for accurate storage and recall of metadata heirarchies.
    369       * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    370       */
     370     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
     371     */
    371372    public void valueChanged(MSMEvent event) {}
    372373
     
    377378    private Metadata checkCache(Metadata metadata) {
    378379    if(metadata != null) {
    379                 ///ystem.err.println("Search for " + metadata.toString());
     380        ///ystem.err.println("Search for " + metadata.toString());
    380381        if(metadata_cache.contains(metadata.getElement(), metadata.getValueNode())) {
    381382        metadata = (Metadata) metadata_cache.get(metadata.getElement(), metadata.getValueNode());
     
    390391    private boolean complete = false;
    391392    public void run() {
    392                 // Can't open a collections metadata when the collection isn't open!
     393        // Can't open a collections metadata when the collection isn't open!
    393394        while(!Gatherer.c_man.ready()) {
    394395        try {
     
    398399        }
    399400        }
    400                 // Now for each non-file directory in the tree, ask it to load its metadata
     401        // Now for each non-file directory in the tree, ask it to load its metadata
    401402        ArrayList remaining = new ArrayList();
    402403        remaining.add((FileNode)Gatherer.c_man.getRecordSet().getRoot());
  • trunk/gli/src/org/greenstone/gatherer/msm/GDMParser.java

    r4674 r5589  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.msm;
    3738
    38  
    39 
    40 
    41 
    42 
    43 /* GPL_HEADER */
    44 package org.greenstone.gatherer.msm;
    4539/**************************************************************************************
    4640 * Title:        Gatherer
     
    6862import org.w3c.dom.Document;
    6963import org.xml.sax.InputSource;
     64
    7065/** Parses metadata.xml documents of the GreenstoneDirectoryMetadata variety, caching where possible. */
    7166// ####################################################################################
     
    9085    try {
    9186        parser = new DOMParser();
    92                 // Don't let it import external dtds. If it does it'll probably spit the dummy. If people try to use a poorly formated xml file more fool them.
     87        // Don't let it import external dtds. If it does it'll probably spit the dummy. If people try to use a poorly formated xml file more fool them.
    9388        parser.setFeature("http://xml.org/sax/features/validation", false);
    9489        parser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    95                 // May or may not be ignored, the documentation for Xerces is contradictory. If it works then parsing -should- be faster.
     90        // May or may not be ignored, the documentation for Xerces is contradictory. If it works then parsing -should- be faster.
    9691        parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true);
    9792    }
    9893    catch(Exception error) {
    99                 ///ystem.err.println("Fatal Error in GDMParser.init(): " + error);
     94        ///ystem.err.println("Fatal Error in GDMParser.init(): " + error);
    10095        error.printStackTrace();
    10196        System.exit(1);
     
    10398    }
    10499    /** Constructor with maximum size set.
    105       * @param max_size The maximum size of the cache, as an <i>int</i>.
    106       */
     100     * @param max_size The maximum size of the cache, as an <i>int</i>.
     101     */
    107102    public GDMParser(int max_size) {
    108103    this();
     
    117112    }
    118113    /** Fetches the document for the given xml file. This may mean (re)parsing it or simply fetching it from cache.
    119       * @param file The metadata.xml <strong>File</strong> you wish to get the document for.
    120       * @return A <strong>Document</strong> which is sourced from file.
    121       */
     114     * @param file The metadata.xml <strong>File</strong> you wish to get the document for.
     115     * @return A <strong>Document</strong> which is sourced from file.
     116     */
    122117    public Document parse(File file) {
    123118    ///ystem.err.println("Parse: " + file.getAbsolutePath());
    124119    Document result = null;
    125120    if(file.exists()) {
    126                 // Check if we've already parsed this file in an earlier attempt.
     121        // Check if we've already parsed this file in an earlier attempt.
    127122        if(containsKey(file)) {
    128123        ///ystem.err.println("Already cached previously.");
     
    136131        }
    137132        }
    138                 // Check the ignore list and see if we've already detected this isn't a greenstone metadata file.
     133        // Check the ignore list and see if we've already detected this isn't a greenstone metadata file.
    139134        if(result == null && !ignore.contains(file)) {
    140135        ///ystem.err.println("Reparse file.");
     
    171166    }
    172167    else {
    173                 ///ystem.err.println("File does not exist!");
     168        ///ystem.err.println("File does not exist!");
    174169    }
    175170    return result;
    176171    }
    177172    /** Automatically called by the LinkedHashMap object whenever an object is added, to determine whether it should remove the oldest entry.
    178       * @param eldest The eldest <strong>Map.Entry</strong> which may mean in terms of age, or in terms of usage.
    179       * @return <i>true</i> if the given entry should be removed, <i>false</i> otherwise.
    180       */
     173     * @param eldest The eldest <strong>Map.Entry</strong> which may mean in terms of age, or in terms of usage.
     174     * @return <i>true</i> if the given entry should be removed, <i>false</i> otherwise.
     175     */
    181176    protected boolean removeEldestEntry(Map.Entry eldest) {
    182177    return size() > max_size;
  • trunk/gli/src/org/greenstone/gatherer/msm/GreenstoneArchiveParser.java

    r5564 r5589  
    6161    private GShell shell;
    6262
    63     static final String ignore_list[] = {"assocfilepath", "gsdl",  "Identifier","URL"}; //"Source",
     63    static final String ignore_list[] = {"assocfilepath", "gsdl",  "Identifier", "URL"}; //"Source",
    6464
    6565    public GreenstoneArchiveParser(GShellProgressMonitor progress, GShell shell) {
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMAction.java

    r4674 r5589  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.msm;
    3738
    38  
    39 
    40 
    41 
    42 
    43 package org.greenstone.gatherer.msm;
    4439/**
    4540 * Title:        The Gatherer<br>
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMAdapter.java

    r4674 r5589  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.msm;
    3738
    38  
    39 
    40 
    41 
    42 
    43 /* GPL_HEADER */
    44 package org.greenstone.gatherer.msm;
    4539/**************************************************************************************
    4640 * Title:        Gatherer
     
    5549import org.greenstone.gatherer.msm.MSMEvent;
    5650import org.greenstone.gatherer.msm.MSMListener;
     51
    5752/** The default adapter for a MSMListener doesn't actually do anything, thus users can override whatever methods they want. */
    5853public class MSMAdapter
     
    6055    /** Method that is called whenever an element within a set is changed or modified.
    6156     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    62       */
     57     */
    6358    public void elementChanged(MSMEvent event){}
    6459    /** Called whenever the metadata value changes in some way, such as the addition of a new value.
    65       * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    66       */
     60     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
     61     */
    6762    public void metadataChanged(MSMEvent event){}
    6863    /** Method that is called whenever the metadata set collection changes in some way, such as the addition of a new set or the merging of two sets.
    69       * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    70       */
     64     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
     65     */
    7166    public void setChanged(MSMEvent event){}
    7267    /** Called whenever the value tree of an metadata element changes in some way, such as the addition of a new value.
    73       * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    74       */
     68     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
     69     */
    7570    public void valueChanged(MSMEvent event){}
    7671}
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMEvent.java

    r4674 r5589  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.msm;
    3738
    38  
    39 
    40 
    41 
    42 
    43 package org.greenstone.gatherer.msm;
    4439/**
    4540 * Title:        The Gatherer<br>
     
    8681     * @param id An <i>long</i> identifier.
    8782     * @param element The <strong>ElementWrapper</strong> affected.
    88       */
     83     */
    8984    public MSMEvent(Object source, long id, ElementWrapper element, GValueModel old_model, GValueModel new_model) {
    9085    super(source, 0);
     
    117112    }
    118113    /** Constructor.
    119       * @param source The <strong>Object</strong> that caused this event.
    120       * @param id An <i>long</i> identifier.
    121       * @param profile The <strong>MSMAction</strong> profile if one is applicable.
    122       */
     114     * @param source The <strong>Object</strong> that caused this event.
     115     * @param id An <i>long</i> identifier.
     116     * @param profile The <strong>MSMAction</strong> profile if one is applicable.
     117     */
    123118    public MSMEvent(Object source, long id, MSMAction profile) {
    124119    super(source, 00);
     
    129124    }
    130125    /** Constructor for a metadata element changed event.
    131       * @param source The <strong>Object</strong> that caused this event.
    132       * @param element A reference to the effected metadata <strong>ElementWrapper</strong>, or <i>null</i> if element no longer exists.
    133       * @param value The old name of the element (if its name has changed). If <i>null</i> old name defaults to element.toString().
    134       */
     126     * @param source The <strong>Object</strong> that caused this event.
     127     * @param element A reference to the effected metadata <strong>ElementWrapper</strong>, or <i>null</i> if element no longer exists.
     128     * @param value The old name of the element (if its name has changed). If <i>null</i> old name defaults to element.toString().
     129     */
    135130    public MSMEvent(Object source, ElementWrapper element, String value) {
    136131    super(source, count++);
     
    139134    }
    140135    /** Method to retrieve of the element associated with this event.
    141       * @return A <strong>ElementWrapper</strong>, or <i>null</i> if there is none.
    142       */
     136     * @return A <strong>ElementWrapper</strong>, or <i>null</i> if there is none.
     137     */
    143138    public ElementWrapper getElement() {
    144139    return element;
     
    149144    }
    150145    /** Method to retrieve the new metadata associated with this event.
    151       * @return A <strong>Metadata</strong>, or <i>null</i> if there is none.
    152       */
     146     * @return A <strong>Metadata</strong>, or <i>null</i> if there is none.
     147     */
    153148    public Metadata getNewMetadata() {
    154149    return new_metadata;
     
    158153    }
    159154    /** Method to retrieve the old metadata associated with this event.
    160       * @return A <strong>Metadata</strong>, or <i>null</i> if there is none.
    161       */
     155     * @return A <strong>Metadata</strong>, or <i>null</i> if there is none.
     156     */
    162157    public Metadata getOldMetadata() {
    163158    return old_metadata;
     
    167162    }
    168163    /** Method to retrieve of the profile associated with this event.
    169       * @return A <strong>MSMAction</strong> which details the action profile, or <i>null</i> if no profile exists.
    170       */
     164     * @return A <strong>MSMAction</strong> which details the action profile, or <i>null</i> if no profile exists.
     165     */
    171166    public MSMAction getProfile() {
    172167    return profile;
     
    177172    }
    178173    /** Retrieve the associated with this event.
    179       * @return A <strong>String</strong>.
    180       */
     174     * @return A <strong>String</strong>.
     175     */
    181176    public String getValue() {
    182177    String result = null;
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMListener.java

    r4674 r5589  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.msm;
    3738
    38  
    39 
    40 
    41 
    42 
    43 package org.greenstone.gatherer.msm;
    4439/**
    4540 * Title:        The Gatherer<br>
     
    5146 */
    5247import org.greenstone.gatherer.msm.MSMEvent;
     48
    5349/** This class provides an interface for classes who wish to listener for events within the <strong>MetadataSetManager</strong>. There are events which are fired whenever a set or an element within a set changes. The events are either very broad, of the <i>metadataSetChanged()</i> variaty down to the more explicit <i>elementChanged(Profile change)</i> which actually details what change occured so the GUI etc can update just that element. */
    5450public interface MSMListener {
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMProfiler.java

    r4674 r5589  
    1 package org.greenstone.gatherer.msm;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
    38 import java.io.File;
    39 import java.io.FileInputStream;
    40 import java.io.FileOutputStream;
    41 import java.io.InputStream;
    42 import java.io.OutputStreamWriter;
    43 import java.util.ArrayList;
    44 import java.util.HashMap;
    45 import java.util.Iterator;
     37package org.greenstone.gatherer.msm;
     38
     39import java.io.*;
     40import java.util.*;
    4641import org.greenstone.gatherer.Gatherer;
    47 import org.greenstone.gatherer.msm.Declarations;
    4842import org.greenstone.gatherer.msm.MSMAdapter;
    4943import org.greenstone.gatherer.util.HashMap3D;
    5044import org.greenstone.gatherer.util.Utility;
    51 import org.w3c.dom.Document;
    52 import org.w3c.dom.Element;
    53 import org.w3c.dom.NodeList;
     45import org.w3c.dom.*;
     46
    5447/** This class is essentially records what actions a user took when merging two metadata sets, so we can avoid having to get the user to repeat the proceedure.
    5548 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    6457    static final private String IGNORE = "\nIGNORE\n";
    6558    /** The constructor loads the previous profile for this collection if there is one.
    66       * @see org.greenstone.gatherer.collection.CollectionManager
    67       * @see org.greenstone.gatherer.msm.MetadataSetManager
    68       */
     59     * @see org.greenstone.gatherer.collection.CollectionManager
     60     * @see org.greenstone.gatherer.msm.MetadataSetManager
     61     */
    6962    public MSMProfiler() {
    7063    this.profile_file = new File(Gatherer.c_man.getCollectionMetadata(), "profile.xml");
     
    8073    }
    8174    /** Adds a new action mapping to the profile. Such a mapping records that for a certain collection (file) and metadata element a specific action must occur. The action is either a renaming to a new metadata element name, also provided, or an instruction to ignore this particular metadata element, is the target is null.
    82       * @param collection_file The aboslute path name to the collection where the metadata was sourced, as a <strong>String</strong>.
    83       * @param source A <strong>String</strong> containing the fully qualified name of the source metadata element.
    84       * @param target Another <strong>String</strong> which is either the fully qualified name of the target element, or <i>null</i> if this is actually an ignore action addition.
    85       */
     75     * @param collection_file The aboslute path name to the collection where the metadata was sourced, as a <strong>String</strong>.
     76     * @param source A <strong>String</strong> containing the fully qualified name of the source metadata element.
     77     * @param target Another <strong>String</strong> which is either the fully qualified name of the target element, or <i>null</i> if this is actually an ignore action addition.
     78     */
    8679    public void addAction(String collection_file, String source, String target) {
    8780    if(target == null) {
     
    9689
    9790    /** Determine if an action exists for the given collection and source.
    98       * @param collection_file The aboslute path name to the collection where the metadata was sourced, as a <strong>String</strong>.
    99       * @param source A <strong>String</strong> containing the fully qualified name of the source metadata element.
    100       * @return <i>true</i> if such an action exists, <i>false</i> otherwise.
    101       */
     91     * @param collection_file The aboslute path name to the collection where the metadata was sourced, as a <strong>String</strong>.
     92     * @param source A <strong>String</strong> containing the fully qualified name of the source metadata element.
     93     * @return <i>true</i> if such an action exists, <i>false</i> otherwise.
     94     */
    10295    public boolean containsAction(String collection_file, String source) {
    10396    return profiles.contains(collection_file, source);
     
    116109    }
    117110    /** Method that is called whenever an element within a set is changed or modified, in which case we must modify the action profiles to suit. If an element was removed, remove all action profiles with this element as the target. If an elements name changes, update all matching targets to reflect new name.
    118       * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
    119       */
     111     * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired.
     112     */
    120113    public void elementChanged(MSMEvent event) {
    121114    Gatherer.println("Element changed: " + event);
     
    164157    }
    165158    /** Search the profilerer for any previous actions regarding the indicated collection and metadata element.
    166       * @param collection_file The absolute path name to the collection where the metadata was sourced, as a <strong>String</strong>.
    167       * @param source A <strong>String</strong> containing the fully qualified name of the source metadata element.
    168       * @return The fully qualified name of the target metadata element, as a <strong>String</strong>, or <i>null</i> if we are to ignore this metadata. Note that the target elements name may be exactly the source elements one.
    169       * @see org.greenstone.gatherer.msm.Declarations
    170       */
     159     * @param collection_file The absolute path name to the collection where the metadata was sourced, as a <strong>String</strong>.
     160     * @param source A <strong>String</strong> containing the fully qualified name of the source metadata element.
     161     * @return The fully qualified name of the target metadata element, as a <strong>String</strong>, or <i>null</i> if we are to ignore this metadata. Note that the target elements name may be exactly the source elements one.
     162     */
    171163    public String getAction(String collection_file, String source) {
    172164    ///atherer.println("Get action.");
     
    261253    }
    262254    /** Reload the mapping information stored in this document.
    263       * @param document The <strong>Document</strong> to parse.
    264       */
     255     * @param document The <strong>Document</strong> to parse.
     256     */
    265257    private void load(Document document) {
    266258    Element root = document.getDocumentElement();
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMPrompt.java

    r5564 r5589  
    7171    private JDialog on_screen = null;
    7272    private JDialog dialog = null;
    73     private JLabel current_details_label = null;
    74     private JLabel new_details_label = null;
    75     private JLabel progress_label = null;
    7673    private JProgressBar progress = null;
    77     private JTextArea current_details = null;
    78     private JTextArea new_details = null;
    7974    private MetadataSetManager manager = null;
    8075    private Object result = null;
     
    9590
    9691    // Create components
    97     add = new JButton();
    98     add.addActionListener(this);
    99     add.setEnabled(false);
    100     add.setMnemonic(KeyEvent.VK_A);
    101     Dictionary.registerBoth(add, "MSMPrompt.Add", "MSMPrompt.Add_Tooltip");
    102 
    103     cancel = new JButton();
    104     cancel.addActionListener(this);
    105     cancel.setEnabled(true);
    106     cancel.setMnemonic(KeyEvent.VK_C);
    107     Dictionary.registerBoth(add, "MSMPrompt.Cancel", "MSMPrompt.Cancel_Tooltip");
    108 
    109     current_details = new JTextArea();
    110     Dictionary.registerText(current_details, "MSMPrompt.No_Details");
    111 
    112     current_details_label = new JLabel();
    113     Dictionary.registerText(current_details_label, "MSMPrompt.Current_Details");
    114 
    115     merge = new JButton();
    116     merge.addActionListener(this);
    117     merge.setEnabled(true);
    118     merge.setMnemonic(KeyEvent.VK_M);
    119     Dictionary.registerBoth(merge, "MSMPrompt.Merge", "MSMPrompt.Merge_Tooltip");
    120 
    121     new_details = new JTextArea();
    122     Dictionary.registerText(new_details, "MSMPrompt.No_Details");
    123 
    124     new_details_label = new JLabel();
    125     Dictionary.registerText(new_details_label, "MSMPrompt.New_Details");
    126 
    127     progress = new JProgressBar();
    128     progress.setStringPainted(true);
    129 
    130     progress_label = new JLabel();
    131     Dictionary.registerText(progress_label, "MSMPrompt.Progress");
    132 
    133     rename = new JButton();
    134     rename.addActionListener(this);
    135     rename.setEnabled(false);
    136     rename.setMnemonic(KeyEvent.VK_N);
    137     Dictionary.registerBoth(rename, "MSMPrompt.Rename", "MSMPrompt.Rename_Tooltip");
    138 
    139     replace = new JButton();
    140     replace.addActionListener(this);
    141     replace.setEnabled(false);
    142     replace.setMnemonic(KeyEvent.VK_R);
    143     Dictionary.registerBoth(replace, "MSMPrompt.Replace", "MSMPrompt.Replace_Tooltip");
    144 
    145     skip = new JButton();
    146     skip.addActionListener(this);
    147     skip.setEnabled(true);
    148     skip.setMnemonic(KeyEvent.VK_S);
    149     Dictionary.registerBoth(skip, "MSMPrompt.Skip", "MSMPrompt.Skip_Tooltip");
     92    cancel = new JButton();
     93    cancel.addActionListener(this);
     94    cancel.setEnabled(true);
     95    cancel.setMnemonic(KeyEvent.VK_C);
     96    Dictionary.registerBoth(cancel, "General.Cancel", "General.Cancel_Tooltip");
     97
     98    progress = new JProgressBar();
     99    progress.setStringPainted(true);
    150100
    151101    screen_size = Gatherer.config.screen_size;
     
    169119    Object source = event.getSource();
    170120    action = Declarations.NO_ACTION;
    171     if(source == add) {
     121    if (add != null && source == add) {
    172122        action = Declarations.ADD;
    173123    }
    174     else if(source == cancel) {
     124    else if (cancel != null && source == cancel) {
    175125        action = Declarations.CANCEL;
    176126    }
    177     else if(source == merge) {
     127    else if (merge != null && source == merge) {
    178128        action = Declarations.MERGE;
    179129    }
    180     else if(source == rename) {
     130    else if (rename != null && source == rename) {
    181131        action = Declarations.RENAME;
    182132    }
    183     else if(source == replace) {
     133    else if (replace != null && source == replace) {
    184134        action = Declarations.REPLACE;
    185135    }
    186     else if(source == skip) {
     136    else if (skip != null && source == skip) {
    187137        action = Declarations.SKIP;
    188138    }
    189139    on_screen.setVisible(false);
    190140    }
     141
    191142    /** Method called when the merging process is complete and the progress bar is no longer needed.
    192143     */
     
    201152    progress.setString(percent);
    202153    }
     154
    203155    /** Method to display the metadata element merging prompt, wherein the user determines how the attributes within an element should be merged.
    204156     * @param mde_cur The current <strong>Element</strong> we are merging against.
     
    210162    public Object mDEPrompt(Element mde_cur, Element[] atts_cur, Element mde_new, Element att_new) {
    211163    action = Declarations.NO_ACTION;
     164
    212165    // Construction and configuration
    213166    JDialog dialog = new ModalDialog(Gatherer.g_man);
    214167    dialog.setModal(true);
    215168    dialog.setSize(MDE_SIZE);
     169    dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata"));
    216170    Dictionary.setText(dialog, "MSMPrompt.Merge_MDE");
    217     dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata"));
     171
    218172    JPanel content_pane = (JPanel)dialog.getContentPane();
    219173
     
    226180    JLabel attribute_name = new JLabel(att_new.getAttribute("name"));
    227181
    228     add.setEnabled(true);
    229     replace.setEnabled(false);
    230     skip.setEnabled(true);
     182    add = new JButton();
     183    add.addActionListener(this);
     184    add.setEnabled(true);
     185    add.setMnemonic(KeyEvent.VK_A);
     186    Dictionary.registerBoth(add, "MSMPrompt.Add", "MSMPrompt.Add_Tooltip");
     187
     188    replace = new JButton();
     189    replace.addActionListener(this);
     190    replace.setEnabled(false);
     191    replace.setMnemonic(KeyEvent.VK_R);
     192    Dictionary.registerBoth(replace, "MSMPrompt.Replace", "MSMPrompt.Replace_Tooltip");
     193
     194        skip = new JButton();
     195    skip.addActionListener(this);
     196    skip.setEnabled(true);
     197    skip.setMnemonic(KeyEvent.VK_S);
     198    Dictionary.registerBoth(skip, "MSMPrompt.Skip", "MSMPrompt.Skip_Tooltip");
    231199
    232200    JList cur_values = new JList(atts_cur);
     
    236204    cur_values.setCellRenderer(new AttributeListCellRenderer());
    237205    cur_values.addListSelectionListener(new ElementListListener(cur_values, replace));
    238     //Layout
     206
     207    // Layout
    239208    JPanel title_pane = new JPanel();
    240209    title_pane.setLayout(new GridLayout(2,2));
     
    275244
    276245    // Display
    277    
    278     dialog.setLocation((screen_size.width - MDE_SIZE.width) / 2, (screen_size.height - MDE_SIZE.height) / 2);
     246        dialog.setLocation((screen_size.width - MDE_SIZE.width) / 2, (screen_size.height - MDE_SIZE.height) / 2);
    279247    on_screen = dialog;
    280248    on_screen.setVisible(true); // blocks until hidden
     
    303271    on_screen = null;
    304272    dialog = null;
    305    
     273
    306274    return result;
    307275    }
     276
    308277    /** This method displays the metadata data set merging prompt, wherein the user determines how the elements within a set should be merged.
    309278     * @param mds_cur The current <strong>MetadataSet</strong> containing our document.
     
    315284    public int mDSPrompt(MetadataSet mds_cur, Element mde_cur, MetadataSet mds_new, Element mde_new) {
    316285    action = Declarations.NO_ACTION;
     286
    317287    // Construction and configuration
    318288    JDialog dialog = new ModalDialog(Gatherer.g_man);
    319289    dialog.setModal(true);
    320290    dialog.setSize(MDS_SIZE);
     291    dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata"));
    321292    Dictionary.setText(dialog, "MSMPrompt.Merge_MDS");
    322     dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata"));
     293
     294    JTextArea current_details = new JTextArea();
     295    Dictionary.registerText(current_details, "MSMPrompt.No_Details");
     296
     297    JLabel current_details_label = new JLabel();
     298    Dictionary.registerText(current_details_label, "MSMPrompt.Current_Details");
     299
     300    JTextArea new_details = new JTextArea();
     301    Dictionary.registerText(new_details, "MSMPrompt.No_Details");
     302
     303    JLabel new_details_label = new JLabel();
     304    Dictionary.registerText(new_details_label, "MSMPrompt.New_Details");
     305
     306    JLabel progress_label = new JLabel();
     307    Dictionary.registerText(progress_label, "MSMPrompt.Progress");
     308
     309    add = new JButton();
     310    add.addActionListener(this);
     311    add.setEnabled(false);
     312    add.setMnemonic(KeyEvent.VK_A);
     313    Dictionary.registerBoth(add, "MSMPrompt.Add", "MSMPrompt.Add_Tooltip");
     314
     315    merge = new JButton();
     316    merge.addActionListener(this);
     317    merge.setEnabled(true);
     318    merge.setMnemonic(KeyEvent.VK_M);
     319    Dictionary.registerBoth(merge, "MSMPrompt.Merge", "MSMPrompt.Merge_Tooltip");
     320
     321    rename = new JButton();
     322    rename.addActionListener(this);
     323    rename.setEnabled(false);
     324    rename.setMnemonic(KeyEvent.VK_N);
     325    Dictionary.registerBoth(rename, "MSMPrompt.Rename", "MSMPrompt.Rename_Tooltip");
     326
     327    replace = new JButton();
     328    replace.addActionListener(this);
     329    replace.setEnabled(false);
     330    replace.setMnemonic(KeyEvent.VK_R);
     331    Dictionary.registerBoth(replace, "MSMPrompt.Replace", "MSMPrompt.Replace_Tooltip");
     332
     333    skip = new JButton();
     334    skip.addActionListener(this);
     335    skip.setEnabled(true);
     336    skip.setMnemonic(KeyEvent.VK_S);
     337    Dictionary.registerBoth(skip, "MSMPrompt.Skip", "MSMPrompt.Skip_Tooltip");
     338
    323339    JPanel content_pane = (JPanel)dialog.getContentPane();
    324     if(mde_cur != null) {
     340    if (mde_cur != null) {
    325341        add.setEnabled(false);
    326342        cancel.setEnabled(true);
     
    329345        replace.setEnabled(true);
    330346        skip.setEnabled(true);
    331                 // Current details.
     347        // Current details.
    332348        String str_cur[] = MSMUtils.getStructuralDetails(mds_cur, mde_cur);
    333349        String opt_cur[] = MSMUtils.getOptionListDetails(mde_cur);
     
    353369        replace.setEnabled(false);
    354370        skip.setEnabled(true);
    355         current_details.setText(Dictionary.newget("MSMPrompt.No_Element"));
    356     }
     371        Dictionary.setText(current_details, "MSMPrompt.No_Element");
     372    }
     373
    357374    // New details.
    358375    String str_new[] = MSMUtils.getStructuralDetails(mds_new, mde_new);
     
    367384    }
    368385    new_details.setText(details_new);
     386
    369387    // Layout
    370388    JPanel current_details_pane = new JPanel();
     
    434452    return action;
    435453    }
     454
    436455    /** This method initialises the  progress bar.
    437456     * @param element_count An <i>int</i> specifying the total number of elements to be merged.
     
    450469    public String rename(Element mde_new) {
    451470    action = Declarations.NO_ACTION;
     471
    452472    // Create
    453473    JDialog dialog = new ModalDialog(Gatherer.g_man);
     
    464484    old_name.setBackground(Color.white);
    465485    old_name.setOpaque(true);
    466     Dictionary.setTooltip(old_name, "MSMPrompt.Old_Name_Tooltip");
    467486
    468487    JLabel new_name_label = new JLabel();
     
    508527    content_pane.add(control_pane, BorderLayout.CENTER);
    509528    content_pane.add(button_pane, BorderLayout.SOUTH);
     529
    510530    // Display
    511531    dialog.setLocation((screen_size.width - RENAME_SIZE.width) / 2, (screen_size.height - RENAME_SIZE.height) / 2);
     
    596616    list_pane.setLayout(new BorderLayout());
    597617    list_pane.add(new JScrollPane(list), BorderLayout.CENTER);
    598          
     618
    599619    JPanel button_pane = new JPanel();
    600620    button_pane.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
     
    628648    button_pane = null;
    629649    dialog = null;
    630     // Return selected element.
     650    // Return selected element
    631651    if(action == Declarations.CANCEL) {
    632652        return null;
     
    646666    String args[] = new String[1];
    647667    args[0] = name;
     668
    648669    // Create
    649670    MSMDialog dialog = new MSMDialog();
     
    655676    JPanel content_pane = (JPanel) dialog.getContentPane();
    656677    JPanel control_pane = new JPanel();
    657     JTextArea instructions = new JTextArea(get("MSMPrompt.Select_Element_Instructions", args));
     678    JTextArea instructions = new JTextArea();
    658679    instructions.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    659680    instructions.setEditable(false);
     
    661682    instructions.setRows(SELECT_LINE_COUNT);
    662683    instructions.setWrapStyleWord(true);
     684    Dictionary.setText(instructions, "MSMPrompt.Select_Element_Instructions", args);
     685
    663686    JPanel original_pane = new JPanel();
    664     JLabel original_label = new JLabel(get("MSMPrompt.Select_Element_Original"));
     687    JLabel original_label = new JLabel();
    665688    original_label.setPreferredSize(SELECT_LABEL_SIZE);
     689    Dictionary.setText(original_label, "MSMPrompt.Select_Element_Original");
    666690    JTextField original = new JTextField(name);
    667691    original.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    668692    original.setEditable(false);
     693
     694    JPanel set_pane = new JPanel();
     695    JLabel set_label = new JLabel();
     696    set_label.setPreferredSize(SELECT_LABEL_SIZE);
     697    Dictionary.setText(set_label, "MSMPrompt.Select_Element_Set");
     698    JComboBox set = new JComboBox(manager.getSets(false)); // Don't include the greenstone metadata set.
     699    Dictionary.setTooltip(set, "MSMPrompt.Select_Element_Set_Tooltip");
     700
    669701    JPanel element_pane = new JPanel();
    670     JLabel element_label = new JLabel(get("MSMPrompt.Select_Element_Element"));
     702    JLabel element_label = new JLabel();
    671703    element_label.setPreferredSize(SELECT_LABEL_SIZE);
     704    Dictionary.setText(element_label, "MSMPrompt.Select_Element_Element");
    672705    JComboBox element = new JComboBox();
    673     JButton add_button = new JButton(get("MSMPrompt.Select_Element_Add"));
     706    Dictionary.setTooltip(element, "MSMPrompt.Select_Element_Element_Tooltip");
     707
     708    JButton add_button = new JButton();
    674709    add_button.setEnabled(false);
    675710    add_button.setMnemonic(KeyEvent.VK_A);
    676     JButton cancel_button = new JButton(get("General.Cancel"));
     711    Dictionary.setBoth(add_button, "MSMPrompt.Select_Element_Add", "MSMPrompt.Select_Element_Add_Tooltip");
     712
     713    JButton cancel_button = new JButton();
    677714    cancel_button.setMnemonic(KeyEvent.VK_C);
    678     JButton merge_button = new JButton(get("MSMPrompt.Select_Element_Merge"));
     715    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Cancel_Tooltip");
     716
     717    JButton merge_button = new JButton();
    679718    merge_button.setEnabled(false);
    680719    merge_button.setMnemonic(KeyEvent.VK_M);
    681     JButton ignore_button = new JButton(get("MSMPrompt.Select_Element_Ignore"));
     720    Dictionary.setBoth(merge_button, "MSMPrompt.Select_Element_Merge", "MSMPrompt.Select_Element_Merge_Tooltip");
     721
     722    JButton ignore_button = new JButton();
    682723    ignore_button.setMnemonic(KeyEvent.VK_I);
    683     JPanel set_pane = new JPanel();
    684     JLabel set_label = new JLabel(get("MSMPrompt.Select_Element_Set"));
    685     set_label.setPreferredSize(SELECT_LABEL_SIZE);
    686     JComboBox set = new JComboBox(manager.getSets(false)); // Don't include the greenstone metadata set.
     724    Dictionary.setBoth(ignore_button, "MSMPrompt.Select_Element_Ignore", "MSMPrompt.Select_Element_Ignore_Tooltip");
     725
    687726    JPanel button_pane = new JPanel();
     727
    688728    // Connect
    689729    AddListener add_listener = new AddListener(dialog, name, set);
     
    743783    }
    744784    merge_button.setEnabled(element.getItemCount() > 0);
     785
    745786    // Layout
    746787    original_label.setBorder(BorderFactory.createEmptyBorder(0,0,0,5));
     
    772813    content_pane.add(control_pane, BorderLayout.CENTER);
    773814    content_pane.add(button_pane, BorderLayout.SOUTH);
     815
    774816    // Display
    775817    dialog.setLocation((screen_size.width - SELECT_ELEMENT_SIZE.width) / 2, (screen_size.height - SELECT_ELEMENT_SIZE.height) / 2);
     
    814856    }
    815857
    816     private String get(String key) {
    817     return get(key, null);
    818     }
    819 
    820     private String get(String key, String args[]) {
    821     if(key.indexOf(".") == -1) {
    822         key = "MSMPrompt." + key;
    823     }
    824     return Gatherer.dictionary.get(key, args);
    825     }
    826          
    827858    /** Prompts the user to select a metadata set from the given list. Uses the name parameter to attempt to automatically select the correct collection (ie the only collection that has an element with the same name).
    828859     * @param name The name of the metadata element whose set name is unknown.
     
    832863    String args[] = new String[1];
    833864    args[0] = name;
     865
    834866    // Creation
    835867    MSMDialog dialog = new MSMDialog();
    836868    dialog.setModal(true);
    837869    dialog.setSize(SELECT_SET_SIZE);
    838     dialog.setTitle(get("MSMPrompt.Select_Set_Title"));
    839870    dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata"));
     871    Dictionary.setText(dialog, "MSMPrompt.Select_Set_Title");
     872
    840873    JPanel content_pane = (JPanel) dialog.getContentPane();
    841874    JPanel control_pane = new JPanel();
    842     JTextArea instructions = new JTextArea(get("MSMPrompt.Select_Set_Instructions", args));
     875    JTextArea instructions = new JTextArea();
    843876    instructions.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    844877    instructions.setEditable(false);
     
    846879    instructions.setRows(SELECT_LINE_COUNT);
    847880    instructions.setWrapStyleWord(true);
     881    Dictionary.setText(instructions, "MSMPrompt.Select_Set_Instructions", args);
     882
    848883    JComboBox set = new JComboBox();
    849884    set.setBackground(Color.white);
    850     set.addItem(get("MSMPrompt.Select_Set_None"));
     885    set.addItem(Dictionary.newget("MSMPrompt.Select_Set_None"));
    851886    Vector sets = manager.getSets();
    852887    for(int i = sets.size() - 1; i >= 0; i--) {
    853888        set.addItem(sets.get(i));
    854889    }
    855     JButton ok = new JButton(get("General.OK"));
     890    Dictionary.setTooltip(set, "MSMPrompt.Select_Element_Set_Tooltip");
     891
     892    JButton ok = new JButton();
    856893    ActionListener ok_listener = new IgnoreListener(dialog);
    857894    ok.addActionListener(ok_listener); // Doesn't really ignore. Just disposes()
    858     // Select most likely set.
     895    Dictionary.setBoth(ok, "General.OK", "General.OK_Tooltip");
     896
     897    // Select most likely set
    859898    if(name.indexOf(".") != -1) {
    860899        String set_name = name.substring(0, name.indexOf("."));
     
    873912        matches = null;
    874913    }
     914
    875915    // Layout
    876916    control_pane.setLayout(new GridLayout(2,1));
     
    881921    content_pane.add(new JScrollPane(instructions), BorderLayout.CENTER);
    882922    content_pane.add(control_pane, BorderLayout.SOUTH);
     923
    883924    // Display
    884925    dialog.setLocation((screen_size.width - SELECT_SET_SIZE.width) / 2, (screen_size.height - SELECT_SET_SIZE.height) / 2);
     
    921962        // However, before we attempt to add a new element to the set, we should check that none already exists.
    922963        Element element = mds.getElement(name);
    923         if(element == null) {
    924         result = mds.addElement(n);
     964        if (element == null) {
     965        result = mds.addElement(n, Gatherer.config.interface_language);
    925966        }
    926967        else {
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMUtils.java

    r5154 r5589  
    2626 */
    2727package org.greenstone.gatherer.msm;
     28
    2829/**************************************************************************************
    2930 * Title:        Gatherer
     
    306307
    307308    /*************************************************************************/
    308      
    309309    /** This method is a slight variation on getNodeNamed in that it is especially written to retrieve the attribute Nodes of a certain name present under the given element. Note that this method is language specific.
    310310     * @param element The target element <strong>Node</strong>.
     
    889889    if(av.getNodeName().equals("Value") &&
    890890       bv.getNodeName().equals("Value")) {
    891                 // Retrieve and then compare their text values.
     891        // Retrieve and then compare their text values.
    892892        Node at = av.getFirstChild();
    893893        Node bt = bv.getFirstChild();
  • trunk/gli/src/org/greenstone/gatherer/msm/Metadata.java

    r5515 r5589  
    1 package org.greenstone.gatherer.msm;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.msm;
     38
    3839import java.io.*;
    3940import org.greenstone.gatherer.Gatherer;
     
    6667    /** Constructs a new Metadata object with no current value.
    6768     * @param element The <strong>ElementWrapper</strong> associated with this metadata.
    68       */
     69     */
    6970    public Metadata(ElementWrapper element) {
    7071    super();
     
    7374    }
    7475    /** Default constructor simply creates a new Metadata object based on the given parameters.
    75       * @param element The <strong>ElementWrapper</strong> associated with this metadata.
    76       * @param value The assigned value for the given element, as a <strong>GValueNode</strong>.
    77       */
     76     * @param element The <strong>ElementWrapper</strong> associated with this metadata.
     77     * @param value The assigned value for the given element, as a <strong>GValueNode</strong>.
     78     */
    7879    public Metadata(ElementWrapper element, GValueNode value) {
    7980    super();
     
    8283    }
    8384    /** Constructs a new Metadata object, given the value. The metadata element is extracted from the value tree information.
    84       * @param value The assigned value for the given element, as a <strong>GValueNode</strong>.
    85       * @see org.greenstone.gatherer.Gatherer
    86       * @see org.greenstone.gatherer.collection.CollectionManager
    87       * @see org.greenstone.gatherer.msm.MetadataSetManager
    88       */
     85     * @param value The assigned value for the given element, as a <strong>GValueNode</strong>.
     86     * @see org.greenstone.gatherer.Gatherer
     87     * @see org.greenstone.gatherer.collection.CollectionManager
     88     * @see org.greenstone.gatherer.msm.MetadataSetManager
     89     */
    8990    public Metadata(GValueNode value) {
    9091    super();
     
    9798    }
    9899    /** Compares two Metadata objects for ordering purposes.
    99       * @param object The other metadata as an <strong>Object</strong>.
    100       * @return An <i>int</i> value as specified in java.lang.String#compareTo
    101       * @see java.lang.String#compareTo
    102       */
     100     * @param object The other metadata as an <strong>Object</strong>.
     101     * @return An <i>int</i> value as specified in java.lang.String#compareTo
     102     * @see java.lang.String#compareTo
     103     */
    103104    public int compareTo(Object object) {
    104105    return toString().compareTo(object.toString());
     
    109110    }
    110111    /** Tests to metadata objects for equality.
    111       * @param object The other metadata as an <strong>Object</strong>.
    112       * @return <i>true</i> if the metadata are equal, <i>false</i> otherwise.
    113       */
     112     * @param object The other metadata as an <strong>Object</strong>.
     113     * @return <i>true</i> if the metadata are equal, <i>false</i> otherwise.
     114     */
    114115    public boolean equals(Object object) {
    115116    if(compareTo(object) == 0) {
     
    137138    }
    138139    /** Retrieve the reference count.
    139       * @return The count as an <i>int</i>.
    140       */
     140     * @return The count as an <i>int</i>.
     141     */
    141142    public int getCount() {
    142143    return count;
    143144    }
    144145    /** Retrieve the element associated with this metadata.
    145       * @return An <strong>ElementWrapper</strong>.
    146       */
     146     * @return An <strong>ElementWrapper</strong>.
     147     */
    147148    public ElementWrapper getElement() {
    148149    return element;
     
    155156
    156157    /** Get the textual value of this metadata.
    157       * @return A <strong>String</strong> representing the value of this Metadata. Note that if the value node is null, then the String returned is "".
    158       */
     158     * @return A <strong>String</strong> representing the value of this Metadata. Note that if the value node is null, then the String returned is "".
     159     */
    159160    public String getValue() {
    160161    String result = "";
     
    165166    }
    166167    /** Retrieve the value node associated with this metadata.
    167       * @return A <strong>GValueNode</strong>.
    168       */
     168     * @return A <strong>GValueNode</strong>.
     169     */
    169170    public GValueNode getValueNode() {
    170171    return value;
     
    185186    }
    186187    /** Sets the reference count.
    187       * @param value The new value of count as an <i>int</i>.
    188       */
     188     * @param value The new value of count as an <i>int</i>.
     189     */
    189190    public void setCount(int value) {
    190191    count = value;
     
    201202
    202203    /** Translates this object into a string representation.
    203       * @return A <strong>String</strong>.
    204       */
     204     * @return A <strong>String</strong>.
     205     */
    205206    public String toString() {
    206207    return element.toString() + "=" + getValue();
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataComboBoxModel.java

    r4674 r5589  
    3535 *########################################################################
    3636 */
    37 
    38  
    39 
    40 
    41 
    42 
    4337package org.greenstone.gatherer.msm;
    4438
    45 import java.util.Collections;
    46 import java.util.Vector;
     39import java.util.*;
    4740import javax.swing.DefaultComboBoxModel;
    4841import org.greenstone.gatherer.msm.MetadataSetManager;
    4942import org.greenstone.gatherer.msm.MSMEvent;
    5043import org.greenstone.gatherer.msm.MSMListener;
    51 import org.w3c.dom.Element;
    52 import org.w3c.dom.NodeList;
     44import org.w3c.dom.*;
     45
    5346/** A combobox model that contains information from an array of NodeLists. */
    5447public class MetadataComboBoxModel
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataParser.java

    r4674 r5589  
    1 package org.greenstone.gatherer.msm;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.msm;
     38
    3839import org.greenstone.gatherer.Gatherer;
    3940import org.greenstone.gatherer.file.FileNode;
     41
    4042/** Provides an interface for all parsers which should be called during the 'search for existing metadata' phase of a file copy.
    4143 * @author John Thompson, Greenstone Digital Library, University of Waikato
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataSet.java

    r5581 r5589  
    181181     * @param name The name of this element as a <strong>String</strong>.
    182182     * @return An <strong>ElementWrapper</strong> around the newly created element or null if the element was not created.
    183      * @deprecated All elements should be created with a language.
    184      */
    185     public ElementWrapper addElement(String name) {
    186     Text text = document.createTextNode(name);
    187     Element identifier = document.createElementNS("","Attribute");
    188     identifier.setAttribute("name","identifier");
    189     identifier.appendChild(text);
    190     Element element = document.createElementNS("","Element");
    191     element.setAttribute("name",name);
    192     element.appendChild(identifier);
    193     root.appendChild(element);
    194     ElementWrapper wrapper = new ElementWrapper(element);
    195     ///ystem.err.println("Added a new element " + wrapper);
    196     return wrapper;
    197     }
    198 
     183     */
    199184    public ElementWrapper addElement(String name, String language)
    200185    {
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java

    r5564 r5589  
    151151    public MetadataSet addSet(String namespace, String name) {
    152152    MetadataSet mds = new MetadataSet(Utility.METADATA_SET_TEMPLATE);
    153     mds.setAttribute("creator","The Gatherer");
     153    mds.setAttribute("creator", "The Greenstone Librarian Interface");
    154154    // Calculate lastchanged to right now on this machine by this user
    155155    String user_name = System.getProperty("user.name");
     
    203203    int result = emdsp.display();
    204204    MetadataSet set = emdsp.getSelectedSet();
    205     if(result == ExportMDSPrompt.EXPORT && set != null) {
     205    if (result == ExportMDSPrompt.EXPORT && set != null) {
    206206        File file = emdsp.getSelectedFile();
    207207        MetadataSet set_copy = new MetadataSet(set, emdsp.getSelectedCondition());
     
    283283    for(int i = 0; i < listeners.size(); i++) {
    284284        ((MSMListener)listeners.get(i)).valueChanged(event);
    285     }         
     285    }
    286286    }
    287287    /** Builds a list of elements that have been assigned as metadata in this collection. We go through all of the elements, looking for elements whose occurances are greater than 0. A convenience call to the version with one parameter.
     
    13041304    }
    13051305}
    1306 
  • trunk/gli/src/org/greenstone/gatherer/msm/parsers/GreenstoneMetadataParser.java

    r5581 r5589  
    2626 */
    2727package org.greenstone.gatherer.msm.parsers;
     28
    2829/**************************************************************************************
    2930 * Written:      ??/??/02
  • trunk/gli/src/org/greenstone/gatherer/undo/UndoManager.java

    r5581 r5589  
    5454import org.greenstone.gatherer.msm.Metadata;
    5555import org.greenstone.gatherer.msm.MSMEvent;
    56 import org.greenstone.gatherer.msm.MSMListenerAdapter;
    5756import org.greenstone.gatherer.util.ArrayTools;
    5857import org.greenstone.gatherer.util.DragComponent;
Note: See TracChangeset for help on using the changeset viewer.