Ignore:
Timestamp:
2003-09-26T14:58:33+12:00 (21 years ago)
Author:
mdewsnip
Message:

Many more tooltips and improvements to the Dictionary. Still more to come.

File:
1 edited

Legend:

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

    r5350 r5536  
    1 package org.greenstone.gatherer.gui;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.gui;
     38
    3839import java.awt.*;
    3940import java.awt.event.*;
     
    4344import javax.swing.event.*;
    4445import javax.swing.text.*;
     46import org.greenstone.gatherer.Dictionary;
    4547import org.greenstone.gatherer.Gatherer;
    4648import org.greenstone.gatherer.cdm.Argument;
     
    5355import org.greenstone.gatherer.util.AppendLineOnlyFileDocumentOwner;
    5456import org.greenstone.gatherer.util.Utility;
    55 //import org.w3c.dom.*;
     57
    5658/** This class serves as the data holder for all subclasses of option panes, such as Import options or All options. It also contains methods for creating each of the option lines as they would appear in the subpane. Futhermore it has a method for considering all the arguments and generating a <strong>String[]</strong> to allow you to pass them to the <strong>GShell</strong>.
    5759 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    9193
    9294
    93     /** The default constructor creates the few session length options, but either retrieves the rest from the current collection, or creates a default set of options. */
     95    /** The default constructor creates the few session length options, but either retrieves the rest from the current collection, or creates a default set of options. */
    9496    public OptionsPane(BuildOptions build_options) {
    9597    this.build_options = build_options;
     
    102104
    103105    /** This method creates the panel with all the build only options on it.
    104       * @return A <strong>JPanel</strong> which can be used to display all the build only options.
    105       */
     106     * @return A <strong>JPanel</strong> which can be used to display all the build only options.
     107     */
    106108    public JPanel buildBuild() {
    107109    JPanel pane = new JPanel();
     
    122124    }
    123125    /** This method creates the panel with all the import only options on it.
    124       * @return A <strong>JPanel</strong> which can be used to display all the import only options.
    125       */
     126     * @return A <strong>JPanel</strong> which can be used to display all the import only options.
     127     */
    126128    public JPanel buildImport() {
    127129    JPanel pane = new JPanel();
     
    142144    }
    143145    /** This method is used to build a panel based on the message log, which is nothing like any of the other panels.
    144       * @return A <strong>JPanel</strong> containing a scrollable text area which represents the shell process message log.
    145       */
     146     * @return A <strong>JPanel</strong> containing a scrollable text area which represents the shell process message log.
     147     */
    146148    public JPanel buildLog() {
    147149    // we now save the log pane
     
    179181        log_list.addListSelectionListener(new LogListListener());
    180182
    181         JLabel log_history_label = new JLabel(get("OptionsPane.LogHistory"));
     183        JLabel log_history_label = new JLabel();
     184        Dictionary.registerText(log_history_label, "OptionsPane.LogHistory");
    182185        JPanel log_history_pane = new JPanel();
    183186        log_history_pane.setPreferredSize(new Dimension(600, 100));
     
    211214    }
    212215
    213     /** This method retrieves a phrase from the dictionary based apon the key.
    214       * @param key A <strong>String</strong> used as a reference to the correct phrase.
    215       * @return A phrase, matching the key, as a <strong>String</strong>.
    216       */
    217     private String get(String key) {
    218     return get(key, null);
    219     }
    220     /** This method retrieves a phrase from the dictionary based apon the key and arguments.
    221       * @param key A <strong>String</strong> used as a reference to the correct phrase.
    222       * @param args A <strong>String[]</strong> whose contents are often substituted into the phrase before it is returned.
    223       * @return A phrase, matching the key and constructed using the arguments, as a <strong>String</strong>.
    224       * @see org.greenstone.gatherer.Dictionary
    225       * @see org.greenstone.gatherer.Gatherer
    226       */
    227     private String get(String key, String args[]) {
    228     if(key.indexOf(".") == -1) {
    229         key = "OptionsPane." + key;
    230     }
    231     return Gatherer.dictionary.get(key, args);
    232     }
     216
    233217    /** Attempts to discover the latest document count.
    234218     * @return An <strong>int</strong> detailing the number of documents in this collection.
     
    285269        setLayout(new BorderLayout());
    286270        setPreferredSize(ROW_SIZE);
    287 
    288         /*
    289           JPanel inner_pane = new JPanel();
    290           inner_pane.setOpaque(false);
    291         */
    292271
    293272        // Try to determine what the value_controls value should be.
     
    389368        }
    390369
    391                 // If the argument is required, then you don't get a choice of whether it is enabled.
     370        // If the argument is required, then you don't get a choice of whether it is enabled.
    392371        if(argument.isRequired()) {
    393372        JLabel label = new JLabel(argument.getName());
     
    460439    }
    461440    /** 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.
    462             * @param event An <strong>ActionEvent</strong> containing information about the click.
    463             */
     441     * @param event An <strong>ActionEvent</strong> containing information about the click.
     442     */
    464443    public void actionPerformed(ActionEvent event) {
    465444        JCheckBox source = (JCheckBox)event.getSource();
     
    562541        switch (success) {
    563542        case SUCCESSFUL:
    564             d.append(get("OptionsPane.Successful"));
     543            d.append(Dictionary.newget("OptionsPane.Successful"));
    565544            break;
    566545        case UNSUCCESSFUL:
    567             d.append(get("OptionsPane.Unsuccessful"));
     546            d.append(Dictionary.newget("OptionsPane.Unsuccessful"));
    568547            break;
    569548        case CANCELLED:
    570             d.append(get("OptionsPane.Cancelled"));
     549            d.append(Dictionary.newget("OptionsPane.Cancelled"));
    571550            break;
    572551        default:
    573             d.append(get("OptionsPane.Unknown"));
     552            d.append(Dictionary.newget("OptionsPane.Unknown"));
    574553        }
    575554        display = d.toString();
Note: See TracChangeset for help on using the changeset viewer.