Changeset 5590


Ignore:
Timestamp:
2003-10-07T14:48:08+13:00 (21 years ago)
Author:
mdewsnip
Message:

Could it be I've finished adding tooltips?? Why yes, very nearly... and a big "hallelulah" for that.

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

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentConfiguration.java

    r5527 r5590  
    3131import java.util.*;
    3232import javax.swing.*;
     33import org.greenstone.gatherer.Dictionary;
    3334import org.greenstone.gatherer.Gatherer;
    3435import org.greenstone.gatherer.cdm.Argument;
     
    7677    /** The size used for the dialog. */
    7778    static final private Dimension SIZE = new Dimension(800, 425);
     79
    7880    /** Constructor.
    7981     * @param data The plugin or classifier whose arguments we are configuring, in the form of its supported <strong>ArgumentContainer</strong> interface.
     
    8486    this.data = data;
    8587    this.self = this;
    86     String custom_str = data.getCustom();
     88
    8789    // Create
    8890    setModal(true);
    8991    setSize(SIZE);
    90     setTitle(get("CDM.ArgumentConfiguration.Title"));
    9192    setJMenuBar(new SimpleMenuBar("designingacollection")); // can we tell whether we are doing a classifier or plugin, to make the help more specific??   
    92     JPanel button_pane = new JPanel();
    93     cancel = new JButton(get("General.Cancel"));
    94     cancel.setMnemonic(KeyEvent.VK_C);
     93    Dictionary.setText(this, "CDM.ArgumentConfiguration.Title");
     94
    9595    central_pane = new JPanel();
    9696    JPanel content_pane = (JPanel) getContentPane();
    97     if(custom_str != null) {
     97
     98    JPanel custom_pane = new JPanel();
     99    String custom_str = data.getCustom();
     100    if (custom_str != null) {
    98101        custom = new JTextField(custom_str);
    99102    }
     
    101104        custom = new JTextField();
    102105    }
    103     JLabel custom_label = new JLabel(get("CDM.ArgumentConfiguration.Custom"));
     106    JLabel custom_label = new JLabel();
    104107    custom_label.setPreferredSize(LABEL_SIZE);
    105     JPanel custom_pane = new JPanel();
     108    Dictionary.setText(custom_label, "CDM.ArgumentConfiguration.Custom");
     109
     110    JPanel header_pane = new JPanel();
     111    JLabel header = new JLabel();
     112    header.setHorizontalAlignment(JLabel.CENTER);
     113    header.setOpaque(true);
    106114    String args[] = new String[1];
    107115    args[0] = data.getName();
    108     JLabel header = new JLabel(get("CDM.ArgumentConfiguration.Header",args));
    109     args = null;
    110     header.setHorizontalAlignment(JLabel.CENTER);
    111     header.setOpaque(true);
    112     JPanel header_pane = new JPanel();
    113     ok = new JButton(get("General.OK"));
     116    Dictionary.setText(header, "CDM.ArgumentConfiguration.Header", args);
     117
     118    JPanel button_pane = new JPanel();
     119    cancel = new JButton();
     120    cancel.setMnemonic(KeyEvent.VK_C);
     121    Dictionary.setBoth(cancel, "General.Cancel", "General.Pure_Cancel_Tooltip");
     122    ok = new JButton();
    114123    ok.setMnemonic(KeyEvent.VK_O);
     124    Dictionary.setBoth(ok, "General.OK", "General.OK_Tooltip");
     125
    115126    // Listeners
    116127    cancel.addActionListener(this);
    117128    ok.addActionListener(this);
     129
    118130    // Layout
    119131    custom_pane.setLayout(new BorderLayout());
     
    148160    screen_size = null;
    149161    }
     162
    150163    /** Any implementation of ActionListener must include this method so that we can be informed when an action has occured on one of the controls we are listening to.
    151       * @param event An <strong>ActionEvent</strong> containing pertinant information about the event that fired this call.
    152       * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl
    153       * @see org.greenstone.gatherer.cdm.ArgumentContainer
    154       */
     164     * @param event An <strong>ActionEvent</strong> containing pertinant information about the event that fired this call.
     165     * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl
     166     * @see org.greenstone.gatherer.cdm.ArgumentContainer
     167     */
    155168    public void actionPerformed(ActionEvent event) {
    156169    boolean cont = true;
    157     if(event.getSource() == ok) {
     170    if (event.getSource() == ok) {
    158171        // Update the details stored in the data objects arguments.
    159172        data.setCustom(custom.getText());
     
    174187    }
    175188    }
     189
    176190    /** Destructor. */
    177191    public void destroy() {
     
    183197    self = null;
    184198    }
     199
    185200    /** Method which actually forces the dialog to be shown on screen.
    186       * @return <i>true</i> if the user completed configuration and pressed ok, <i>false</i> otherwise.
    187       */
     201     * @return <i>true</i> if the user completed configuration and pressed ok, <i>false</i> otherwise.
     202     */
    188203    public boolean display() {
    189204    setVisible(true);
     
    201216    header_label.setHorizontalAlignment(JLabel.CENTER);
    202217    header_label.setOpaque(true);
    203     // Layout.
     218
     219    // Layout
    204220    inner_pane.setLayout(new BorderLayout());
    205221    inner_pane.add(header_label, BorderLayout.CENTER);
     
    211227
    212228    /** Method to iterate through the arguments associated with whatever argument container we are building an argument control view for, creating the appropriate controls for each.
    213       * @see org.greenstone.gatherer.cdm.Argument
    214       * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl
    215       */
     229     * @see org.greenstone.gatherer.cdm.Argument
     230     * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl
     231     */
    216232    private void generateControls() {
    217233    ArrayList arguments = data.getArguments(true, false);
    218234    int total_height = 250;
    219     int size = arguments.size();
    220     for(int i = 0; i < size; i++) {
     235    for(int i = 0; i < arguments.size(); i++) {
    221236        Argument argument = (Argument) arguments.get(i);
    222237        ArgumentControl argument_control = new ArgumentControl(argument);
     
    231246    }
    232247    }
    233     /** Method to retrieve a phrase from the dictionary based on a key.
    234       * @param key A <strong>String</strong> used to find the correct phrase.
    235       * @param args A <strong>String[]</strong> of arguments used in formatting and filling out the phrase.
    236       * @return A <strong>String</strong> containing the correct phrase with the correct formatting.
    237       */
    238     private String get(String key) {
    239     return get(key, null);
    240     }
    241     /** Method to retrieve a phrase from the dictionary based on a key.
    242       * @param key A <strong>String</strong> used to find the correct phrase.
    243       * @return A <strong>String</strong> containing the correct phrase with the correct formatting.
    244       */
    245     private String get(String key, String args[]) {
    246     if(key.indexOf(".") == -1) {
    247         key = "CDM.ArgumentConfiguration." + key;
    248     }
    249     return Gatherer.dictionary.get(key, args);
    250     }
     248
    251249    /** This class encapsulates all the technical difficulty of creating a specific control based on an Argument. */
    252250    private class ArgumentControl
     
    280278        String tip = "<html>" + argument.getDescription() + "</html>";
    281279        tip = Utility.formatHTMLWidth(tip, 60);
     280
    282281        // If this is the first control, there is no history.
    283282        if(previous_owner == null) {
     
    418417            model.addElement(values.get(i));
    419418        }
    420         one = new JButton(get("CDM.ArgumentConfiguration.Add"));
     419
     420        one = new JButton();
    421421        one.addActionListener(new AddListener((JComboBox)value, list));
    422         two = new JButton(get("CDM.ArgumentConfiguration.Remove"));
     422        Dictionary.setBoth(one, "CDM.ArgumentConfiguration.Add", "CDM.ArgumentConfiguration.Add_Tooltip");
     423        two = new JButton();
    423424        two.addActionListener(new RemoveListener(list));
     425        Dictionary.setBoth(two, "CDM.ArgumentConfiguration.Remove", "CDM.ArgumentConfiguration.Remove_Tooltip");
     426
    424427        if(argument.getValues().size() > 0 || argument.isRequired()) {
    425428            enabled.setSelected(true);
     
    537540                String args[] = new String[1];
    538541                args[0] = argument.getName();
    539                 JOptionPane.showMessageDialog(self, get("CDM.ArgumentConfiguration.Required_Argument", args), get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);
     542                JOptionPane.showMessageDialog(self, Dictionary.newget("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.newget("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);
    540543                args = null;
    541544                return false;
     
    560563                args[0] = argument.getName();
    561564                args[1] = result;
    562                 JOptionPane.showMessageDialog(self, get("CDM.ArgumentConfiguration.Bad_Integer", args), get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);
     565                JOptionPane.showMessageDialog(self, Dictionary.newget("CDM.ArgumentConfiguration.Bad_Integer", args), Dictionary.newget("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);
    563566                args = null;
    564567                return false;
     
    570573                String args[] = new String[1];
    571574                args[0] = argument.getName();
    572                 JOptionPane.showMessageDialog(self, get("CDM.ArgumentConfiguration.Required_Argument", args), get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);
     575                JOptionPane.showMessageDialog(self, Dictionary.newget("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.newget("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);
    573576                args = null;
    574577                return false;
     
    609612                String args[] = new String[1];
    610613                args[0] = argument.getName();
    611                 JOptionPane.showMessageDialog(self, get("CDM.ArgumentConfiguration.Required_Argument", args), get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);
     614                JOptionPane.showMessageDialog(self, Dictionary.newget("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.newget("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);
    612615                return false;
    613616            }
     
    626629    }
    627630    /** Method to ensure that a certain value is selected, if it exists within that combobox to begin with.
    628             * @param combobox The <strong>JComboBox</strong> whose selection we are trying to preset.
    629             * @param target The desired value of the selection as a <strong>String</strong>.
    630             * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl.ListOption
    631             * @see org.greenstone.gatherer.msm.ElementWrapper
    632             */
     631     * @param combobox The <strong>JComboBox</strong> whose selection we are trying to preset.
     632     * @param target The desired value of the selection as a <strong>String</strong>.
     633     * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl.ListOption
     634     * @see org.greenstone.gatherer.msm.ElementWrapper
     635     */
    633636    public void selectValue(JComboBox combobox, String target) {
    634637        for(int i = 0; i < combobox.getItemCount(); i++) {
     
    654657    }
    655658    /** Explicitly sets the value of a JTextField type control to the given String.
    656             * @param value_str The new value of the control as a <strong>String</strong>.
    657             */
     659     * @param value_str The new value of the control as a <strong>String</strong>.
     660     */
    658661    public void setValue(String value_str) {
    659662        ((JTextField)value).setText(value_str);
     
    662665    private class AddListener
    663666        implements ActionListener {
    664                 /** The model behind the target list. */
     667        /** The model behind the target list. */
    665668        private DefaultListModel model = null;
    666                 /** The source for data to be added to the list. */
     669            /** The source for data to be added to the list. */
    667670        private JComboBox source = null;
    668                 /** The list to add data to. */
     671        /** The list to add data to. */
    669672        private JList target = null;
    670                 /** Constructor.
    671                 * @param source A <strong>JComboBox</strong> which serves as the source for data.
    672                 * @param target A <strong>JList</strong> which serves as the target for data.
    673                 */
     673        /** Constructor.
     674        * @param source A <strong>JComboBox</strong> which serves as the source for data.
     675        * @param target A <strong>JList</strong> which serves as the target for data.
     676        */
    674677        public AddListener(JComboBox source, JList target) {
    675678        this.model = (DefaultListModel) target.getModel();
     
    677680        this.target = target;
    678681        }
    679                 /** When the add button is clicked, we attempt to add the selected metadata from the source into the target.
    680                 * @param event An <strong>ActionEvent</strong> containing information about the event.
    681                 * @see org.greenstone.gatherer.msm.ElementWrapper
    682                 */
     682        /** When the add button is clicked, we attempt to add the selected metadata from the source into the target.
     683        * @param event An <strong>ActionEvent</strong> containing information about the event.
     684        * @see org.greenstone.gatherer.msm.ElementWrapper
     685        */
    683686        public void actionPerformed(ActionEvent event) {
    684687        ElementWrapper element = (ElementWrapper) source.getSelectedItem();
     
    706709    private class EnabledListener
    707710        implements ActionListener {
    708                 /** One of two possible buttons that might have their enabled state changed by this listener. */
     711        /** One of two possible buttons that might have their enabled state changed by this listener. */
    709712        private JButton one = null;
    710                 /** One of two possible buttons that might have their enabled state changed by this listener. */
     713        /** One of two possible buttons that might have their enabled state changed by this listener. */
    711714        private JButton two = null;
    712                 /** An editor component, such as a JComboBox or JTextField, that might have its enabled state changed by this listener. */
     715        /** An editor component, such as a JComboBox or JTextField, that might have its enabled state changed by this listener. */
    713716        private JComponent target = null;
    714                 /** A list which might have its enabled state changed by this listener. */
     717        /** A list which might have its enabled state changed by this listener. */
    715718        private JList list = null;
    716                 /** Constructor.
    717                 * @param one A <strong>JButton</strong> whose enabled state is determined by the listener, or <i>null</i> if no button.
    718                 * @param two A <strong>JButton</strong> whose enabled state is determined by the listener, or <i>null</i> if no button.
    719                 * @param list A <strong>JList</strong> whose enabled state is determined by the listener, or <i>null</i> if no list.
    720                 * @param list A <strong>JComponent</strong> whose enabled state is determined by the listener, or <i>null</i> if no component.
    721                 */
     719        /** Constructor.
     720        * @param one A <strong>JButton</strong> whose enabled state is determined by the listener, or <i>null</i> if no button.
     721        * @param two A <strong>JButton</strong> whose enabled state is determined by the listener, or <i>null</i> if no button.
     722        * @param list A <strong>JList</strong> whose enabled state is determined by the listener, or <i>null</i> if no list.
     723        * @param list A <strong>JComponent</strong> whose enabled state is determined by the listener, or <i>null</i> if no component.
     724        */
    722725        public EnabledListener(JButton one, JButton two, JList list, JComponent target) {
    723726        this.list = list;
     
    726729        this.two = two;
    727730        }
    728                 /** Any implementation of ActionListener must include this method so that we can be informed when an action has been performed on or registered check box, prompting us to change the state of the other controls as per the users request.
    729                 * @param event An <strong>ActionEvent</strong> containing information about the click.
    730                 */
     731        /** Any implementation of ActionListener must include this method so that we can be informed when an action has been performed on or registered check box, prompting us to change the state of the other controls as per the users request.
     732        * @param event An <strong>ActionEvent</strong> containing information about the click.
     733        */
    731734        public void actionPerformed(ActionEvent event) {
    732735        JCheckBox source = (JCheckBox)event.getSource();
     
    756759    private class HierarchyListener
    757760        implements ItemListener {
    758                 /** Any implementation of ItemListener must include this method so that we can be informed when an item from the list is selected, and generate a predetermined hfile for that selection.
    759                 * @param event An <strong>ItemEvent</strong> containing information about the selection.
    760                 * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl
    761                 * @see org.greenstone.gatherer.valuetree.GValueModel
    762                 */
     761        /** Any implementation of ItemListener must include this method so that we can be informed when an item from the list is selected, and generate a predetermined hfile for that selection.
     762        * @param event An <strong>ItemEvent</strong> containing information about the selection.
     763        * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl
     764        * @see org.greenstone.gatherer.valuetree.GValueModel
     765        */
    763766        public void itemStateChanged(ItemEvent event) {
    764767        // Determine if the selected element represents a hierarchy.
     
    783786        /** The maximum length of this String version of this item. */
    784787        //private int MAX_DESC = 35;
    785                 /** The description of the value for this item. */
     788        /** The description of the value for this item. */
    786789        private String description = null;
    787                 /** A cached value for the text value of this option, as it never changes after the first call to toString(). */
     790        /** A cached value for the text value of this option, as it never changes after the first call to toString(). */
    788791        private String text = null;
    789                 /** The value for this item. */
     792        /** The value for this item. */
    790793        private String value = null;
    791                 /** Constructor.
    792                 * @param value The value for this item as a <strong>String</strong>.
    793                 * @param description The description of the value as a <strong>String</strong>.
    794                 */
     794        /** Constructor.
     795        * @param value The value for this item as a <strong>String</strong>.
     796        * @param description The description of the value as a <strong>String</strong>.
     797        */
    795798        public ListOption(String value, String description) {
    796799        this.description = description;
    797800        this.value = value;
    798801        }
    799                 /** Compare two possible ListOption objects for ordering.
    800                 * @param object The <strong>Object</strong> to compare to.
    801                 * @return An <i>int</i> indicating order as explained in String.
    802                 * @see java.lang.String#compareTo
    803                 */
     802        /** Compare two possible ListOption objects for ordering.
     803        * @param object The <strong>Object</strong> to compare to.
     804        * @return An <i>int</i> indicating order as explained in String.
     805        * @see java.lang.String#compareTo
     806        */
    804807        public int compareTo(Object object) {
    805808        return toString().compareTo(object.toString());
    806809        }
    807                 /** Tests two possible ListOption objects for equality. Uses the result from compareTo().
    808                 * @param The <strong>Object</strong> which may be equal.
    809                 * @return <i>true</i> if the objects are equal, <i>false</i> otherwise.
    810                 */
     810        /** Tests two possible ListOption objects for equality. Uses the result from compareTo().
     811        * @param The <strong>Object</strong> which may be equal.
     812        * @return <i>true</i> if the objects are equal, <i>false</i> otherwise.
     813        */
    811814        public boolean equals(Object object) {
    812815        return (compareTo(object) == 0);
    813816        }
    814                 /** Retrieve the description of this list item.
    815                 * @return The description as a <strong>String</strong>.
    816                 */
     817        /** Retrieve the description of this list item.
     818        * @return The description as a <strong>String</strong>.
     819        */
    817820        public String getDesc() {
    818821        return description;
    819822        }
    820                 /** Retrieve the value of this list item.
    821                 * @return The value as a <strong>String</strong>.
    822                 */
     823        /** Retrieve the value of this list item.
     824        * @return The value as a <strong>String</strong>.
     825        */
    823826        public String getValue() {
    824827        return value;
    825828        }
    826                 /** Convert this object into a nice readable String.
    827                 * @return A <strong>String</strong> representing this object.
    828                 */
     829            /** Convert this object into a nice readable String.
     830        * @return A <strong>String</strong> representing this object.
     831        */
    829832        public String toString() {
    830833        if(text == null) {
     
    842845    private class RemoveListener
    843846        implements ActionListener {
    844                 /** The model behind the target list. */
     847        /** The model behind the target list. */
    845848        private DefaultListModel model = null;
    846                 /** The list to remove data from. */
     849        /** The list to remove data from. */
    847850        private JList target = null;
    848                 /** Constructor.
    849                 * @param target A <strong>JList</strong>.
    850                 */
     851        /** Constructor.
     852        * @param target A <strong>JList</strong>.
     853        */
    851854        public RemoveListener(JList target) {
    852855        this.model = (DefaultListModel) target.getModel();
    853856        this.target = target;
    854857        }
    855                 /** When the remove button is clicked, we attempt to remove the selected metadata from the target.
    856                 * @param event An <strong>ActionEvent</strong> containing information about the event.
    857                 */
     858        /** When the remove button is clicked, we attempt to remove the selected metadata from the target.
     859        * @param event An <strong>ActionEvent</strong> containing information about the event.
     860        */
    858861        public void actionPerformed(ActionEvent event) {
    859862        if(!target.isSelectionEmpty()) {
     
    866869    private class ToolTipUpdater
    867870        implements ActionListener {
    868                 /** Any implementation of an ActionListener must include this method so that we can be informed when the selection in a combobox has changed and update the tooltip accordingly.
    869                 * @param event An <strong>ActionEvent</strong> containing information about the action that fired this call.
    870                 */
     871        /** Any implementation of an ActionListener must include this method so that we can be informed when the selection in a combobox has changed and update the tooltip accordingly.
     872        * @param event An <strong>ActionEvent</strong> containing information about the action that fired this call.
     873        */
    871874        public void actionPerformed(ActionEvent event) {
    872875        JComboBox source = (JComboBox)event.getSource();
  • trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentContainer.java

    r4932 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      20/05/02
     
    3132 **************************************************************************************/
    3233import java.util.ArrayList;
     34
    3335/** This class provides an interface to any class that contains a list of Arguments.
    3436 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    5557    public void setCustom(String custom);
    5658}
    57 
    58 
    59 
    60 
    61 
  • trunk/gli/src/org/greenstone/gatherer/cdm/Classifier.java

    r5209 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      01/05/02
     
    4243import org.greenstone.gatherer.util.Utility;
    4344import org.w3c.dom.*;
     45
    4446/** This class is responsible for storing information from a parsed classinfo.pl call in such a way that it allows easy access to parsed details for the purposes of user design and specification of classifiers.
    4547 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    130132
    131133    /** Constructor.
    132       * @param name The name of this classifier as a <strong>String</strong>.
    133       * @param desc A description of this classifier as a <strong>String</strong>.
    134       * @param super_classifier The super class of this classifier, as a <strong>Classifier</strong>.
    135       */
     134     * @param name The name of this classifier as a <strong>String</strong>.
     135     * @param desc A description of this classifier as a <strong>String</strong>.
     136     * @param super_classifier The super class of this classifier, as a <strong>Classifier</strong>.
     137     */
    136138    public Classifier(String name, String description, Classifier super_classifier) {
    137139    super();
     
    142144
    143145    /** Method to add an argument to this classifier. Only adds the argument if it isn't already present.
    144       * @param argument The <strong>Argument</strong> to add.
    145       */
     146     * @param argument The <strong>Argument</strong> to add.
     147     */
    146148    public void addArgument(Argument argument) {
    147149    if(element == null && !contains(argument)) {
     
    152154
    153155    /** Method to compare two classifiers for ordering.
    154       * @param object The classifier we are comparing to, as an <strong>Object</strong>.
    155       * @return An <i>int</i> specifying the classifier order, using values as set out in String.
    156       * @see java.lang.String#compareTo
    157       */
     156     * @param object The classifier we are comparing to, as an <strong>Object</strong>.
     157     * @return An <i>int</i> specifying the classifier order, using values as set out in String.
     158     * @see java.lang.String#compareTo
     159     */
    158160    public int compareTo(Object object) {
    159161    if(object == null) {
     
    205207
    206208     /** Retrieve all of the arguments available to this base classifier, including its super classifiers arguments. Some complexity is added by allowing the caller to choose whether they want normal arguments, custom arguments, or both.
    207      * @return an ArrayList of all of the arguments, starting with those for this classifier and ending with the arguments for basplug or similiar root classifier
    208      */
     209      * @return an ArrayList of all of the arguments, starting with those for this classifier and ending with the arguments for basplug or similiar root classifier
     210      */
    209211    public ArrayList getArguments(boolean include_normal, boolean include_custom) {
    210212    ArrayList arguments = new ArrayList();
     
    387389
    388390    /** Method to print out this classifier as it would appear to the user in the interface
    389       * @return A <strong>String</strong> containing a single classifier command.
    390       */
     391     * @return A <strong>String</strong> containing a single classifier command.
     392     */
    391393    public String toString() {
    392394    if(element != null) {
  • trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java

    r5342 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      01/05/02
     
    3940import javax.swing.event.*;
    4041import org.apache.xerces.parsers.*;
     42import org.greenstone.gatherer.Dictionary;
    4143import org.greenstone.gatherer.Gatherer;
    4244import org.greenstone.gatherer.cdm.Argument;
     
    5658import org.w3c.dom.*;
    5759import org.xml.sax.*;
     60
    5861/** This class is responsible for keeping track of all the classifiers assigned to this collection, and providing methods for adding and removing them.
    5962 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    197200        if(index < 0) {
    198201            String args[] = new String[2];
    199             args[0] = get("CDM.ClassifierManager.Classifier");
     202            args[0] = Dictionary.newget("CDM.ClassifierManager.Classifier");
    200203            args[1] = classifier.getName();
    201             JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.At_Top", args), get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
     204            JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("CDM.Move.At_Top", args), Dictionary.newget("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
    202205            return;
    203206        }
     
    210213        if(index >= getSize()) {
    211214            String args[] = new String[2];
    212             args[0] = get("CDM.ClassifierManager.Classifier_Str");
     215            args[0] = Dictionary.newget("CDM.ClassifierManager.Classifier_Str");
    213216            args[1] = classifier.getName();
    214             JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.At_Bottom", args), get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
     217            JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("CDM.Move.At_Bottom", args), Dictionary.newget("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
    215218            return;
    216219        }
     
    223226
    224227    /** This method removes an assigned classifier. I was tempted to call it unassign, but remove is more consistant. Note that there is no way to remove a classifier from the library.
    225       * @param classifier The Classifier to remove
    226       * @see org.greenstone.gatherer.cdm.DynamicListModel
    227       */
     228     * @param classifier The Classifier to remove
     229     * @see org.greenstone.gatherer.cdm.DynamicListModel
     230     */
    228231    public void removeClassifier(Classifier classifier) {
    229232    remove(classifier);
     
    243246    catch (Exception error) {
    244247    }
    245     }
    246 
    247     /** Retrieve a phrase from the dictionary based on a certain key.
    248       * @param key The search <strong>String</strong>.
    249       * @return The matching phrase from the Dictionary.
    250       */
    251     private String get(String key) {
    252     return get(key, (String[])null);
    253     }
    254     /** Retrieve a phrase from the dictionary based on a certain key and certain arguments.
    255       * @param key The search <strong>String</strong>.
    256       * @param args A <strong>String[]</strong> used to complete and format the returned phrase.
    257       * @return The matching phrase from the Dictionary.
    258       * @see org.greenstone.gatherer.Dictionary
    259       * @see org.greenstone.gatherer.Gatherer
    260       */
    261     private String get(String key, String arg) {
    262     String[] args = null;
    263     if(arg != null) {
    264         args = new String[1];
    265         args[0] = arg;
    266     }
    267     return get(key, args);
    268     }
    269 
    270     private String get(String key, String[] args) {
    271     if(key.indexOf(".") == -1) {
    272         key = "CDM.ClassifierManager." + key;
    273     }
    274     return Gatherer.dictionary.get(key, args);
    275248    }
    276249
     
    364337        String classifier_name = getClassifierName(classifier);
    365338        Gatherer.println("Zero length argument xml detected for: " + classifier_name);
    366         JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.ClassifierManager.Classifier_XML_Parse_Failed", classifier_name), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     339        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("CDM.ClassifierManager.Classifier_XML_Parse_Failed", classifier_name), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    367340        classifier_name = null;
    368341        }
     
    397370        if(files != null) {
    398371        // Create a progress indicator.
    399         ParsingProgress progress = new ParsingProgress(get("CDM.ClassifierManager.Parsing.Title"), get("CDM.ClassifierManager.Parsing.Message"), files.length);
     372        ParsingProgress progress = new ParsingProgress(Dictionary.newget("CDM.ClassifierManager.Parsing.Title"), Dictionary.newget("CDM.ClassifierManager.Parsing.Message"), files.length);
    400373        for(int i = 0; i < files.length; i++) {
    401374            // We only want to check Perl Modules.
     
    413386
    414387    /** Parses a DOM tree model turning it into a Classifier and its associated arguments.
    415       * @param root The <strong>Node</strong> at the root of the DOM model.
    416       * @return A newly created <strong>Classifier</strong> based on the information parsed from the DOM model.
    417       * @see org.greenstone.gatherer.cdm.Argument
    418       */
     388     * @param root The <strong>Node</strong> at the root of the DOM model.
     389     * @return A newly created <strong>Classifier</strong> based on the information parsed from the DOM model.
     390     * @see org.greenstone.gatherer.cdm.Argument
     391     */
    419392    private Classifier parseXML(Node root) {
    420393    Classifier classifier = new Classifier();
     
    506479    return null;
    507480    }
     481
    508482    /** A class which provides controls for assigned and editing classifiers. */
    509483    private class ClassifierControl
     
    532506    /** The text area containing instructions on the use of this control. */
    533507    private JTextArea instructions = null;
     508
    534509    /** Constructor.
    535510     * @see org.greenstone.gatherer.cdm.ClassifierManager.Control.AddListener
     
    540515        Collections.sort(library);
    541516        // Create
    542         add = new JButton(get("CDM.ClassifierManager.Add"));
     517        add = new JButton();
     518        Dictionary.setBoth(add, "CDM.ClassifierManager.Add", "CDM.ClassifierManager.Add_Tooltip");
    543519        JPanel button_pane = new JPanel();
    544520        JPanel central_pane = new JPanel();
    545         configure = new JButton(get("CDM.ClassifierManager.Configure"));
     521        configure = new JButton();
    546522        configure.setEnabled(false);
     523        Dictionary.setBoth(configure, "CDM.ClassifierManager.Configure", "CDM.ClassifierManager.Configure_Tooltip");
    547524        JPanel header_pane = new JPanel();
    548         instructions = new JTextArea(get("CDM.ClassifierManager.Instructions"));
     525        instructions = new JTextArea();
    549526        instructions.setEditable(false);
    550527        instructions.setLineWrap(true);
    551528        instructions.setRows(6);
    552529        instructions.setWrapStyleWord(true);
     530        Dictionary.setText(instructions, "CDM.ClassifierManager.Instructions");
    553531
    554532        classifier = new GComboBox(getAvailable());
     
    559537        classifier.setTextNonSelectionColor(Gatherer.config.getColor("coloring.workspace_tree_foreground", false));
    560538        classifier.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
    561 
    562         JLabel classifier_label = new JLabel(get("CDM.ClassifierManager.Classifier"));
     539        Dictionary.setTooltip(classifier, "CDM.ClassifierManager.Classifier_Tooltip");
     540
     541        JLabel classifier_label = new JLabel();
     542        Dictionary.setText(classifier_label, "CDM.ClassifierManager.Classifier");
    563543        classifier_list = new JList(model);
    564544        classifier_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    565         JLabel classifier_list_label = new JLabel(get("CDM.ClassifierManager.Assigned"));
     545        JLabel classifier_list_label = new JLabel();
    566546        classifier_list_label.setHorizontalAlignment(JLabel.CENTER);
    567547        classifier_list_label.setOpaque(true);
     548        Dictionary.setText(classifier_list_label, "CDM.ClassifierManager.Assigned");
    568549        JPanel classifier_list_pane = new JPanel();
    569550        JPanel classifier_pane = new JPanel();
    570         remove = new JButton(get("CDM.ClassifierManager.Remove"));
     551        remove = new JButton();
    571552        remove.setEnabled(false);
    572         JLabel title = new JLabel(get("CDM.ClassifierManager.Title"));
     553        Dictionary.setBoth(remove, "CDM.ClassifierManager.Remove", "CDM.ClassifierManager.Remove_Tooltip");
     554
     555        JLabel title = new JLabel();
    573556        title.setHorizontalAlignment(JLabel.CENTER);
    574557        title.setOpaque(true);
     558        Dictionary.setText(title, "CDM.ClassifierManager.Title");
     559
    575560        JPanel temp = new JPanel(new BorderLayout());
    576561
    577562        JPanel move_button_pane = new JPanel();
    578563
    579         move_top_button = new DoubleImageButton(get("CDM.Move.Move_Top"), Utility.getImage("arrow-top.gif"), Utility.getImage("arrow-top-disabled.gif"));
     564        move_top_button = new DoubleImageButton("", Utility.getImage("arrow-top.gif"), Utility.getImage("arrow-top-disabled.gif"));
    580565        move_top_button.setEnabled(false);
    581566        move_top_button.setMnemonic(KeyEvent.VK_T);
    582         move_top_button.setDisplayedMnemonicIndex(8);  // !! English-centric hack
     567        // move_top_button.setDisplayedMnemonicIndex(8);  // !! English-centric hack
    583568        move_top_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
    584 
    585         move_up_button = new DoubleImageButton(get("CDM.Move.Move_Up"), Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif"));
     569        Dictionary.registerBoth(move_top_button, "CDM.Move.Move_Top", "CDM.Move.Move_Top_Tooltip");
     570
     571        move_up_button = new DoubleImageButton("", Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif"));
    586572        move_up_button.setEnabled(false);
    587573        move_up_button.setMnemonic(KeyEvent.VK_U);
    588574        move_up_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
    589 
    590         move_down_button = new DoubleImageButton(get("CDM.Move.Move_Down"), Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif"));
     575        Dictionary.registerBoth(move_up_button, "CDM.Move.Move_Up", "CDM.Move.Move_Up_Tooltip");
     576
     577        move_down_button = new DoubleImageButton("", Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif"));
    591578        move_down_button.setEnabled(false);
    592579        move_down_button.setMnemonic(KeyEvent.VK_D);
    593580        move_down_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
    594 
    595         move_bottom_button = new DoubleImageButton(get("CDM.Move.Move_Bottom"), Utility.getImage("arrow-bottom.gif"), Utility.getImage("arrow-bottom-disabled.gif"));
     581        Dictionary.registerBoth(move_down_button, "CDM.Move.Move_Down", "CDM.Move.Move_Down_Tooltip");
     582
     583        move_bottom_button = new DoubleImageButton("", Utility.getImage("arrow-bottom.gif"), Utility.getImage("arrow-bottom-disabled.gif"));
    596584        move_bottom_button.setEnabled(false);
    597585        move_bottom_button.setMnemonic(KeyEvent.VK_B);
    598586        move_bottom_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
     587        Dictionary.registerBoth(move_bottom_button, "CDM.Move.Move_Bottom", "CDM.Move.Move_Bottom_Tooltip");
    599588
    600589        // Listeners
     
    610599        move_top_button.addActionListener(ml);
    611600        move_up_button.addActionListener(ml);
     601
    612602        // Layout
    613603        title.setBorder(BorderFactory.createEmptyBorder(0,0,2,0));
     
    645635
    646636        // Scope these mad bordering skillz.
    647         temp.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,0,5,0), BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("CDM.ClassifierManager.Controls")), BorderFactory.createEmptyBorder(2,2,2,2))));
     637        temp.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,0,5,0), BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("CDM.ClassifierManager.Controls")), BorderFactory.createEmptyBorder(2,2,2,2))));
    648638        temp.add(classifier_pane, BorderLayout.NORTH);
    649639        temp.add(button_pane, BorderLayout.SOUTH);
     
    658648        add(central_pane, BorderLayout.CENTER);
    659649    }
     650
    660651    /** Method which acts like a destructor, tidying up references to persistant objects.
    661             */
     652     */
    662653    public void destroy() {
    663654        add = null;
     
    668659        remove = null;
    669660    }
     661
    670662    /** This method is overridden to ensure the instructions are scrolled to top, before the super classes updateUI() is called.
    671             */
     663     */
    672664    public void gainFocus() {
    673665        if(instructions != null) {
     
    720712            }
    721713            else {
    722                 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.ClassifierManager.Classifier_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     714                JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("CDM.ClassifierManager.Classifier_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    723715            }
    724716            }
     
    728720        }
    729721    }
     722
    730723    /** Listens for double clicks apon the list and react as if the configure button was pushed. */
    731724    private class ClickListener
     
    748741        }
    749742    }
     743
    750744    /** This class listens for actions upon the configure button in the controls, and if detected creates a new ArgumentConfiguration dialog box to allow for configuration.
    751             */
     745     */
    752746    private class ConfigureListener
    753747        implements ActionListener {
     
    826820
    827821    /** This class listens for actions upon the remove button in the controls, and if detected calls the removeClassifier() method.
    828             */
     822     */
    829823    private class RemoveListener
    830824        implements ActionListener {
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java

    r5290 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829import java.awt.*;
    2930import java.awt.event.*;
     
    3940import org.greenstone.gatherer.util.Utility;
    4041import org.w3c.dom.*;
     42
    4143/** This class provides either access to a pseudo-G3 document, or parses a collect.cfg file in such a way as to provide an xml-type view of its content. This later version is useful as it allows the manipulation and free form editing of a legacy collect.cfg file while still allowing the various CDM data managers to base themselves directly on this model (whereas they used to be independant ListModels which clobbered the ordering of unparsed commands).
    4244 * @author John Thompson, Greenstone Digital Library, University of Waikato
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java

    r4967 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829import java.awt.*;
    2930import java.awt.event.*;
     
    4243import org.greenstone.gatherer.cdm.SubcollectionManager;
    4344import org.greenstone.gatherer.cdm.TranslationView;
     45
    4446/** This manager provides access to submanagers, which in turn provide tools for the designing of Greenstone collections via the information stored in etc/collect.cfg. This class acts as a hub for the managers that handle specific parts of the configuration such as classifiers, format strings and language settings.
    4547 * @author John Thompson, Greenstone Digital Library, University of Waikato
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMeta.java

    r5254 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:     
     
    161162
    162163    /** Method to print out this class as it would appear within the collection configuration file.
    163       * @return A <strong>String</strong> containing the text value of this class.
    164       */
     164     * @return A <strong>String</strong> containing the text value of this class.
     165     */
    165166    public String toString() {
    166167    if(text == null) {
     
    170171    }
    171172}
    172 
    173 
    174 
    175 
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMetaManager.java

    r5564 r5590  
    4040import org.greenstone.gatherer.util.Utility;
    4141import org.w3c.dom.*;
     42
    4243/** This class is responsible for maintaining a list of assigned collection level metadata, and for allows manipulations on the aforementioned data.
    4344 * @author John Thompson, Greenstone Digital Library, University of Waikato
  • trunk/gli/src/org/greenstone/gatherer/cdm/CommandTokenizer.java

    r4675 r5590  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.cdm;
    3738
    38  
    39 
    40 
    41 
    42 
    43 /* GPL_HEADER */
    44 package org.greenstone.gatherer.cdm;
    4539/**************************************************************************************
    4640 * Title:        Gatherer
     
    5145 **************************************************************************************/
    5246import java.util.StringTokenizer;
     47
    5348/** This class provides an extension to the standard StringTokenizer in that it recognizes quotes (or some form of bracketting) enclose a single token so in something like: <br>format Search '&lt;table&gt;&lt;img src=... &lt;/table&gt;'<br> the formatting string is parsed as a single token. Unfortunately this makes countTokens() unreliable for exact measurement of tokens remaining, and only useful for determining if there are tokens left to be processed (includes any that have already been read into command buffer).
    5449 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    118113    return result;
    119114    }
     115
    120116    /** Unfortunately the StringBuffer doesn't have a built in endsWith method, so I'll just have to implement my own.
    121117     * @param str The <strong>StringBuffer</strong> we are checking the end of.
     
    126122    String temp = str.toString();
    127123    if(temp.endsWith(target) != (str.lastIndexOf(target) == str.length() - target.length())) {
    128                 ///ystem.err.println("Holy error that'll crash the HFile creator if it happens twice, Batman!");
    129                 ///ystem.err.println("String = '" + temp + "'");
    130                 ///ystem.err.println("Target = '" + target + "'");
     124        ///ystem.err.println("Holy error that'll crash the HFile creator if it happens twice, Batman!");
     125        ///ystem.err.println("String = '" + temp + "'");
     126        ///ystem.err.println("Target = '" + target + "'");
    131127    }
    132128    return str.lastIndexOf(target) == str.length() - target.length();
    133129    }
    134130}
    135 
    136 
  • trunk/gli/src/org/greenstone/gatherer/cdm/DOMProxyListEntry.java

    r4932 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829import org.w3c.dom.*;
     30
    2931public interface DOMProxyListEntry
    3032    extends Comparable {
  • trunk/gli/src/org/greenstone/gatherer/cdm/DOMProxyListModel.java

    r5207 r5590  
    248248    }
    249249}
    250 
    251 
    252 
  • trunk/gli/src/org/greenstone/gatherer/cdm/DynamicListModel.java

    r4675 r5590  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.cdm;
    3738
    38  
    39 
    40 
    41 
    42 
    43 /* GPL_HEADER */
    44 package org.greenstone.gatherer.cdm;
    4539/**************************************************************************************
    4640 * Title:        Gatherer
     
    5246import javax.swing.ComboBoxModel;
    5347import javax.swing.DefaultListModel;
     48
    5449/** This class extends the functionality of the DefaultListModel to include simple methods for refreshing the contents of this model if one of its elements changes.
    5550 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    6661    public void addElement(Object element) {
    6762    if(auto_order) {
    68                 // Insert the object in its alphabetically correct place.
     63        // Insert the object in its alphabetically correct place.
    6964        int position = 0;
    7065        boolean found = false;
  • trunk/gli/src/org/greenstone/gatherer/cdm/ElementWrapper.java

    r4675 r5590  
    11package org.greenstone.gatherer.cdm;
     2
    23import org.greenstone.gatherer.msm.MSMUtils;
    34import org.w3c.dom.*;
     
    1112    /** Constructor.
    1213     * @param element The <strong>Node</strong> this object is wrapped around.
    13       */
     14     */
    1415    public ElementWrapper(Node element) {
    1516    this.element = element;
    1617    }
    1718    /** Compare two objects for ordering.
    18       * @param object The other <strong>Object</strong> to compare to.
    19       * @return An <i>int</i> indicating the ordering as is String.compareTo
    20       */
     19     * @param object The other <strong>Object</strong> to compare to.
     20     * @return An <i>int</i> indicating the ordering as is String.compareTo
     21     */
    2122    public int compareTo(Object object) {
    2223    if(object == null) {
     
    2627    }
    2728    /** Compare two objects for equality.
    28       * @param object The <strong>Object</strong> to compare to.
    29       * @return <i>true</i> if the objects are equal, <i>false</i> otherwise.
    30       */
     29     * @param object The <strong>Object</strong> to compare to.
     30     * @return <i>true</i> if the objects are equal, <i>false</i> otherwise.
     31     */
    3132    public boolean equals(Object object) {
    3233    if(compareTo(object) == 0) {
     
    3637    }
    3738    /** Retrieve the name of the element.
    38       * @return The fully qualified name as a <strong>String</strong>.
    39       * @see org.greenstone.gatherer.msm.MSMUtils
    40       */
     39     * @return The fully qualified name as a <strong>String</strong>.
     40     * @see org.greenstone.gatherer.msm.MSMUtils
     41     */
    4142    public String name() {
    4243    return MSMUtils.getFullName((Element)element);
    4344    }
    4445    /** Retrieve a textual representation of this object.
    45       * @return A <strong>String</strong>.
    46       * @see org.greenstone.gatherer.msm.MSMUtils
    47       */
     46     * @return A <strong>String</strong>.
     47     * @see org.greenstone.gatherer.msm.MSMUtils
     48     */
    4849    public String toString() {
    4950    return MSMUtils.getIdentifier(element) + ": " + MSMUtils.getDescription(element);
  • trunk/gli/src/org/greenstone/gatherer/cdm/Format.java

    r5231 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      06/05/02
  • trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r5342 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:     06/05/02
     
    3637import javax.swing.*;
    3738import javax.swing.event.*;
     39import org.greenstone.gatherer.Dictionary;
    3840import org.greenstone.gatherer.Gatherer;
    3941import org.greenstone.gatherer.cdm.Classifier;
     
    4951import org.greenstone.gatherer.util.Utility;
    5052import org.w3c.dom.*;
     53
    5154/** This class maintains a list of format statements, and allows the addition and removal of these statements.
    5255 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    7881    }
    7982    }
     83
    8084    /** Method to add a new format to this manager.
    81       * @param format The <strong>Format</strong> to add.
    82       */
     85     * @param format The <strong>Format</strong> to add.
     86     */
    8387    public void addFormat(Format format) {
    8488    if(!contains(format)) {
     
    188192    Collections.sort(variable_model);
    189193    return variable_model;
    190     }
    191 
    192     /** Overloaded to call get with both a key and an empty argument array.
    193      * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
    194      * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
    195      */
    196     private String get(String key) {
    197     return get(key, null);
    198     }
    199 
    200     /** Used to retrieve a property value from the Locale specific ResourceBundle, based upon the key and arguments supplied. If the key cannot be found or if some other part of the call fails a default (English) error message is returned. <BR>
    201      * Here the get recieves a second argument which is an array of Strings used to populate argument fields, denoted {<I>n</I>}, within the value String returned. Note that argument numbers greater than or equal to 32 are automatically mapped to the formatting String named Farg<I>n</I>.
    202      * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
    203      * @param args A <strong>String[]</strong> used to populate argument fields within the complete String.
    204      * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
    205      * @see org.greenstone.gatherer.Gatherer
    206      * @see org.greenstone.gatherer.Dictionary
    207      */
    208     private String get(String key, String args[]) {
    209     if(key.indexOf('.') == -1) {
    210         key = "CDM.FormatManager." + key;
    211     }
    212     return Gatherer.dictionary.get(key, args);
    213194    }
    214195
     
    228209    private JButton remove_button;
    229210    private JButton replace_button;
    230     //private JButton reset_button;
    231211    private JCheckBox enabled_checkbox;
    232212    private JComboBox feature_combobox;
     
    249229        // Create
    250230        JPanel instructions_pane = new JPanel();
    251         JLabel title_label = new JLabel(get("CDM.FormatManager.Title"));
     231        JLabel title_label = new JLabel();
    252232        title_label.setHorizontalAlignment(JLabel.CENTER);
    253233        title_label.setOpaque(true);
    254         instructions_textarea = new JTextArea(get("CDM.FormatManager.Instructions"));
     234        Dictionary.registerText(title_label, "CDM.FormatManager.Title");
     235
     236        instructions_textarea = new JTextArea();
    255237        instructions_textarea.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    256238        instructions_textarea.setEditable(false);
     
    258240        instructions_textarea.setRows(6);
    259241        instructions_textarea.setWrapStyleWord(true);
    260 
    261         JLabel format_label = new JLabel(get("CDM.FormatManager.Assigned_Formats"));
     242        Dictionary.registerText(instructions_textarea, "CDM.FormatManager.Instructions");
     243
     244        JLabel format_label = new JLabel();
     245        Dictionary.registerText(format_label, "CDM.FormatManager.Assigned_Formats");
    262246        format_list = new JList(model);
    263247
    264248        selection_pane = new JPanel();
    265249        JPanel feature_pane = new JPanel();
    266         JLabel feature_label = new JLabel(get("CDM.FormatManager.Feature"));
     250        JLabel feature_label = new JLabel();
    267251        feature_label.setPreferredSize(Utility.LABEL_SIZE);
     252        Dictionary.registerText(feature_label, "CDM.FormatManager.Feature");
    268253        feature_combobox = new JComboBox(feature_model.toArray());
    269254        feature_combobox.setEditable(false);
     255        Dictionary.registerTooltip(feature_combobox, "CDM.FormatManager.Feature_Tooltip");
     256
    270257        part_pane = new JPanel();
    271         JLabel part_label = new JLabel(get("CDM.FormatManager.Part"));
     258        JLabel part_label = new JLabel();
    272259        part_label.setPreferredSize(Utility.LABEL_SIZE);
     260        Dictionary.registerText(part_label, "CDM.FormatManager.Part");
     261
    273262        part_combobox = new JComboBox(part_model.toArray());
    274263        part_combobox.setEditable(false);
     264        Dictionary.registerTooltip(part_combobox, "CDM.FormatManager.Part_Tooltip");
    275265
    276266        JPanel center_pane = new JPanel();
     
    283273        JPanel editor_pane = new JPanel();
    284274        JPanel editor_header_pane = new JPanel();
    285         JLabel editor_label = new JLabel(get("CDM.FormatManager.Editor"));
    286         //reset_button = new JButton(get("Reset"));
    287         //reset_button.setMnemonic(KeyEvent.VK_T);
     275        JLabel editor_label = new JLabel();
     276        Dictionary.registerText(editor_label, "CDM.FormatManager.Editor");
     277
    288278        editor_textarea = new JTextArea();
    289279        editor_textarea.setBackground(Gatherer.config.getColor("coloring.editable_background", false));
     
    292282        editor_textarea.setRows(6);
    293283        editor_textarea.setWrapStyleWord(false);
     284        Dictionary.registerTooltip(editor_textarea, "CDM.FormatManager.Editor_Tooltip");
    294285
    295286        JPanel variable_pane = new JPanel();
    296         JLabel variable_label = new JLabel(get("CDM.FormatManager.Variable"));
     287        JLabel variable_label = new JLabel();
     288        Dictionary.registerText(variable_label, "CDM.FormatManager.Variable");
    297289        variable_combobox = new JComboBox(variable_model.toArray());
    298         insert_button = new JButton(get("CDM.FormatManager.Insert"));
     290        Dictionary.registerTooltip(variable_combobox, "CDM.FormatManager.Variable_Tooltip");
     291
     292        insert_button = new JButton();
    299293        insert_button.setMnemonic(KeyEvent.VK_I);
     294        Dictionary.registerBoth(insert_button, "CDM.FormatManager.Insert", "CDM.FormatManager.Insert_Tooltip");
    300295
    301296        JPanel flag_pane = new JPanel();
    302         enabled_checkbox = new JCheckBox(get("CDM.FormatManager.Enabled"));
     297        enabled_checkbox = new JCheckBox();
     298        Dictionary.registerText(enabled_checkbox, "CDM.FormatManager.Enabled");
    303299
    304300        JPanel button_pane = new JPanel();
    305         add_button = new JButton(get("CDM.FormatManager.Add"));
     301        add_button = new JButton();
    306302        add_button.setEnabled(false);
    307303        add_button.setMnemonic(KeyEvent.VK_A);
    308         replace_button = new JButton(get("CDM.FormatManager.Replace"));
     304        Dictionary.registerBoth(add_button, "CDM.FormatManager.Add", "CDM.FormatManager.Add_Tooltip");
     305        replace_button = new JButton();
    309306        replace_button.setEnabled(false);
    310307        replace_button.setMnemonic(KeyEvent.VK_C);
    311         remove_button = new JButton(get("CDM.FormatManager.Remove"));
     308        Dictionary.registerBoth(replace_button, "CDM.FormatManager.Replace", "CDM.FormatManager.Replace_Tooltip");
     309        remove_button = new JButton();
    312310        remove_button.setEnabled(false);
    313311        remove_button.setMnemonic(KeyEvent.VK_R);
     312        Dictionary.registerBoth(remove_button, "CDM.FormatManager.Remove", "CDM.FormatManager.Remove_Tooltip");
    314313
    315314        // Connect
     
    318317        remove_button.addActionListener(new RemoveListener());
    319318        replace_button.addActionListener(new ReplaceListener());
    320         //reset_button.addActionListener(new ResetListener());
    321319        enabled_checkbox.addActionListener(new EnabledListener());
    322320        feature_combobox.addActionListener(new FeatureListener());
     
    349347        editor_header_pane.add(editor_label);
    350348        editor_header_pane.add(new JPanel());
    351         //editor_header_pane.add(reset_button);
    352349
    353350        variable_pane.setBorder(BorderFactory.createEmptyBorder(2,0,2,0));
     
    372369        button_pane.add(remove_button);
    373370
    374         center_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("CDM.FormatManager.Editing_Controls")), BorderFactory.createEmptyBorder(2,2,2,2)));
     371        center_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("CDM.FormatManager.Editing_Controls")), BorderFactory.createEmptyBorder(2,2,2,2)));
    375372        center_pane.setLayout(new BorderLayout());
    376373        center_pane.add(selection_pane, BorderLayout.NORTH);
     
    742739        }
    743740    }
    744 
    745 //      private class ResetListener
    746 //          implements ActionListener {
    747 
    748 //          public void actionPerformed(ActionEvent event) {
    749 //          /** @todo **/
    750 //          }
    751 //      }
    752741    }
    753742
  • trunk/gli/src/org/greenstone/gatherer/cdm/Index.java

    r5375 r5590  
    3838import org.greenstone.gatherer.util.Utility;
    3939import org.w3c.dom.*;
     40
    4041/** This class encapsulates a single indexing pair.
    4142 * @author John Thompson, Greenstone Digital Library, University of Waikato
  • trunk/gli/src/org/greenstone/gatherer/cdm/IndexManager.java

    r5536 r5590  
    8282    Gatherer.println(" + " + levels_model.getSize() + " levels parsed.");
    8383    }
     84
    8485    /** Method to add a new index.
    8586     * @param index The <strong>Index</strong> to add.
     
    570571        JLabel name_label = new JLabel();
    571572        name_label.setPreferredSize(Utility.LABEL_SIZE);
    572         Dictionary.registerText(name_label, "CDM.IndexManager.Name");
     573        Dictionary.registerText(name_label, "CDM.IndexManager.Index_Name");
    573574        name_textfield = new JTextField();
     575        Dictionary.registerTooltip(name_textfield, "CDM.IndexManager.Index_Name_Tooltip");
    574576
    575577        JPanel source_pane = new JPanel();
     
    578580        Dictionary.registerText(source_label, "CDM.IndexManager.Source");
    579581        source_list = new CheckList(new_data, false);
     582        Dictionary.registerTooltip(source_list, "CDM.IndexManager.Source_Tooltip");
    580583
    581584        JPanel level_pane = new JPanel();
     
    588591        level_combobox.addItem(Dictionary.newget("CDM.IndexManager.Section"));
    589592        level_combobox.setEditable(false);
     593        Dictionary.registerTooltip(level_combobox, "CDM.IndexManager.Level_Tooltip");
    590594
    591595        JPanel button_pane = new JPanel();
     
    593597        add_button.setEnabled(false);
    594598        add_button.setMnemonic(KeyEvent.VK_A);
    595         Dictionary.registerBoth(add_button, "CDM.IndexManager.Add", "CDM.IndexManager.Add_Tooltip");
     599        Dictionary.registerBoth(add_button, "CDM.IndexManager.Add_Index", "CDM.IndexManager.Add_Index_Tooltip");
    596600        set_default_button = new JButton();
    597601        set_default_button.setEnabled(false);
     
    601605        remove_button.setEnabled(false);
    602606        remove_button.setMnemonic(KeyEvent.VK_R);
    603         Dictionary.registerBoth(remove_button, "CDM.IndexManager.Remove", "CDM.IndexManager.Remove_Tooltip");
     607        Dictionary.registerBoth(remove_button, "CDM.IndexManager.Remove_Index", "CDM.IndexManager.Remove_Index_Tooltip");
    604608
    605609        // This class is getting a little crowded, so I'll generate the many mgpp controls in a inner class.
     
    954958        index_name_label = new JLabel();
    955959        index_name_label.setPreferredSize(LABEL_SIZE);
    956         Dictionary.registerText(index_name_label, "CDM.IndexManager.MGPP.Index_Name");
     960        Dictionary.registerText(index_name_label, "CDM.IndexManager.Index_Name");
    957961
    958962        index_name_field = new JTextField();
    959         Dictionary.registerTooltip(index_name_field, "CDM.IndexManager.MGPP.Index_Name_Tooltip");
     963        Dictionary.registerTooltip(index_name_field, "CDM.IndexManager.Index_Name_Tooltip");
    960964
    961965        JPanel index_panel = new JPanel();
     
    978982        add_index_button.setEnabled(false);
    979983        add_index_button.setMnemonic(KeyEvent.VK_A);
    980         Dictionary.registerBoth(add_index_button, "CDM.IndexManager.MGPP.Add_Index", "CDM.IndexManager.MGPP.Add_Index_Tooltip");
     984        Dictionary.registerBoth(add_index_button, "CDM.IndexManager.Add_Index", "CDM.IndexManager.Add_Index_Tooltip");
    981985
    982986        add_all_button = new JButton();
     
    993997        remove_index_button.setEnabled(false);
    994998        remove_index_button.setMnemonic(KeyEvent.VK_A);
    995         Dictionary.registerBoth(remove_index_button, "CDM.IndexManager.MGPP.Remove_Index", "CDM.IndexManager.MGPP.Remove_Index_Tooltip");
     999        Dictionary.registerBoth(remove_index_button, "CDM.IndexManager.Remove_Index", "CDM.IndexManager.Remove_Index_Tooltip");
    9961000
    9971001        JPanel index_empty_panel = new JPanel();
     
    10951099        JPanel level_panel = new JPanel();
    10961100
    1097         level_label = new JLabel("CDM.IndexManager.MGPP.Level");
     1101        level_label = new JLabel();
    10981102        level_label.setPreferredSize(LABEL_SIZE);
    10991103        Dictionary.registerText(level_label, "CDM.IndexManager.MGPP.Level");
     
    11051109        level_combobox.setTextNonSelectionColor(Gatherer.config.getColor("coloring.workspace_tree_foreground", false));
    11061110        level_combobox.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
    1107         Dictionary.registerTooltip(level_combobox, "CDM.IndexManager.MGPP.Level_Tooltip");
     1111        Dictionary.registerTooltip(level_combobox, "CDM.IndexManager.Level_Tooltip");
    11081112
    11091113        JPanel level_button_panel = new JPanel();
     
    15781582    }
    15791583}
    1580 
    1581 
  • trunk/gli/src/org/greenstone/gatherer/cdm/Language.java

    r4932 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      08/05/02
     
    3637import org.greenstone.gatherer.msm.MSMUtils;
    3738import org.w3c.dom.*;
     39
    3840/** A pretty unexciting extension of a two character string, in that it has a field which details if its the default language.
    3941* @author John Thompson, Greenstone Digital Library, University of Waikato
     
    140142    }
    141143}
    142 
    143 
    144 
    145 
    146 
  • trunk/gli/src/org/greenstone/gatherer/cdm/LanguageListCellRenderer.java

    r4932 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      11/07/03
     
    3334import javax.swing.*;
    3435import org.greenstone.gatherer.cdm.CollectionDesignManager;
    35 import org.greenstone.gatherer.cdm.LanguageManager;
     36
    3637/** Provides a renderer which transforms a language code (such as en or fr) into its appropriate name (English and French respectively) before generating the rubberstamping component. */
    3738public class LanguageListCellRenderer
  • trunk/gli/src/org/greenstone/gatherer/cdm/LanguageManager.java

    r5342 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      08/05/02
     
    3738import javax.swing.*;
    3839import javax.swing.event.*;
     40import org.greenstone.gatherer.Dictionary;
    3941import org.greenstone.gatherer.Gatherer;
    4042import org.greenstone.gatherer.cdm.CollectionConfiguration;
     
    4547import org.greenstone.gatherer.cdm.LanguageListCellRenderer;
    4648import org.w3c.dom.*;
     49
    4750/** This class manages the language commands, remembering both a list of languages to build indexes in, plus the default language.
    4851 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    224227    }
    225228
    226     /** Overloaded to call get with both a key and an empty argument array.
    227       * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
    228       * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
    229       */
    230     private String get(String key) {
    231     if(key.indexOf('.') == -1) {
    232         key = "CDM.LanguageManager." + key;
    233     }
    234     return Gatherer.dictionary.get(key, (String[])null);
    235     }
    236229
    237230    /** This class represents the visual component of the Language Manager. */
     
    269262        JPanel center_panel = new JPanel();
    270263
    271         JLabel language_list_label = new JLabel(get("CDM.LanguageManager.Assigned_Languages"));
    272 
     264        JLabel language_list_label = new JLabel();
     265        Dictionary.registerText(language_list_label, "CDM.LanguageManager.Assigned_Languages");
    273266        language_list = new JList(model);
    274267
     
    277270        JPanel default_panel = new JPanel();
    278271
    279         JLabel default_label = new JLabel(get("CDM.LanguageManager.Default_Language"));
     272        JLabel default_label = new JLabel();
    280273        default_label.setBorder(BorderFactory.createEmptyBorder(0,0,0,5));
    281274        default_label.setPreferredSize(LABEL_SIZE);
     275        Dictionary.registerText(default_label, "CDM.LanguageManager.Default_Language");
    282276
    283277        if(default_language == null) {
     
    289283        default_language_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    290284        default_language_field.setEditable(false);
    291 
    292285        JPanel control_panel = new JPanel();
    293286
    294         JLabel selector_label = new JLabel(get("CDM.LanguageManager.Selector"));
     287        JLabel selector_label = new JLabel();
    295288        selector_label.setPreferredSize(LABEL_SIZE);
     289        Dictionary.registerText(selector_label, "CDM.LanguageManager.Selector");
    296290
    297291        selector_combobox = new JComboBox(getLanguageCodes().toArray());
    298292        selector_combobox.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    299293        selector_combobox.setRenderer(new LanguageListCellRenderer());
     294        Dictionary.registerTooltip(selector_combobox, "CDM.LanguageManager.Selector_Tooltip");
    300295
    301296        JPanel button_panel = new JPanel();
    302297
    303         add_button = new JButton(get("CDM.LanguageManager.Add"));
     298        add_button = new JButton();
    304299        add_button.setMnemonic(KeyEvent.VK_A);
    305 
    306         remove_button = new JButton(get("CDM.LanguageManager.Remove"));
     300        Dictionary.registerBoth(add_button, "CDM.LanguageManager.Add", "CDM.LanguageManager.Add_Tooltip");
     301
     302        remove_button = new JButton();
    307303        remove_button.setMnemonic(KeyEvent.VK_R);
    308304        remove_button.setEnabled(false);
    309 
    310         clear_button = new JButton(get("CDM.LanguageManager.Clear_Default"));
     305        Dictionary.registerBoth(remove_button, "CDM.LanguageManager.Remove", "CDM.LanguageManager.Remove_Tooltip");
     306
     307        clear_button = new JButton();
    311308        clear_button.setMnemonic(KeyEvent.VK_C);
    312309        clear_button.setEnabled(false);
    313 
    314         set_button = new JButton(get("CDM.LanguageManager.Set_Default"));
     310        Dictionary.registerBoth(clear_button, "CDM.LanguageManager.Clear_Default", "CDM.LanguageManager.Clear_Default_Tooltip");
     311
     312        set_button = new JButton();
    315313        set_button.setMnemonic(KeyEvent.VK_S);
    316314        set_button.setEnabled(false);
     315        Dictionary.registerBoth(set_button, "CDM.LanguageManager.Set_Default", "CDM.LanguageManager.Set_Default_Tooltip");
    317316
    318317        // Set up and connect listeners.
     
    323322        set_button.addActionListener(new SetDefaultListener());
    324323        language_list.addListSelectionListener(new ListListener());
    325         // Layout components.
     324
     325        // Layout components
    326326        default_panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), BorderFactory.createEmptyBorder(2,0,2,2)));
    327327        default_panel.setLayout(new BorderLayout());
     
    355355        add(button_panel, BorderLayout.SOUTH);
    356356    }
     357
    357358    /** Destructor. */
    358359    public void destroy() {
     
    466467    }
    467468}
    468 
    469 
    470 
    471 
    472 
    473 
    474 
  • trunk/gli/src/org/greenstone/gatherer/cdm/Level.java

    r5255 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      16/07/03
     
    3536import org.greenstone.gatherer.cdm.DOMProxyListEntry;
    3637import org.w3c.dom.*;
     38
    3739/** This class represents a single search type setting which means that, at the moment, it is either based on an Content element containing the string 'plain' or one on the string 'form'. The ordering of these elements within the Level element is important.
    3840 * @author John Thompson, Greenstone Digital Library, University of Waikato
  • trunk/gli/src/org/greenstone/gatherer/cdm/MetadataSetView.java

    r5350 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829import java.awt.*;
    2930import java.util.*;
    3031import javax.swing.*;
    3132import javax.swing.event.*;
     33import org.greenstone.gatherer.Dictionary;
    3234import org.greenstone.gatherer.Gatherer;
    3335import org.greenstone.gatherer.cdm.CollectionDesignManager;
     
    3941import org.greenstone.gatherer.msm.MSMListener;
    4042import org.w3c.dom.*;
     43
    4144/** Unlike its namesake in the msm package, this class really only knows how to produce a simple visual representation of the currently imported metadata sets. It is also read-only, so should be fairly straight forward. (It has no namesake any longer as my co-programmers found this far too confusing - however I have now added a CollectionConfiguration to the cdm package just to keep them on their toes!)
    4245 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    5154    /** A reference to ourselves so our inner classes can refer to us. */
    5255    private DynamicListModel model = null;
     56
    5357    /** Constructor.
    5458     */
     
    6165    controls = new MetadataSetControl();
    6266    }
     67
    6368    /** Destructor. Remove any references of this class from persistant objects.
    64         * @see org.greenstone.gatherer.Gatherer
    65       * @see org.greenstone.gatherer.collection.CollectionManager
    66       * @see org.greenstone.gatherer.msm.MetadataSetManager
    67       */
     69     * @see org.greenstone.gatherer.Gatherer
     70     * @see org.greenstone.gatherer.collection.CollectionManager
     71     * @see org.greenstone.gatherer.msm.MetadataSetManager
     72     */
    6873    public void destroy() {
    6974    controls.destroy();
     
    7277    model = null;
    7378    }
     79
    7480    /** Called when an element is changed within a set in the MSM, prompting us to refresh our list of elements being shown.
    7581     * @param event A <strong>MSMEvent</strong> which encapsulates relevant data about the change.
     
    8086    ((MetadataSetControl)controls).refreshElementList();
    8187    }
     88
    8289    /** A method for retrieve the controls for this manager.
    8390     * @see org.greenstone.gatherer.Dictionary
     
    8895    return controls;
    8996    }
     97
    9098    /** Called when a metadata value has undergone significant change.
    9199     * @param event A <strong>MSMEvent</strong> which encapsulates relevant data about the change.
     
    94102    // Couldn't care less.
    95103    }
     104
    96105    /** Called when a set is added or removed from the MSM.
    97106     * @param event A <strong>MSMEvent</strong> which encapsulates relevant data about the change.
     
    102111    loadMetadataSets();
    103112    }
     113
    104114    /** Select the selected element, given its name, and return the bounds of the selection. Used during search and replace.
    105115     * @param element The elements fully qualified name as a <strong>String</strong>.
     
    110120    return ((MetadataSetControl)controls).setSelectedElement(element);
    111121    }
     122
    112123    /** Prints out the contents of this manager, as they would appear in the collection configuration file.
    113124     * @return A <strong>String</strong> containing a block of commands.
     
    123134    return text;
    124135    }
     136
    125137    /** Called when a significant change has occured to a value tree for a certain element, however we take no further action.
    126138     * @param event A <strong>MSMEvent</strong> containing information relevant to the event.
     
    128140    public void valueChanged(MSMEvent event) {
    129141    }
    130     /** Method to retrieve a phrase from the dictionary based on a key.
    131      * @param key A <strong>String</strong> used to find the correct phrase.
    132      * @param args A <strong>String[]</strong> of arguments used in formatting and filling out the phrase.
    133      * @return A <strong>String</strong> containing the correct phrase with the correct formatting.
    134      */
    135     private String get(String key) {
    136     return get(key, null);
    137     }
    138     /** Method to retrieve a phrase from the dictionary based on a key.
    139      * @param key A <strong>String</strong> used to find the correct phrase.
    140      * @return A <strong>String</strong> containing the correct phrase with the correct formatting.
    141      * @see org.greenstone.gatherer.Dictionary
    142      * @see org.greenstone.gatherer.Gatherer
    143      */
    144     private String get(String key, String args[]) {
    145     if(key.indexOf(".") == -1) {
    146         key = "CDM.MetadataSetManager." + key;
    147     }
    148     return Gatherer.dictionary.get(key, args);
    149     }
     142
    150143    /** Retrieves the current list of loaded metadata sets, and builds a list model around them.
    151144     * @see org.greenstone.gatherer.Gatherer
     
    162155    }
    163156    }
     157
    164158    /** This class creates and lays-out the various controls for reviewing the metadata sets, and their commands as they would appear in the collection configuration file. */
    165159    private class MetadataSetControl
     
    188182    /** The element model for the currently selected set. */
    189183    private Vector element_model = null;
     184
    190185    /* Constructor.
    191186     * @see org.greenstone.gatherer.Coloring;
     
    195190     */
    196191    public MetadataSetControl() {
    197                 // Create visual components
     192        // Create visual components
    198193        central_pane = new JPanel();
    199         element_label = new JLabel(get("CDM.MetadataSetManager.Elements"));
     194        element_label = new JLabel();
    200195        element_label.setHorizontalAlignment(JLabel.CENTER);
    201196        element_label.setOpaque(true);
     197        Dictionary.setText(element_label, "CDM.MetadataSetManager.Elements");
    202198        element_list = new JList();
    203199        element_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    204200        element_pane = new JPanel();
    205201        header_pane = new JPanel();
    206         instructions = new JTextArea(get("CDM.MetadataSetManager.Instructions"));
     202        instructions = new JTextArea();
    207203        instructions.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    208204        instructions.setEditable(false);
     
    210206        instructions.setRows(6);
    211207        instructions.setWrapStyleWord(true);
    212         set_label = new JLabel(get("CDM.MetadataSetManager.Sets"));
     208        Dictionary.registerText(instructions, "CDM.MetadataSetManager.Instructions");
     209        set_label = new JLabel();
    213210        set_label.setHorizontalAlignment(JLabel.CENTER);
    214211        set_label.setOpaque(true);
     212        Dictionary.registerText(set_label, "CDM.MetadataSetManager.Sets");
    215213        set_list = new JList(model);
    216214        set_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    217215        set_pane = new JPanel();
    218         title = new JLabel(get("CDM.MetadataSetManager.Title"));
     216        title = new JLabel();
    219217        title.setHorizontalAlignment(JLabel.CENTER);
    220218        title.setOpaque(true);
    221                 // Add listeners
     219        Dictionary.registerText(title, "CDM.MetadataSetManager.Title");
     220
     221        // Add listeners
    222222        set_list.addListSelectionListener(new ListListener());
    223                 // Layout
     223
     224        // Layout
    224225        instructions.setBorder(BorderFactory.createEmptyBorder(2,5,2,5));
    225226
     
    253254    }
    254255    /** Select the selected element, given its name, and return the bounds of the selection. Used during search and replace.
    255         * @param element The elements fully qualified name as a <strong>String</strong>.
    256         * @return The bounds of the selection as a <strong>Rectangle</strong>.
    257         * @see org.greenstone.gatherer.cdm.MetadataSetManager.Control
    258         * @see org.greenstone.gatherer.cdm.MetadataSetManager.Control.ElementWrapper
    259         */
     256     * @param element The elements fully qualified name as a <strong>String</strong>.
     257     * @return The bounds of the selection as a <strong>Rectangle</strong>.
     258     * @see org.greenstone.gatherer.cdm.MetadataSetManager.Control
     259     * @see org.greenstone.gatherer.cdm.MetadataSetManager.Control.ElementWrapper
     260     */
    260261    public Rectangle setSelectedElement(String element) {
    261262        Rectangle bounds = null;
    262                 // Parse off namespace
     263        // Parse off namespace
    263264        String namespace = element.substring(0, element.indexOf("."));
    264                 // Force the set list to show the correct entry.
     265        // Force the set list to show the correct entry.
    265266        ListModel s_model = set_list.getModel();
    266267        for(int i = 0; i < s_model.getSize(); i++) {
     
    270271        }
    271272        }
    272                 // Force the element list to show that name.
     273        // Force the element list to show that name.
    273274        ListModel e_model = element_list.getModel();
    274275        for(int i = 0; i < e_model.getSize(); i++) {
     
    279280        }
    280281        }
    281                 // Return the bounds of the selected row.
     282        // Return the bounds of the selected row.
    282283        return bounds;
    283284    }
     285
    284286    /** Overriden to ensure the instruction area is scrolled to top.
    285           */
     287    */
    286288    public void gainFocus() {
    287289        if(instructions != null) {
     
    309311    }
    310312    }
     313
    311314    /** Provides a convience wrapper around a metadata set, that allows it to appear in the <strong>JList</strong> the same way it would in the collection configuration file. */
    312315    private class SetWrapper {
     
    320323    public String toString() {
    321324        String namespace = set.getNamespace();
    322                 // Watch out for the greenstone set, with its namespace of ""
     325        // Watch out for the greenstone set, with its namespace of ""
    323326        if(namespace == null || namespace.length() == 0) {
    324327        namespace = "greenstone";
  • trunk/gli/src/org/greenstone/gatherer/cdm/ParsingProgress.java

    r4675 r5590  
    3535 *########################################################################
    3636 */
     37package org.greenstone.gatherer.cdm;
    3738
    38  
    39 
    40 
    41 
    42 
    43 package org.greenstone.gatherer.cdm;
    4439/**************************************************************************************
    4540 * Title:        Gatherer
     
    5146 *               17/11/02 - Commented
    5247 **************************************************************************************/
    53 import java.awt.BorderLayout;
    54 import java.awt.Dimension;
    55 import java.awt.Toolkit;
    56 import javax.swing.BorderFactory;
    57 import javax.swing.JDialog;
    58 import javax.swing.JLabel;
    59 import javax.swing.JPanel;
    60 import javax.swing.JProgressBar;
     48import java.awt.*;
     49import javax.swing.*;
     50
    6151/** This class provides a progress bar to be displayed whenever the module must reload the plugin and classifier information, either automatically or if the user indicates a reload is needed.
    6252 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    7161    /** The default size of the progress dialog. */
    7262    static final Dimension SIZE = new Dimension(400,75);
     63
    7364    /** Constructor.
    7465     * @param title The title to show on the dialog, as a <strong>String</strong>.
    7566     * @param message The message to show on the dialog, as a <strong>String</strong>.
    7667     * @param max The total number of plugins/classifiers that have to be parsed before the progress bar can be disposed of, as an <i>int</i>.
    77       */
     68     */
    7869    public ParsingProgress(String title, String message, int max) {
    7970    super();
     
    8172    this.setSize(SIZE);
    8273    this.setTitle(title);
     74
    8375    // Creation
    8476    this.content_pane = (JPanel) getContentPane();
    8577    this.progress = new JProgressBar();
    8678    this.progress.setMaximum(max);
     79
    8780    // Layout
    8881    this.content_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
     
    9083    this.content_pane.add(new JLabel(message), BorderLayout.NORTH);
    9184    this.content_pane.add(progress, BorderLayout.CENTER);
     85
    9286    // Center and display
    9387    Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize();
     
    9690    show();
    9791    }
     92
    9893    public void destroy() {
    9994    }
     95
    10096    /** Method which increments the progress count by one, which should be called after every successful parsing of a classifier or plugin.
    101       */
     97     */
    10298    public void inc() {
    10399    progress.setValue(progress.getValue() + 1);
  • trunk/gli/src/org/greenstone/gatherer/cdm/PlugIn.java

    r5207 r5590  
    3535import org.greenstone.gatherer.util.StaticStrings;
    3636import org.w3c.dom.*;
     37
    3738/** This class is responsible for storing information from a parsed pluginfo call in such a way that it allows easy access to parsed details for the purposes of user design and specification of plugins. */
    3839public class PlugIn
     
    372373    }         
    373374}
    374 
    375 
  • trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java

    r5536 r5590  
    4242import org.greenstone.gatherer.cdm.CommandTokenizer;
    4343import org.greenstone.gatherer.cdm.Control;
    44 import org.greenstone.gatherer.cdm.DynamicListModel;
    4544import org.greenstone.gatherer.cdm.PlugIn;
    4645import org.greenstone.gatherer.gui.DoubleImageButton;
     
    7574    separator = getSeparator();
    7675    }
     76
    7777    /** Method to add a new plugin to the library
    7878     * @param plugin the new base PlugIn
     
    388388
    389389    /** Method to initially load information from the standard plug-ins within the gsdl Perl library.
    390       */
     390     */
    391391    private void loadPlugIns() {
    392392    // Attempt to restore the cached file.
     
    407407    }
    408408    /** Method to load plug-in information from a specified directory. Of course no plug-ins may be found at this location.
    409       * @param directory A <strong>File</strong> indicating the directory to be scanned for plug-ins.
    410       */
     409     * @param directory A <strong>File</strong> indicating the directory to be scanned for plug-ins.
     410     */
    411411    private void loadPlugIns(File directory) {
    412412    File files[] = directory.listFiles();
  • trunk/gli/src/org/greenstone/gatherer/cdm/SearchType.java

    r5037 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      16/07/03
     
    3536import org.greenstone.gatherer.cdm.DOMProxyListEntry;
    3637import org.w3c.dom.*;
     38
    3739/** This class represents a single search type setting which means that, at the moment, it is either based on an Content element containing the string 'plain' or one on the string 'form'. The ordering of these elements within the SearchType element is important.
    3840 * @author John Thompson, Greenstone Digital Library, University of Waikato
  • trunk/gli/src/org/greenstone/gatherer/cdm/SearchTypeManager.java

    r5536 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      16/07/03
     
    4748import org.greenstone.gatherer.util.Utility;
    4849import org.w3c.dom.*;
     50
    4951/** This class maintains an ordered list of the search types available in the collection (MGPP command available in G2.39 or later). Currently only 'form' and 'plain' are valid.
    5052 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    5456    extends DOMProxyListModel {
    5557
    56     static final public String[] SEARCH_TYPES = {"form", "plain"};
    57 
     58    static final public String[] SEARCH_TYPES = { "form", "plain" };
    5859
    5960    /** The controls used to edit the search types. */
  • trunk/gli/src/org/greenstone/gatherer/cdm/Subcollection.java

    r5235 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      03/05/02
     
    4041import org.greenstone.gatherer.util.Troolean;
    4142import org.w3c.dom.*;
     43
    4244/** This class encapsulates one subcollection entry in the collection configuration file.
    4345 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    258260    }
    259261}
    260 
    261 
    262 
    263 
    264 
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndex.java

    r5255 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:     04/07/03
     
    4041import org.greenstone.gatherer.util.Utility;
    4142import org.w3c.dom.*;
     43
    4244/** This class encapsulates a single indexing pair.
    4345 * @author John Thompson, Greenstone Digital Library, University of Waikato
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndexManager.java

    r5342 r5590  
    3232import javax.swing.*;
    3333import javax.swing.event.*;
     34import org.greenstone.gatherer.Dictionary;
    3435import org.greenstone.gatherer.Gatherer;
    3536import org.greenstone.gatherer.cdm.CollectionConfiguration;
     
    147148    }
    148149    }
     150
    149151    /** Method to remove all of the subindexes that contain a certain subcollection.
    150152     * @param sub the Subcollection that has been removed
     
    166168
    167169    /** Method to set the default subcollection index.
    168       * @param subcollection The <strong>Subcollection</strong> to use as the default index.
    169       * @see org.greenstone.gatherer.Gatherer
    170       * @see org.greenstone.gatherer.collection.CollectionManager
    171       */
     170     * @param subcollection The <strong>Subcollection</strong> to use as the default index.
     171     * @see org.greenstone.gatherer.Gatherer
     172     * @see org.greenstone.gatherer.collection.CollectionManager
     173     */
    172174    public void setDefaultSubcollectionIndex(SubcollectionIndex index) {
    173175    if(index != null) {
     
    195197    }
    196198
    197     /** Method to retrieve a phrase from the dictionary based on a key.
    198      * @param key A <strong>String</strong> used to find the correct phrase.
    199      * @param args A <strong>String[]</strong> of arguments used in formatting and filling out the phrase.
    200      * @return A <strong>String</strong> containing the correct phrase with the correct formatting.
    201      */
    202     private String get(String key) {
    203     if(key.indexOf(".") == -1) {
    204         key = "CDM.SubcollectionIndexManager." + key;
    205     }
    206     return Gatherer.dictionary.get(key);
    207     }
    208 
    209199    private class SubcollectionIndexControl
    210200    extends JPanel
     
    225215        JPanel subcollection_panel = new JPanel();
    226216        JPanel subindex_name_panel = new JPanel();
    227         JLabel subindex_name_label = new JLabel(get("CDM.SubcollectionIndexManager.PartitionName"));
     217        JLabel subindex_name_label = new JLabel();
     218        Dictionary.registerText(subindex_name_label, "CDM.SubcollectionIndexManager.PartitionName");
    228219        subcollectionindex_name_field = new JTextField();
    229 
    230         add_index_button = new JButton(get("CDM.SubcollectionIndexManager.Add_Subindex"));
     220        Dictionary.registerTooltip(subcollectionindex_name_field, "CDM.SubcollectionIndexManager.PartitionName_Tooltip");
     221
     222        JPanel button_pane = new JPanel();
     223
     224        add_index_button = new JButton();
    231225        add_index_button.setMnemonic(KeyEvent.VK_A);
    232226        add_index_button.setEnabled(false);
    233 
    234         JPanel button_pane = new JPanel();
    235 
    236         clear_default_button = new JButton(get("CDM.SubcollectionIndexManager.Clear_Default_Subindex"));
     227        Dictionary.registerBoth(add_index_button, "CDM.SubcollectionIndexManager.Add_Subindex", "CDM.SubcollectionIndexManager.Add_Subindex_Tooltip");
     228
     229        clear_default_button = new JButton();
    237230        clear_default_button.setMnemonic(KeyEvent.VK_C);
    238231        clear_default_button.setEnabled(default_index != null);
    239 
    240         JLabel default_label = new JLabel(get("CDM.SubcollectionIndexManager.Default_Subindex"));
     232        Dictionary.registerBoth(clear_default_button, "CDM.SubcollectionIndexManager.Clear_Default_Subindex", "CDM.SubcollectionIndexManager.Clear_Default_Subindex_Tooltip");
     233
     234        JLabel default_label = new JLabel();
    241235        default_label.setPreferredSize(Utility.LABEL_SIZE);
     236        Dictionary.registerText(default_label, "CDM.SubcollectionIndexManager.Default_Subindex");
     237
    242238        JPanel default_pane = new JPanel();
    243239        if(default_index == null) {
     
    249245        default_value_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    250246        default_value_field.setEditable(false);
    251         remove_index_button = new JButton(get("CDM.SubcollectionIndexManager.Remove_Subindex"));
     247
     248        remove_index_button = new JButton();
    252249        remove_index_button.setMnemonic(KeyEvent.VK_R);
    253250        remove_index_button.setEnabled(false);
    254         set_default_button = new JButton(get("CDM.SubcollectionIndexManager.Set_Default_Subindex"));
     251        Dictionary.registerBoth(remove_index_button, "CDM.SubcollectionIndexManager.Remove_Subindex", "CDM.SubcollectionIndexManager.Remove_Subindex_Tooltip");
     252
     253        set_default_button = new JButton();
    255254        set_default_button.setMnemonic(KeyEvent.VK_S);
    256255        set_default_button.setEnabled(false);
    257         JLabel subcollection_label = new JLabel(get("CDM.SubcollectionIndexManager.Subcollection"));
     256        Dictionary.registerBoth(set_default_button, "CDM.SubcollectionIndexManager.Set_Default_Subindex", "CDM.SubcollectionIndexManager.Set_Default_Subindex_Tooltip");
     257
     258        JLabel subcollection_label = new JLabel();
     259        Dictionary.registerText(subcollection_label, "CDM.SubcollectionIndexManager.Subcollection");
    258260        subcollection_list = new JList(CollectionDesignManager.subcollection_manager);
    259261        JPanel list_pane = new JPanel();
    260         JLabel subindexes_label = new JLabel(get("CDM.SubcollectionIndexManager.Subindexes"));
     262        JLabel subindexes_label = new JLabel();
     263        Dictionary.registerText(subcollection_label, "CDM.SubcollectionIndexManager.Subindexes");
    261264        subcollectionindexes_list = new JList(model);
    262265        subcollectionindexes_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    276279        subcollectionindex_name_field.getDocument().addDocumentListener(new SubcollectionIndexListener());
    277280        subcollection_list.addListSelectionListener(new SubcollectionIndexListener());
    278        
    279         JPanel temp_pane = new JPanel();
    280281
    281282        // Layout
    282 
    283283        default_label.setBorder(BorderFactory.createEmptyBorder(0,0,0,5));
    284284
     
    313313        //subcollection_panel.add(subindex_name_panel, BorderLayout.NORTH);
    314314        subcollection_panel.add(list_pane, BorderLayout.CENTER);
    315         //subcollection_panel.add(button_pane, BorderLayout.SOUTH);
    316315        subcollection_panel.add(button_pane, BorderLayout.SOUTH);
    317316       
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java

    r5342 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:      ??/??/02
     
    3536import javax.swing.*;
    3637import javax.swing.event.*;
     38import org.greenstone.gatherer.Dictionary;
    3739import org.greenstone.gatherer.Gatherer;
    3840import org.greenstone.gatherer.cdm.CollectionConfiguration;
     
    4850import org.greenstone.gatherer.util.Utility;
    4951import org.w3c.dom.*;
     52
    5053/** This class maintains a list of subcollections within our collection.
    5154 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    153156    }
    154157
    155     /** Method to retrieve a phrase from the dictionary based on a key.
    156      * @param key A <strong>String</strong> used to find the correct phrase.
    157      * @param args A <strong>String[]</strong> of arguments used in formatting and filling out the phrase.
    158      * @return A <strong>String</strong> containing the correct phrase with the correct formatting.
    159      */
    160     private String get(String key) {
    161     if(key.indexOf(".") == -1) {
    162         key = CLASS_DICTIONARY_NAME + key;
    163     }
    164     return Gatherer.dictionary.get(key);
    165     }
    166 
    167158    /** This class creates a JPanel containing serveral more controls used for editing subcollection information. */
    168159    private class SubcollectionControl
     
    188179        JPanel border_pane = new JPanel();
    189180        JPanel header_pane = new JPanel();
    190         instructions_area = new JTextArea(get("CDM.SubcollectionManager.Instructions"));
     181        instructions_area = new JTextArea();
    191182        instructions_area.setEditable(false);
    192183        instructions_area.setLineWrap(true);
    193184        instructions_area.setRows(6);
    194185        instructions_area.setWrapStyleWord(true);
     186        Dictionary.registerText(instructions_area, "CDM.SubcollectionManager.Instructions");
     187
    195188        tabbed_pane = new JTabbedPane();
    196         JLabel title = new JLabel(get("CDM.SubcollectionManager.Title"));
     189        JLabel title = new JLabel();
    197190        title.setHorizontalAlignment(JLabel.CENTER);
    198        
     191        Dictionary.registerText(title, "CDM.SubcollectionManager.Title");
     192
    199193        JPanel button_pane_3 = new JPanel();
    200         add_button = new JButton(get("CDM.SubcollectionManager.Add"));
     194        add_button = new JButton();
    201195        add_button.setMnemonic(KeyEvent.VK_A);
    202196        add_button.setEnabled(false);
    203         remove_button = new JButton(get("CDM.SubcollectionManager.Remove"));
     197        Dictionary.registerBoth(add_button, "CDM.SubcollectionManager.Add", "CDM.SubcollectionManager.Add_Tooltip");
     198        remove_button = new JButton();
    204199        remove_button.setMnemonic(KeyEvent.VK_R);
    205200        remove_button.setEnabled(false);
    206         update_button = new JButton(get("CDM.SubcollectionManager.Replace"));
     201        Dictionary.registerBoth(remove_button, "CDM.SubcollectionManager.Remove", "CDM.SubcollectionManager.Remove_Tooltip");
     202        update_button = new JButton();
    207203        update_button.setMnemonic(KeyEvent.VK_U);
    208204        update_button.setEnabled(false);
     205        Dictionary.registerBoth(update_button, "CDM.SubcollectionManager.Replace", "CDM.SubcollectionManager.Replace_Tooltip");
    209206
    210207        JPanel button_pane = new JPanel();
    211208        JPanel button_pane_1 = new JPanel();
    212         include_button = new JRadioButton(get("CDM.SubcollectionManager.Include"));
     209        include_button = new JRadioButton();
    213210        include_button.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    214211        include_button.setMnemonic(KeyEvent.VK_I);
    215212        include_button.setOpaque(false);
    216         exclude_button = new JRadioButton(get("CDM.SubcollectionManager.Exclude"));
     213        Dictionary.registerText(include_button, "CDM.SubcollectionManager.Include");
     214        exclude_button = new JRadioButton();
    217215        exclude_button.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    218216        exclude_button.setMnemonic(KeyEvent.VK_X);
    219217        exclude_button.setOpaque(false);
     218        Dictionary.registerText(exclude_button, "CDM.SubcollectionManager.Exclude");
     219
     220        JLabel flags_label = new JLabel();
     221        Dictionary.registerText(flags_label, "CDM.SubcollectionManager.Flags");
    220222        flags_field = new NonWhitespaceField();
    221         JLabel flags_label = new JLabel(get("CDM.SubcollectionManager.Flags"));
    222         JLabel inclusive_label = new JLabel(get("CDM.SubcollectionManager.Inclusive"));
     223        Dictionary.registerTooltip(flags_field, "CDM.SubcollectionManager.Flags_Tooltip");
     224
    223225        JPanel inclusive_pane = new JPanel();
     226        JLabel inclusive_label = new JLabel();
     227        Dictionary.registerText(inclusive_label, "CDM.SubcollectionManager.Inclusive");
     228
     229        JLabel match_label = new JLabel();
     230        Dictionary.registerText(match_label, "CDM.SubcollectionManager.Match");
    224231        match_field = new JTextField();
    225         JLabel match_label = new JLabel(get("CDM.SubcollectionManager.Match"));
     232        Dictionary.registerTooltip(match_field, "CDM.SubcollectionManager.Match_Tooltip");
     233
     234        JLabel name_label = new JLabel();
     235        Dictionary.registerText(name_label, "CDM.SubcollectionManager.Name");
    226236        name_field = new NonWhitespaceField();
    227         JLabel name_label = new JLabel(get("CDM.SubcollectionManager.Name"));
     237        Dictionary.registerTooltip(name_field, "CDM.SubcollectionManager.Name_Tooltip");
     238
     239        JLabel source_label = new JLabel();
     240        Dictionary.registerText(source_label, "CDM.SubcollectionManager.Source");
    228241        Vector source_model = Gatherer.c_man.getCollection().msm.getAssignedElements();
    229242        source_model.add(0, StaticStrings.FILENAME_STR);
    230243        source_combobox = new JComboBox(source_model);
    231         JLabel source_label = new JLabel(get("CDM.SubcollectionManager.Source"));
     244        Dictionary.registerTooltip(source_combobox, "CDM.SubcollectionManager.Source_Tooltip");
     245
    232246        subcollection_list = new JList(model);
    233247        subcollection_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    238252        include_button.setSelected(true);
    239253        JPanel subcollection_list_pane = new JPanel();
    240         JLabel subcollection_list_label = new JLabel(get("CDM.SubcollectionManager.Assigned"));
     254        JLabel subcollection_list_label = new JLabel();
     255        Dictionary.registerText(subcollection_list_label, "CDM.SubcollectionManager.Assigned");
    241256
    242257        // Add listeners
     
    296311        subcollection_pane.add(button_pane, BorderLayout.SOUTH);
    297312
    298         tabbed_pane.addTab(get("CDM.SubcollectionManager.Subcollection_Controls"), subcollection_pane);
    299         tabbed_pane.addTab(get("CDM.SubcollectionManager.Subindex_Controls"), (JPanel) CollectionDesignManager.subcollectionindex_manager.getControls());
    300         tabbed_pane.addTab(get("CDM.SubcollectionManager.Language_Controls"), (JPanel) CollectionDesignManager.language_manager.getControls());
     313        tabbed_pane.addTab(Dictionary.newget("CDM.SubcollectionManager.Subcollection_Controls"), subcollection_pane);
     314        tabbed_pane.addTab(Dictionary.newget("CDM.SubcollectionManager.Subindex_Controls"), (JPanel) CollectionDesignManager.subcollectionindex_manager.getControls());
     315        tabbed_pane.addTab(Dictionary.newget("CDM.SubcollectionManager.Language_Controls"), (JPanel) CollectionDesignManager.language_manager.getControls());
    301316
    302317        border_pane.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
     
    509524    }
    510525}
    511 
    512 
    513 
    514 
    515 
    516 
    517 
    518 
    519 
  • trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollection.java

    r4932 r5590  
    2626 */
    2727package org.greenstone.gatherer.cdm;
     28
    2829/**************************************************************************************
    2930 * Written:     02/07/03
  • trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java

    r5342 r5590  
    3232import javax.swing.*;
    3333import javax.swing.event.*;
    34 import org.greenstone.gatherer.Configuration;
    3534import org.greenstone.gatherer.Dictionary;
    3635import org.greenstone.gatherer.Gatherer;
     
    4241import org.greenstone.gatherer.util.Utility;
    4342import org.w3c.dom.*;
     43
    4444/** This class contains the information about what supercollection has been specified (if any) and methods for changing this information. Note that there is a major difference between this manager and the others in that its DOM model is never used directly in any list component. It is only used to decide whether a certain entry in the actual checklist is checked. */
    4545public class SuperCollectionManager
     
    105105    }
    106106
    107     /** Call dictionary get with just a key.
    108      * @param key A String which is mapped to a initial String within the ResourceBundle.
    109      * @return A String which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
    110      */
    111     private String get(String key) {
    112     if(key.indexOf(".") == -1) {
    113         key = "CDM.SuperCollectionManager." + key;
    114     }
    115     return Gatherer.dictionary.get(key);
    116     }
    117 
    118107    /** Provides controls for altering the SuperCollection settings. */
    119108    private class SuperCollectionControl
     
    123112    private boolean init = true;
    124113    private CheckList collection_checklist = null;
    125     //private JSplitPane center_pane;
    126114
    127115    SuperCollectionControl() {
     
    132120        JPanel header_panel = new JPanel();
    133121       
    134         JLabel title_label = new JLabel(get("CDM.SuperCollectionManager.Title"));
     122        JLabel title_label = new JLabel();
    135123        title_label.setHorizontalAlignment(JLabel.CENTER);
    136124        title_label.setOpaque(true);
    137 
    138         //center_pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    139 
    140         JTextArea instructions = new JTextArea(get("CDM.SuperCollectionManager.Instructions"));
     125        Dictionary.registerText(title_label, "CDM.SuperCollectionManager.Title");
     126
     127        JTextArea instructions = new JTextArea();
    141128        instructions.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    142129        instructions.setCaretPosition(0);
     
    145132        instructions.setRows(6);
    146133        instructions.setWrapStyleWord(true);
     134        Dictionary.registerText(instructions, "CDM.SuperCollectionManager.Instructions");
    147135
    148136        collection_checklist = new CheckList(collection_checklist_model, false);
    149137
    150138        // Layout
    151         //center_pane.setTopComponent(new JScrollPane(instructions));
    152         //center_pane.setBottomComponent(new JScrollPane(collection_checklist));
    153139        header_panel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    154140        header_panel.setLayout(new BorderLayout());
  • trunk/gli/src/org/greenstone/gatherer/cdm/TranslationView.java

    r5342 r5590  
    3838import org.greenstone.gatherer.cdm.CollectionDesignManager;
    3939import org.greenstone.gatherer.cdm.CollectionMeta;
    40 import org.greenstone.gatherer.cdm.CollectionMetaManager;
    4140import org.greenstone.gatherer.cdm.Control;
    4241import org.greenstone.gatherer.cdm.Index;
    4342import org.greenstone.gatherer.cdm.LanguageListCellRenderer;
    44 import org.greenstone.gatherer.cdm.LanguageManager;
    4543import org.greenstone.gatherer.cdm.SubcollectionIndex;
    4644
     
    7573    }
    7674    return controls;
    77     }
    78 
    79     private String get(String key) {
    80     if(key.indexOf(".") == -1) {
    81         key = "CDM.TranslationManager." + key;
    82     }
    83     return Gatherer.dictionary.get(key);
    8475    }
    8576
     
    201192        // Creation
    202193        JPanel header_panel = new JPanel();
    203         JLabel title_label = new JLabel(get("CDM.TranslationManager.Title"));
     194        JLabel title_label = new JLabel();
    204195        title_label.setHorizontalAlignment(JLabel.CENTER);
    205         JTextArea instruction_area = new JTextArea(get("CDM.TranslationManager.Instructions"));
     196        Dictionary.registerText(title_label, "CDM.TranslationManager.Title");
     197
     198        JTextArea instruction_area = new JTextArea();
    206199        instruction_area.setEditable(false);
    207200        instruction_area.setLineWrap(true);
    208201        instruction_area.setRows(6);
    209202        instruction_area.setWrapStyleWord(true);
     203        Dictionary.registerText(instruction_area, "CDM.TranslationManager.Instructions");
    210204
    211205        JPanel center_panel = new JPanel();
     
    214208
    215209        JPanel component_selection_panel = new JPanel();
    216         JLabel component_label = new JLabel(get("CDM.TranslationManager.Affected_Features"));
     210        JLabel component_label = new JLabel();
     211        Dictionary.registerText(component_label, "CDM.TranslationManager.Affected_Features");
    217212        features_list = new JList(getFeaturesList());
    218213        features_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    219214
    220215        JPanel fragment_selection_panel = new JPanel();
    221         JLabel fragment_label = new JLabel(get("CDM.TranslationManager.Assigned_Fragments"));
     216        JLabel fragment_label = new JLabel();
     217        Dictionary.registerText(fragment_label, "CDM.TranslationManager.Assigned_Fragments");
    222218
    223219        fragment_table = new JTable(fragment_table_model);
     
    237233
    238234        JPanel language_panel = new JPanel();
    239         JLabel language_label = new JLabel(get("CDM.TranslationManager.Language"));
     235        JLabel language_label = new JLabel();
    240236        language_label.setPreferredSize(LABEL_SIZE);
     237        Dictionary.registerText(language_label, "CDM.TranslationManager.Language");
    241238        language_combobox = new JComboBox(CollectionDesignManager.language_manager.getLanguageCodes().toArray());
    242239        language_combobox.setRenderer(new LanguageListCellRenderer());
     240        Dictionary.registerTooltip(language_combobox, "CDM.TranslationManager.Language_Tooltip");
    243241
    244242        JPanel default_text_panel = new JPanel();
    245         JLabel default_label = new JLabel(get("CDM.TranslationManager.Default_Text"));
     243        JLabel default_label = new JLabel();
     244        Dictionary.registerText(default_label, "CDM.TranslationManager.Default_Text");
    246245        default_area = new JTextArea();
    247246        default_area.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    251250
    252251        JPanel translated_text_panel = new JPanel();
    253         JLabel translation_label = new JLabel(get("CDM.TranslationManager.Translation"));
     252        JLabel translation_label = new JLabel();
     253        Dictionary.registerText(translation_label, "CDM.TranslationManager.Translation");
    254254        translation_area = new JTextArea();
    255255        translation_area.setBackground(Gatherer.config.getColor("coloring.disabled", false));
     
    257257        translation_area.setLineWrap(true);
    258258        translation_area.setWrapStyleWord(true);
     259        Dictionary.registerTooltip(translation_area, "CDM.TranslationManager.Translation_Tooltip");
    259260
    260261        JPanel button_pane = new JPanel();
    261         add_button = new JButton(get("CDM.TranslationManager.Add"));
     262        add_button = new JButton();
    262263        add_button.setEnabled(false);
    263264        add_button.setMnemonic(KeyEvent.VK_A);
    264         replace_button = new JButton(get("CDM.TranslationManager.Replace"));
     265        Dictionary.registerBoth(add_button, "CDM.TranslationManager.Add", "CDM.TranslationManager.Add_Tooltip");
     266        replace_button = new JButton();
    265267        replace_button.setEnabled(false);
    266268        replace_button.setMnemonic(KeyEvent.VK_C);
    267         remove_button = new JButton(get("CDM.TranslationManager.Remove"));
     269        Dictionary.registerBoth(replace_button, "CDM.TranslationManager.Replace", "CDM.TranslationManager.Replace_Tooltip");
     270        remove_button = new JButton();
    268271        remove_button.setEnabled(false);
    269272        remove_button.setMnemonic(KeyEvent.VK_R);
     273        Dictionary.registerBoth(remove_button, "CDM.TranslationManager.Remove", "CDM.TranslationManager.Remove_Tooltip");
    270274
    271275        // Connection
     
    516520        }
    517521        public String getColumnName(int column) {
    518         return get("CDM.TranslationManager.Column_Name_" + column);
     522        return Dictionary.newget("CDM.TranslationManager.Column_Name_" + column);
    519523        }
    520524
     
    646650    }
    647651    }
    648 
    649652}
    650 
    651 
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r5581 r5590  
    4646import org.greenstone.gatherer.Gatherer;
    4747import org.greenstone.gatherer.cdm.CollectionDesignManager;
    48 import org.greenstone.gatherer.cdm.CommandTokenizer;
    4948import org.greenstone.gatherer.collection.Collection;
    5049import org.greenstone.gatherer.collection.SaveCollectionTask;
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r5581 r5590  
    199199        Gatherer.c_man.saveCollection(false, false);
    200200    }
    201     else if(esrc == menu_bar.file_save_as) {
    202         String name = JOptionPane.showInputDialog(this, "Enter new collection filename.");
    203         if(name != null) {
    204         Gatherer.c_man.saveCollectionAs(name);
    205         }
    206     }
     201//      else if(esrc == menu_bar.file_save_as) {
     202//          String name = JOptionPane.showInputDialog(this, "Enter new collection filename.");
     203//          if(name != null) {
     204//          Gatherer.c_man.saveCollectionAs(name);
     205//          }
     206//      }
    207207    // *************
    208208    // Edit Options.
     
    507507    }
    508508    /** This method is called when the collection is being built, and is used to disable all controls in all pane which could change the state of the collection.
    509       */
     509     */
    510510    public void lockCollection(boolean import_stage, boolean lock) {
    511511    locked = lock;
  • trunk/gli/src/org/greenstone/gatherer/gui/table/TableCellRenderer.java

    r5178 r5590  
    3535 *########################################################################
    3636 */
    37 
    38  
    39 
    40 
    41 
    42 
    4337package org.greenstone.gatherer.gui.table;
    4438
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java

    r5571 r5590  
    1111import javax.swing.event.*;
    1212import javax.swing.tree.*;
     13import org.greenstone.gatherer.Dictionary;
    1314import org.greenstone.gatherer.Gatherer;
    1415import org.greenstone.gatherer.file.FileNode;
     
    221222        }
    222223        else {
    223         String title = getSelectionCount() + " files";
     224        String title = getSelectionCount() + Dictionary.newget("Tree.Files");
    224225        label = new JLabel(title, ((DefaultTreeCellRenderer)getCellRenderer()).getClosedIcon(), JLabel.CENTER);
    225226        title = null;
     
    272273    pt_last = pt;
    273274    if(!DragSource.isDragImageSupported()) {
    274                 // Erase the last ghost image and cue line
     275        // Erase the last ghost image and cue line
    275276        paintImmediately(ra_ghost.getBounds());
    276                 // Remember where you are about to draw the new ghost image
     277        // Remember where you are about to draw the new ghost image
    277278        ra_ghost.setRect(pt.x - group.mouse_offset.x, pt.y - group.mouse_offset.y, group.image_ghost.getWidth(), group.image_ghost.getHeight());
    278                 // Draw the ghost image
     279        // Draw the ghost image
    279280        g2.drawImage(group.image_ghost, AffineTransform.getTranslateInstance(ra_ghost.getX(), ra_ghost.getY()), null);
    280281    }
     
    282283    TreePath target_path = this.getPathForLocation(pt.x, pt.y);
    283284    if(previous_path == null || target_path != null && !target_path.equals(previous_path)) {
    284                 // Immediately clear the old cue lines.
     285        // Immediately clear the old cue lines.
    285286        if(upper_cue_line != null && lower_cue_line != null) {
    286287        paintImmediately(upper_cue_line.getBounds());
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTreeCellRenderer.java

    r5360 r5590  
    1 package org.greenstone.gatherer.gui.tree;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui.tree;
     38
    3839import java.awt.*;
    3940import javax.swing.*;
     
    9798    }
    9899}
    99 
  • trunk/gli/src/org/greenstone/gatherer/mem/MetadataEditorManager.java

    r5589 r5590  
    4747import org.greenstone.gatherer.Gatherer;
    4848import org.greenstone.gatherer.cdm.LanguageListCellRenderer;
    49 import org.greenstone.gatherer.cdm.LanguageManager;
    5049import org.greenstone.gatherer.gui.ComboArea;
    5150import org.greenstone.gatherer.gui.GComboBox;
Note: See TracChangeset for help on using the changeset viewer.