Changeset 5529


Ignore:
Timestamp:
2003-09-24T16:09:13+12:00 (21 years ago)
Author:
mdewsnip
Message:

Further along the tooltip highway. Hacked up the Dictionary code, and are updating the classes to use the new code.

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

Legend:

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

    r5164 r5529  
    660660        JPanel pane = (JPanel) Gatherer.g_man.getContentPane();
    661661        pane.updateUI();
    662                 // Also update all of the tabs according to workflow.
    663         Gatherer.g_man.workflowUpdate("Browser", get("workflow.browse", false));
    664         Gatherer.g_man.workflowUpdate("Mirroring", get("workflow.mirror", false));
    665         Gatherer.g_man.workflowUpdate("Collection", get("workflow.gather", false));
    666         Gatherer.g_man.workflowUpdate("MetaEdit", get("workflow.enrich", false));
    667         Gatherer.g_man.workflowUpdate("Build", get("workflow.design", false));
     662        // Also update all of the tabs according to workflow.
     663        Gatherer.g_man.workflowUpdate("Hunt", get("workflow.browse", false));
     664        Gatherer.g_man.workflowUpdate("Mirror", get("workflow.mirror", false));
     665        Gatherer.g_man.workflowUpdate("Gather", get("workflow.gather", false));
     666        Gatherer.g_man.workflowUpdate("Enrich", get("workflow.enrich", false));
     667        Gatherer.g_man.workflowUpdate("Design", get("workflow.design", false));
    668668        Gatherer.g_man.workflowUpdate("Export", get("workflow.export", false));
    669669        Gatherer.g_man.workflowUpdate("Create", get("workflow.create", false));
  • trunk/gli/src/org/greenstone/gatherer/Dictionary.java

    r5527 r5529  
    3636 *########################################################################
    3737 */
     38import java.awt.Component;
    3839import java.io.*;
    3940import java.util.*;
     
    4243import javax.swing.text.*;
    4344import javax.swing.tree.*;
     45import org.greenstone.gatherer.gui.GComboBox;
    4446import org.greenstone.gatherer.gui.border.TitledBorder;
    4547import org.greenstone.gatherer.util.DictionaryTreeNode;
     
    192194    }
    193195
     196
     197    static public String newget(String key)
     198    {
     199    return self.get(key);
     200    }
     201
     202
     203    static public String newget(String key, String[] args)
     204    {
     205    return self.get(key, args);
     206    }
     207
     208
    194209    /** Overloaded to call get with both a key and an empty argument array.
    195       * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
    196       * @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.
    197       */
     210     * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
     211     * @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.
     212     */
    198213    public String get(String key) {
    199214    return get(key, (String[])null);
     
    219234    try {
    220235        String initial = dictionary.getString(key);
    221                 // If the string contains arguments we have to insert them.
     236        // If the string contains arguments we have to insert them.
    222237        String complete = "";
    223                 // While we still have initial string left.
     238        // While we still have initial string left.
    224239        while(initial.length() > 0 && initial.indexOf('{') != -1 && initial.indexOf('}') != -1) {
    225240        // Remove preamble
     
    261276    }
    262277    }
     278
    263279    /** Retrieve the two letter code of the current language we are using, according to the stored locale.
    264       * @return A <strong>String</strong> containing the two letter ISO639 language code.
    265       */
     280     * @return A <strong>String</strong> containing the two letter ISO639 language code.
     281     */
    266282    public String getLanguage() {
    267283    return locale.getLanguage();
    268284    }
    269     /** Register an abstract button component. */
    270     public void register(AbstractButton component, String[] args, boolean already_registered) {
     285
     286
     287    static public void setBoth(Component component, String text_key, String tooltip_key)
     288    {
     289    self.oldSetBoth(component, text_key, null, tooltip_key);
     290    }
     291
     292
     293    static public void setText(Component component, String text_key)
     294    {
     295    self.oldSetText(component, text_key, null);
     296    }
     297
     298
     299    static public void setText(Component component, String text_key, String[] args)
     300    {
     301    self.oldSetText(component, text_key, args);
     302    }
     303
     304
     305    static public void setTooltip(Component component, String tooltip_key)
     306    {
     307    self.oldSetTooltip(component, tooltip_key);
     308    }
     309
     310
     311    private void oldSetBoth(Component component, String text_key, String[] args, String tooltip_key)
     312    {
     313    oldSetText(component, text_key, args);
     314    oldSetTooltip(component, tooltip_key);
     315    }
     316
     317
     318    private void oldSetText(Component component, String text_key, String[] args)
     319    {
     320    if (component != null) {
     321        // Update the component's details
     322        ComponentDetails details = (ComponentDetails) remove(component);
     323        if (details == null) {
     324        details = new ComponentDetails(true, text_key, args, false, null);
     325        }
     326        else {
     327        details.has_text = true;
     328        details.text_key = text_key;
     329        details.text_args = args;
     330        }
     331        put(component, details);
     332
     333        // Update the component using the AWTEvent queue
     334        RegisteredComponentUpdateTask task = new RegisteredComponentUpdateTask(component);
     335        SwingUtilities.invokeLater(task);
     336    }
     337    }
     338
     339
     340    private void oldSetTooltip(Component component, String tooltip_key)
     341    {
     342    if (component != null) {
     343        // Update the component's details
     344        ComponentDetails details = (ComponentDetails) remove(component);
     345        if (details == null) {
     346        details = new ComponentDetails(false, null, null, true, tooltip_key);
     347        }
     348        else {
     349        details.has_tooltip = true;
     350        details.tooltip_key = tooltip_key;
     351        }
     352        put(component, details);
     353
     354        // Update the component using the AWTEvent queue
     355        RegisteredComponentUpdateTask task = new RegisteredComponentUpdateTask(component);
     356        SwingUtilities.invokeLater(task);
     357    }
     358    }
     359
     360
     361    private class ComponentDetails
     362    {
     363    public boolean has_text;
     364    public String text_key;
     365    public String[] text_args;
     366    public boolean has_tooltip;
     367    public String tooltip_key;
     368
     369    public ComponentDetails(boolean has_text, String text_key, String[] text_args,
     370                boolean has_tooltip, String tooltip_key)
     371    {
     372        this.has_text = has_text;
     373        this.text_key = text_key;
     374        this.text_args = text_args;
     375        this.has_tooltip = has_tooltip;
     376        this.tooltip_key = tooltip_key;
     377    }
     378    }
     379
     380
     381    private class RegisteredComponentUpdateTask
     382    implements Runnable {
     383
     384    private Component component;
     385    private ComponentDetails details;
     386    private String text = null;
     387    private String tooltip = null;
     388
     389    public RegisteredComponentUpdateTask(Component component)
     390    {
     391        this.component = component;
     392        this.details = (ComponentDetails) get(component);
     393
     394        if (details.has_text) {
     395        text = get(details.text_key, details.text_args);
     396        }
     397        if (details.has_tooltip) {
     398        tooltip = get(details.tooltip_key, (String[]) null);
     399        }
     400    }
     401
     402
     403    public void run()
     404    {
     405        // If the component has text
     406        if (text != null) {
     407        if (component instanceof AbstractButton) {
     408            ((AbstractButton) component).setText(text);
     409        }
     410        else if (component instanceof JDialog) {
     411            ((JDialog) component).setTitle(text);
     412        }
     413        else if (component instanceof JLabel) {
     414            ((JLabel) component).setText(text);
     415        }
     416        else if (component instanceof JTextComponent) {
     417            ((JTextComponent) component).setText(text);
     418        }
     419        else {
     420            System.err.println("Unhandled component: " + component.getClass());
     421        }
     422        }
     423
     424        // If the component has a tooltip
     425        if (tooltip != null) {
     426        if (component instanceof JComponent) {
     427            ((JComponent) component).setToolTipText(tooltip);
     428        }
     429        }
     430    }
     431    }
     432
     433
     434    /**
     435     * @deprecated
     436     * Register an abstract button component */
     437    public void register(AbstractButton component, String[] args, boolean already_registered)
     438    {
    271439    if(component != null) {
    272440        // Determine the key
     
    290458    }
    291459    }
    292     /** Register a combobox component. */
     460
     461    /**
     462     * @deprecated
     463     * Register a JCheckBox component */
     464    public void register(JCheckBox component, String[] args, boolean already_registered)
     465    {
     466    }
     467
     468    /**
     469     * @deprecated
     470     * Register a combobox component. */
    293471    public void register(JComboBox component, String[] args, boolean already_registered) {
    294472    if(component != null) {
     
    317495    }
    318496    }
    319     /** Register a dialog component. */
     497
     498    /**
     499     * @deprecated
     500     * Register a dialog component. */
    320501    public void register(JDialog component, String[] args, boolean already_registered) {
    321502    if(component != null) {
     
    339520    }
    340521    }
    341     /** Register a frame component. */
     522
     523    /**
     524     * @deprecated
     525     * Register a frame component. */
    342526    public void register(JFrame component, String[] args, boolean already_registered) {
    343527    if(component != null) {
     
    361545    }
    362546    }
    363     /** Register a label component. */
     547
     548    /**
     549     * @deprecated
     550     * Register a label component. */
    364551    public void register(JLabel component, String[] args, boolean already_registered) {
    365552    if(component != null) {
     
    383570    }
    384571    }
    385     /** Register a tab pane component. */
     572
     573    /**
     574     * @deprecated
     575     * Register a tab pane component. */
    386576    public void register(JTabbedPane component, String[] args, boolean already_registered) {
    387577    if(component != null) {
     
    407597    }
    408598
    409     /** Register a text component. */
     599    /**
     600     * @deprecated
     601     * Register a text component. */
    410602    public void register(JTextComponent component, String[] args, boolean already_registered)
    411603    {
     
    433625    }
    434626
    435     /** Register a tree component. */
     627    /**
     628     * @deprecated
     629     * Register a tree component. */
    436630    public void register(JTree component, String[] args, boolean already_registered) {
    437631    if(component != null) {
     
    457651    }
    458652    }
    459     /** Register a titled border component. */
     653
     654    /**
     655     * @deprecated
     656     * Register a titled border component. */
    460657    public void register(TitledBorder component, String[] args, boolean already_registered) {
    461658    if(component != null) {
     
    479676    }
    480677    }
     678
    481679    /** A get method called internally by components that have been previously been registered, which means that arg[index] is the original key value. Index is usually the last entry in the array, however this is not true for comboboxes, tabbed panes and trees. */
    482680    private String get(String[] args, int index) {
    483681    return get(args[index], args);
    484682    }
     683
    485684
    486685    private abstract class ChangeTask
     
    495694    }
    496695    }
     696
    497697    /** Update the text and tooltip for this button. */
    498698    private class AbstractButtonChangeTask
     
    507707    public void run() {
    508708        component.setText(value);
    509         if(!tooltip.equals(key+"_Tooltip")) {
    510         component.setToolTipText(tooltip);
    511         }
    512         else {
    513         component.setToolTipText(null);
    514         }
     709        // if(!tooltip.equals(key+"_Tooltip")) {
     710        component.setToolTipText(tooltip);
     711        // }
     712        // else {
     713        // component.setToolTipText(null);
     714        // }
    515715    }
    516716    }
     
    568768    }
    569769    }
     770
    570771    /** Update the text of this label. */
    571772    private class JLabelChangeTask
    572773    extends ChangeTask {
    573774    private JLabel component;
     775
    574776    public JLabelChangeTask(JLabel component, String key, String value) {
    575777        super(key, value);
    576778        this.component = component;
    577779    }
     780
    578781    public void run() {
    579782        component.setText(value);
    580783    }
    581784    }
     785
    582786    /** Updates a tabbed panes tab title and tooltip. */
    583787    private class JTabbedPaneChangeTask
     
    666870    }
    667871}
    668 
    669 
    670 
    671 
  • trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java

    r5357 r5529  
    2525 *########################################################################
    2626 */
     27
    2728package org.greenstone.gatherer.cdm;
     29
    2830import java.awt.*;
    2931import java.awt.event.*;
     
    7072    // Creation
    7173    JPanel tree_pane = new JPanel();
    72     JLabel title = new JLabel(get("CDM.GUI.Design_Topics"));
     74    JLabel title = new JLabel();
     75    Gatherer.dictionary.setText(title, "CDM.GUI.Design_Topics", null);
    7376    tree = new DesignTree();
    7477    view = controls;
     
    106109    /** Refresh the values on our controls that could be stale due to changes in other components. */
    107110    public void gainFocus() {
    108     if(view != null) {
     111    if (view != null) {
    109112        view.gainFocus();
    110113    }
     
    113116    /** Saves the state of the controls in the current view. */
    114117    public void loseFocus() {
    115     if(view != null) {
     118    if (view != null) {
    116119        view.loseFocus();
    117120    }
    118     }
    119 
    120     /** Overloaded to call get with both a key and an empty argument array.
    121      * @param key a String which is mapped to a key within the dictionary
    122      * @return a String which has been referenced by the key and that either contains no argument fields, or has had the argument fields automatically populated with arguments provided in the get call
    123      */
    124     private String get(String key) {
    125     return get(key, null);
    126     }
    127 
    128     /** 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>
    129      * 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>.
    130      * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
    131      * @param args A <strong>String[]</strong> used to populate argument fields within the complete String.
    132      * @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.
    133      * @see org.greenstone.gatherer.Gatherer
    134      * @see org.greenstone.gatherer.Dictionary
    135      */
    136     private String get(String key, String args[]) {
    137     if(key.indexOf('.') == -1) {
    138         key = "CDM.GUI." + key;
    139     }
    140     return Gatherer.dictionary.get(key, args);
    141121    }
    142122
     
    191171        beta_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getBeta());
    192172        public_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getPublic());
    193        
     173
    194174        // Creation
    195175        JPanel instruction_panel = new JPanel();
    196         title_label = new JLabel("CDM.General.Title");
     176        title_label = new JLabel();
    197177        title_label.setHorizontalAlignment(JLabel.CENTER);
    198         instructions_textarea = new JTextArea("CDM.General.Instructions");
     178        Gatherer.dictionary.setText(title_label, "CDM.General.Title", null);
     179
     180        instructions_textarea = new JTextArea();
    199181        instructions_textarea.setCaretPosition(0);
    200182        instructions_textarea.setEditable(false);
     
    202184        instructions_textarea.setRows(6);
    203185        instructions_textarea.setWrapStyleWord(true);
     186        Gatherer.dictionary.setText(instructions_textarea, "CDM.General.Instructions", null);
    204187
    205188        JPanel all_details_panel = new JPanel();
    206189        JPanel details_panel = new JPanel();
    207190        JPanel creator_panel = new JPanel();
    208         creator_label = new JLabel("CDM.General.Email.Creator");
     191        creator_label = new JLabel();
    209192        creator_label.setPreferredSize(LABEL_SIZE);
     193        Gatherer.dictionary.setText(creator_label, "CDM.General.Email.Creator", null);
     194
    210195        creator_emailfield = new EmailField(Gatherer.config.getColor("coloring.error_background", false));
     196        Gatherer.dictionary.setTooltip(creator_emailfield, "CDM.General.Email.Creator_Tooltip");
     197
    211198        JPanel maintainer_panel = new JPanel();
    212         maintainer_label = new JLabel("CDM.General.Email.Maintainer");
     199        maintainer_label = new JLabel();
    213200        maintainer_label.setPreferredSize(LABEL_SIZE);
     201        Gatherer.dictionary.setText(maintainer_label, "CDM.General.Email.Maintainer", null);
     202
    214203        maintainer_emailfield = new EmailField(Gatherer.config.getColor("coloring.error_background", false));
    215         public_checkbox = new JCheckBox("CDM.General.Access", public_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
    216         beta_checkbox = new JCheckBox("CDM.General.Beta", beta_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
     204        Gatherer.dictionary.setTooltip(maintainer_emailfield, "CDM.General.Email.Maintainer_Tooltip");
     205        public_checkbox = new JCheckBox("", public_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
     206        Gatherer.dictionary.setText(public_checkbox, "CDM.General.Access", null);
     207        beta_checkbox = new JCheckBox("", beta_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
     208        Gatherer.dictionary.setText(beta_checkbox, "CDM.General.Beta", null);
    217209        JPanel name_panel = new JPanel();
    218         name_label = new JLabel("CDM.General.Collection_Name");
     210        name_label = new JLabel();
    219211        name_label.setPreferredSize(LABEL_SIZE);
    220         name_textfield = new JTextField();
     212        Gatherer.dictionary.setText(name_label, "CDM.General.Collection_Name", null);
     213        name_textfield = new JTextField("CDM.General.Collection_Name");
     214        Gatherer.dictionary.setTooltip(name_textfield, "CDM.General.Collection_Name_Tooltip");
    221215        JPanel icon_panel = new JPanel();
    222         icon_label = new JLabel("CDM.General.Icon_Collection");
     216        icon_label = new JLabel();
    223217        icon_label.setPreferredSize(LABEL_SIZE);
    224         icon_textfield = new JTextField();
     218        Gatherer.dictionary.setText(icon_label, "CDM.General.Icon_Collection", null);
     219        icon_textfield = new JTextField("CDM.General.Icon_Collection");
     220        Gatherer.dictionary.setTooltip(icon_textfield, "CDM.General.Icon_Collection_Tooltip");
    225221        JPanel small_icon_panel = new JPanel();
    226222        small_icon_label = new JLabel("CDM.General.Icon_Collection_Small");
    227223        small_icon_label.setPreferredSize(LABEL_SIZE);
    228         small_icon_textfield = new JTextField();
     224        Gatherer.dictionary.setText(small_icon_label, "CDM.General.Icon_Collection_Small", null);
     225        small_icon_textfield = new JTextField("CDM.General.Icon_Collection_Small");
     226        Gatherer.dictionary.setTooltip(small_icon_textfield, "CDM.General.Icon_Collection_Small_Tooltip");
    229227        JPanel description_panel = new JPanel();
    230         description_label = new JLabel("CDM.General.Collection_Extra");
     228        description_label = new JLabel();
    231229        description_label.setPreferredSize(LABEL_SIZE);
     230        Gatherer.dictionary.setText(description_label, "CDM.General.Collection_Extra", null);
    232231        description_textarea = new JTextArea();
    233232        description_textarea.setBackground(Gatherer.config.getColor("coloring.editable_background", false));
     233        Gatherer.dictionary.setTooltip(description_textarea, "CDM.General.Collection_Extra_Tooltip");
    234234        // Connection
    235235        beta_checkbox.addActionListener(CollectionDesignManager.change_listener);
     
    241241        name_textfield.getDocument().addDocumentListener(CollectionDesignManager.change_listener);
    242242        small_icon_textfield.getDocument().addDocumentListener(CollectionDesignManager.change_listener);
    243         Gatherer.dictionary.register(beta_checkbox, null, false);
    244         Gatherer.dictionary.register(creator_label, null, false);
    245         Gatherer.dictionary.register(description_label, null, false);
    246         Gatherer.dictionary.register(icon_label, null, false);
    247         Gatherer.dictionary.register(instructions_textarea, null, false);
    248         Gatherer.dictionary.register(maintainer_label, null, false);
    249         Gatherer.dictionary.register(name_label, null, false);
    250         Gatherer.dictionary.register(public_checkbox, null, false);
    251         Gatherer.dictionary.register(small_icon_label, null, false);
    252         Gatherer.dictionary.register(title_label, null, false);
     243
    253244        // Layout
    254245        instruction_panel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
     
    299290        add(all_details_panel, BorderLayout.CENTER);
    300291    }
     292
    301293    /** Destructor. */
    302294    public void destroy() {
    303         Gatherer.dictionary.deregister(beta_checkbox);
    304         Gatherer.dictionary.deregister(creator_label);
    305         Gatherer.dictionary.deregister(description_label);
    306         Gatherer.dictionary.deregister(icon_label);
    307         Gatherer.dictionary.deregister(instructions_textarea);
    308         Gatherer.dictionary.deregister(maintainer_label);
    309         Gatherer.dictionary.deregister(name_label);
    310         Gatherer.dictionary.deregister(public_checkbox);
    311         Gatherer.dictionary.deregister(small_icon_label);
    312         Gatherer.dictionary.deregister(title_label);
    313     }
     295    }
     296
    314297    /** Called to refresh the components. */
    315298    public void gainFocus() {
     
    361344    public DesignTree() {
    362345        super();
    363         root = new DesignNode("CDM.GUI.Root");
     346        root = new DesignNode("Root");
    364347        this.setModel(new DefaultTreeModel(root));
    365348        // Now add the design categories.
     
    390373    /** Constructor.
    391374     * @param object The <strong>Object</strong> assigned to this node.
    392           */
     375    */
    393376    public DesignNode(String object) {
    394377        super(object);
     
    398381     */
    399382    public String toString() {
    400         return get((String)getUserObject());
     383        return Gatherer.dictionary.get("CDM.GUI." + (String)getUserObject());
    401384    }
    402385    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java

    r5342 r5529  
    145145    }
    146146    if(plugin.getName().equals(StaticStrings.ARCPLUG_STR) || plugin.getName().equals(StaticStrings.RECPLUG_STR)) {
    147         JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.Fixed"), get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
     147        JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.Move.Fixed"), Gatherer.dictionary.get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
    148148        return;
    149149    }
     
    182182        if(index < 0) {
    183183            String args[] = new String[2];
    184             args[0] = get("CDM.PlugInManager.PlugIn_Str");
     184            args[0] = Gatherer.dictionary.get("CDM.PlugInManager.PlugIn_Str");
    185185            args[1] = plugin.getName();
    186             JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.At_Top", args), get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
     186            JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.Move.At_Top", args), Gatherer.dictionary.get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
    187187            return;
    188188        }
     
    197197            String args[] = new String[1];
    198198            args[0] = plugin.getName();
    199             JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.Cannot", args), get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
     199            JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.Move.Cannot", args), Gatherer.dictionary.get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
    200200            // Still not going to move RecPlug or ArcPlug.
    201201            return;
     
    279279    }
    280280
    281     /* Retrieve a phrase from the dictionary based on a certain key.
    282      * @param key The search <strong>String</strong>.
    283      * @return The matching phrase from the Dictionary.
    284      */
    285     private String get(String key) {
    286     return get(key, (String[])null);
    287     }
    288    
    289     private String get(String key, String arg) {
    290     String args[] = new String[1];
    291     args[0] = arg;
    292     return get(key, args);
    293     }
    294 
    295     /* Retrieve a phrase from the dictionary based on a certain key and arguments.
    296      * @param key The search <strong>String</strong>.
    297      * @param args A <strong>String[]</strong> of arguments used to complete and format the choosen phrase.
    298      * @return The matching phrase from the Dictionary.
    299      */
    300     private String get(String key, String args[]) {
    301     if(key.indexOf(".") == -1) {
    302         key = "CDM.PlugInManager." + key;
    303     }
    304     return Gatherer.dictionary.get(key, args);
    305     }   
    306281
    307282    /** Retrieve a list of those plugins that are in library but not in the assigned plugins. */
     
    398373        String plugin_name = getPlugInName(plugin);
    399374        //Gatherer.println("Zero length argument xml detected for: " + plugin_name);
    400         JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin_name), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     375        JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin_name), Gatherer.dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    401376        }
    402377    }
     
    435410    if(files != null) {
    436411        // Create a progress indicator.
    437         ParsingProgress progress = new ParsingProgress(get("CDM.PlugInManager.Parsing.Title"), get("CDM.PlugInManager.Parsing.Message"), files.length);
     412        ParsingProgress progress = new ParsingProgress(Gatherer.dictionary.get("CDM.PlugInManager.Parsing.Title"), Gatherer.dictionary.get("CDM.PlugInManager.Parsing.Message"), files.length);
    438413        for(int i = 0; i < files.length; i++) {
    439414        // We only want to check Perl Modules.
     
    565540    /** The area where the add, configure and remove buttons are placed. */
    566541    private JPanel button_pane = null;
    567     /** The region which divides the central portion of the view into list and controls. */
     542    /** The region which divides the central portion of the view into list and controls */
    568543    private JPanel central_pane = null;
    569544    /** The area where title label and instructions sit. */
     
    577552    /** The text area containing instructions on the use of this control. */
    578553    private JTextArea instructions = null;
     554
    579555    /** Constructor.
    580556     */
    581557    public PlugInControl() {
    582558        // Create
    583         add = new JButton(get("CDM.PlugInManager.Add"));
     559        add = new JButton();
    584560        add.setMnemonic(KeyEvent.VK_A);
     561        Gatherer.dictionary.setBoth(add, "CDM.PlugInManager.Add", "CDM.PlugInManager.Add_Tooltip");
     562
    585563        button_pane = new JPanel();
    586564        central_pane = new JPanel();
    587         configure = new JButton(get("CDM.PlugInManager.Configure"));
     565
     566        configure = new JButton();
    588567        configure.setEnabled(false);
    589568        configure.setMnemonic(KeyEvent.VK_C);
     569        Gatherer.dictionary.setBoth(configure, "CDM.PlugInManager.Configure", "CDM.PlugInManager.Configure_Tooltip");
     570
    590571        header_pane = new JPanel();
    591         instructions = new JTextArea(get("CDM.PlugInManager.Instructions"));
     572
     573        instructions = new JTextArea();
    592574        instructions.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    593575        instructions.setEditable(false);
     
    595577        instructions.setRows(6);
    596578        instructions.setWrapStyleWord(true);
    597 
    598         move_top_button = new DoubleImageButton(get("CDM.Move.Move_Top"), Utility.getImage("arrow-top.gif"), Utility.getImage("arrow-top-disabled.gif"));
     579        Gatherer.dictionary.setText(instructions, "CDM.PlugInManager.Instructions", null);
     580
     581        move_top_button = new DoubleImageButton("", Utility.getImage("arrow-top.gif"), Utility.getImage("arrow-top-disabled.gif"));
    599582        move_top_button.setEnabled(false);
    600583        move_top_button.setMnemonic(KeyEvent.VK_T);
    601         move_top_button.setDisplayedMnemonicIndex(8);  // !! English-centric hack
     584        // move_top_button.setDisplayedMnemonicIndex(8);  // !! English-centric hack
    602585        move_top_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
    603 
    604         move_up_button = new DoubleImageButton(get("CDM.Move.Move_Up"), Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif"));
     586        Gatherer.dictionary.setBoth(move_top_button, "CDM.Move.Move_Top", "CDM.Move.Move_Top_Tooltip");
     587
     588        move_up_button = new DoubleImageButton("", Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif"));
    605589        move_up_button.setEnabled(false);
    606590        move_up_button.setMnemonic(KeyEvent.VK_U);
    607591        move_up_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
    608 
    609         move_down_button = new DoubleImageButton(get("CDM.Move.Move_Down"), Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif"));
     592        Gatherer.dictionary.setBoth(move_up_button, "CDM.Move.Move_Up", "CDM.Move.Move_Up_Tooltip");
     593
     594        move_down_button = new DoubleImageButton("", Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif"));
    610595        move_down_button.setEnabled(false);
    611596        move_down_button.setMnemonic(KeyEvent.VK_D);
    612597        move_down_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
    613 
    614         move_bottom_button = new DoubleImageButton(get("CDM.Move.Move_Bottom"), Utility.getImage("arrow-bottom.gif"), Utility.getImage("arrow-bottom-disabled.gif"));
     598        Gatherer.dictionary.setBoth(move_down_button, "CDM.Move.Move_Down", "CDM.Move.Move_Down_Tooltip");
     599
     600        move_bottom_button = new DoubleImageButton("", Utility.getImage("arrow-bottom.gif"), Utility.getImage("arrow-bottom-disabled.gif"));
    615601        move_bottom_button.setEnabled(false);
    616602        move_bottom_button.setMnemonic(KeyEvent.VK_B);
    617603        move_bottom_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
     604        Gatherer.dictionary.setBoth(move_bottom_button, "CDM.Move.Move_Bottom", "CDM.Move.Move_Bottom_Tooltip");
    618605
    619606        movement_pane = new JPanel();
     
    626613        plugin.setTextNonSelectionColor(Gatherer.config.getColor("coloring.workspace_tree_foreground", false));
    627614        plugin.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
    628 
    629         plugin_label = new JLabel(get("CDM.PlugInManager.PlugIn"));
     615        Gatherer.dictionary.setTooltip(plugin, "CDM.PlugInManager.PlugIn_Tooltip");
     616
     617        plugin_label = new JLabel();
     618        Gatherer.dictionary.setText(plugin_label, "CDM.PlugInManager.PlugIn", null);
     619
    630620        plugin_list = new JList(model);
    631621        plugin_list.setCellRenderer(new ListRenderer());
    632622        plugin_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    633         plugin_list_label = new JLabel(get("CDM.PlugInManager.Assigned"));
     623        plugin_list_label = new JLabel();
    634624        plugin_list_label.setHorizontalAlignment(JLabel.CENTER);
    635625        plugin_list_label.setOpaque(true);
     626        Gatherer.dictionary.setText(plugin_list_label, "CDM.PlugInManager.Assigned", null);
     627
    636628        plugin_list_pane = new JPanel();
    637629        plugin_pane = new JPanel();
    638         remove = new JButton(get("CDM.PlugInManager.Remove"));
     630
     631        remove = new JButton();
    639632        remove.setEnabled(false);
    640633        remove.setMnemonic(KeyEvent.VK_R);
    641         title = new JLabel(get("CDM.PlugInManager.Title"));
     634        Gatherer.dictionary.setBoth(remove, "CDM.PlugInManager.Remove", "CDM.PlugInManager.Remove_Tooltip");
     635
     636        title = new JLabel();
    642637        title.setHorizontalAlignment(JLabel.CENTER);
    643638        title.setOpaque(true);
     639        Gatherer.dictionary.setText(title, "CDM.PlugInManager.Title", null);
     640
    644641        // Listeners
    645642        add.addActionListener(new AddListener());
     
    653650        plugin_list.addMouseListener(new ClickListener());
    654651        plugin_list.addListSelectionListener(new ListListener());
     652
    655653        // Layout
    656654        title.setBorder(BorderFactory.createEmptyBorder(0,0,2,0));
     
    683681        plugin_pane.add(plugin);
    684682
     683        button_pane.setLayout(new GridLayout(1,3));
     684        button_pane.add(add);
     685        button_pane.add(configure);
     686        button_pane.add(remove);
     687
    685688        // Scope these mad bordering skillz.
     689        // !! TO DO: Dictionary registration !!
    686690        JPanel temp = new JPanel(new BorderLayout());
    687691        temp.setBorder
     
    689693         (BorderFactory.createEmptyBorder(5,0,5,0),
    690694          BorderFactory.createCompoundBorder
    691           (BorderFactory.createTitledBorder(get("CDM.PlugInManager.Controls")),
     695          (BorderFactory.createTitledBorder(Gatherer.dictionary.get("CDM.PlugInManager.Controls")),
    692696           BorderFactory.createEmptyBorder(2,2,2,2))));
    693697
     
    698702        central_pane.add(plugin_list_pane, BorderLayout.CENTER);
    699703        central_pane.add(temp, BorderLayout.SOUTH);
    700 
    701         button_pane.setLayout(new GridLayout(1,3));
    702         button_pane.add(add);
    703         button_pane.add(configure);
    704         button_pane.add(remove);
    705704
    706705        setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
     
    708707        add(header_pane, BorderLayout.NORTH);
    709708        add(central_pane, BorderLayout.CENTER);
    710                 //add(button_pane, BorderLayout.SOUTH);
    711     }
     709    }
     710
    712711    /** Method which acts like a destructor, tidying up references to persistant objects.
    713712     */
     
    725724
    726725    public void loseFocus() {
    727 
    728726    }
    729727
     
    770768            }
    771769            else {
    772             JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.PlugInManager.PlugIn_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     770            JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.PlugInManager.PlugIn_Exists"), Gatherer.dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    773771            }
    774772            base_plugin = null;
     
    930928     */
    931929    static private JPanel getSeparator() {
    932     // we put the separator inside a panel to control
    933     // its appearance
     930    // We put the separator inside a panel to control its appearance
    934931    JPanel _sepPanel = new JPanel();
    935932    _sepPanel.setOpaque(false);
  • trunk/gli/src/org/greenstone/gatherer/gui/BrowsingPane.java

    r5347 r5529  
    4242import java.net.*;
    4343import javax.swing.*;
     44import org.greenstone.gatherer.Dictionary;
    4445import org.greenstone.gatherer.Gatherer;
    4546import org.greenstone.gatherer.util.GURL;
     
    6970    private String args[] = null;
    7071    static final String BOOKMARKS_FILE = "bookmarks.txt";
     72
    7173    public BrowsingPane() {
    7274    super();
     
    8082    preferences.setHomeURL((new GURL(Gatherer.config.getString("general.home_page", false))).getURL());
    8183    // Creation
    82     //   Controls
     84    // Controls
    8385    JPanel button_pane = new JPanel();
    8486    JPanel left_button_pane = new JPanel();
    85     back_button = new JButton("", Utility.getImage("back.gif"));
     87
     88    back_button = new JButton(Utility.getImage("back.gif"));
    8689    back_button.setEnabled(false);
    87     back_button.setToolTipText(get("Browser.Back"));
    88     refresh_button = new JButton("", Utility.getImage("reload.gif"));
    89     refresh_button.setEnabled(false);
    90     refresh_button.setToolTipText(get("Browser.Reload"));
    91     bookmarks_button = new JButton("", Utility.getImage("bookmark.gif"));
     90    Dictionary.setTooltip(back_button, "Browser.Back");
     91
     92    // refresh_button = new JButton(Utility.getImage("reload.gif"));
     93    // refresh_button.setEnabled(false);
     94    // Dictionary.setTooltip(refresh_button, "Browser.Reload");
     95
     96    bookmarks_button = new JButton(Utility.getImage("bookmark.gif"));
    9297    bookmarks_button.setEnabled(false);
    93     bookmarks_button.setToolTipText(get("Browser.Bookmarks"));
    94     home_button = new JButton("", Utility.getImage("home.gif"));
    95     home_button.setToolTipText(get("Browser.Home"));
     98    Dictionary.setTooltip(bookmarks_button, "Browser.Bookmarks");
     99
     100    home_button = new JButton(Utility.getImage("home.gif"));
     101    Dictionary.setTooltip(home_button, "Browser.Home");
     102
    96103    JPanel address_pane = new JPanel();
    97104    address_field = new JTextField(Gatherer.config.getString("general.home_page", false));
     105    Dictionary.setTooltip(address_field, "Browser.Address_Tooltip");
     106
    98107    JPanel right_button_pane = new JPanel();
    99     go_button = new JButton("", Utility.getImage("go.gif"));
    100     go_button.setToolTipText(get("Browser.Go"));
    101     stop_button = new JButton("", Utility.getImage("stop.gif"));
     108    go_button = new JButton(Utility.getImage("go.gif"));
     109    Dictionary.setTooltip(go_button, "Browser.Go");
     110
     111    stop_button = new JButton(Utility.getImage("stop.gif"));
    102112    stop_button.setEnabled(false);
    103     stop_button.setToolTipText(get("Browser.Stop"));
    104     forward_button = new JButton("", Utility.getImage("forward.gif"));
     113    Dictionary.setTooltip(stop_button, "Browser.Stop");
     114
     115    forward_button = new JButton(Utility.getImage("forward.gif"));
    105116    forward_button.setEnabled(false);
    106     forward_button.setToolTipText(get("Browser.Forward"));
    107     //   Calpa Pane stuff
     117    Dictionary.setTooltip(forward_button, "Browser.Forward");
     118
     119    // Calpa Pane stuff
    108120    view_pane = new CalHTMLPane(preferences, observer, "VIEW_PANE");
    109     //   Status bar
    110     status_label = new JLabel(get("Browser.Ready"));
     121
     122    // Status bar
     123    status_label = new JLabel();
     124    Dictionary.setText(status_label, "Browser.Ready");
     125
    111126    // Connection
    112127    address_field.addActionListener(new AddressFieldListener());
     
    116131    go_button.addActionListener(new GoButtonListener());
    117132    home_button.addActionListener(new HomeButtonListener());
    118     refresh_button.addActionListener(new RefreshButtonListener());
     133    // refresh_button.addActionListener(new RefreshButtonListener());
    119134    stop_button.addActionListener(new StopButtonListener());
     135
    120136    // Layout
    121137    left_button_pane.setLayout(new GridLayout(1,3));
     
    144160    add(status_label, BorderLayout.SOUTH);
    145161    }
     162
    146163    /** Some actions, such as getting the HTML to render properly without throwing sixty bazillion NPE's, can only occur after the frame has been drawn to screen. To this end we have this method so we can action things -after- the frame draw.
    147164     */
     
    155172    public void collectionChanged(boolean ready) {
    156173    // Reload the bookmarks associated with this collection.
    157     if(ready) {
     174    if (ready) {
    158175        bookmarks.load();
    159176    }
     
    176193
    177194
    178     /** Retrieves a key from the Dictionary, using no extra arguments.
    179      * @param key A <strong>String</strong> which maps to a certain phrase from the Dictionary.
    180      * @return The <strong>String</strong> that matches the key or an error message if no match was found.
    181      */
    182     private String get(String key) {
    183     return get(key, null);
    184     }
    185 
    186     /** Retrieves a key from the Dictionary, providing extra arguments to be inserted using a String array.
    187      * @param key A <strong>String</strong> which maps to a certain phrase from the Dictionary.
    188      * @param args A <strong>String[]</strong> containing further arguments (such as formatting instructions and variable values) to be taken into account when Dictionary creates the return String.
    189      * @return The <strong>String</strong> that matches the key or an error message if no match was found.
    190      */
    191     private String get(String key, String args[]) {
    192     if(key.indexOf('.') == -1) {
    193         key = "Browser." + key;
    194     }
    195     return Gatherer.dictionary.get(key,args);
    196     }
    197195    /** Called to validate the status of the controls. Disables those that are no longer applicable or restores those that have come back into scope of usage.
    198196     * @param update_address <i>true</i> if this pollControls call should update the address bar, <i>false</i> otherwise.
     
    206204    implements ActionListener {
    207205    public void actionPerformed(ActionEvent event) {
    208                 // Attempt to create a GURL
     206        // Attempt to create a GURL
    209207        GURL url = new GURL(address_field.getText());
    210208        address_field.setText(url.getURL().toString());
     
    357355        args = new String[1];
    358356        args[0] = url.toString();
    359         status_label.setText(get("Browser.Follow"));
     357        Dictionary.setText(status_label, "Browser.Follow");
    360358        args = null;
    361359    }
     
    377375        args = new String[1];
    378376        args[0] = url.toString();
    379         status_label.setText(get("Browser.Loading", args));
     377        Dictionary.setText(status_label, "Browser.Loading", args);
    380378        args = null;
    381379        break;
     
    398396        stop_button.setEnabled(false);
    399397        // Rendering complete.
    400         status_label.setText(get("Browser.Ready"));
     398        Dictionary.setText(status_label, "Browser.Ready");
    401399        go_button.setEnabled(true);
    402400        stop_button.setEnabled(false);
    403         refresh_button.setEnabled(true);
     401        // refresh_button.setEnabled(true);
    404402        // Update mirror pane
    405403        Gatherer.g_man.mirror_pane.setURL(url.toString());
  • trunk/gli/src/org/greenstone/gatherer/gui/CollectionPane.java

    r5452 r5529  
    4343import javax.swing.event.*;
    4444import javax.swing.tree.*;
     45import org.greenstone.gatherer.Dictionary;
    4546import org.greenstone.gatherer.Gatherer;
    4647import org.greenstone.gatherer.file.FileNode;
     
    134135
    135136    // Create components.
    136     stop_action = new JButton(get("Collection.Stop"));
     137    stop_action = new JButton();
    137138    stop_action.addActionListener(this);
    138139    stop_action.setEnabled(false);
    139     stop_action.setToolTipText(get("Collection.Stop_Tooltip"));
    140    
     140    Dictionary.setBoth(stop_action, "Collection.Stop", "Collection.Stop_Tooltip");
     141
    141142    new_folder = new JButton(Utility.getImage("folder.gif"));
    142143    new_folder.addActionListener(this);
     
    144145    new_folder.setMinimumSize(MIN_SIZE);
    145146    new_folder.setPreferredSize(MIN_SIZE);
    146     new_folder.setToolTipText(get("Collection.New_Folder_Tooltip"));
    147     }
     147    Dictionary.setTooltip(new_folder, "Collection.New_Folder_Tooltip");
     148    }
     149
    148150    /** Any implementation of ActionListener requires this method so that when an action is performed the appropriate effect can occur. In this case there are three valid possibilities. If the action occured on the recycle bin, then delete the current selection from the collection tree. If the action instead occured on the new folder button, then create a new folder under the current (single) selection in the collection tree. And finally if the cancel button was pressed, cancel the current, and remaining, jobs on the file queue. */
    149151    public void actionPerformed(ActionEvent event) {
     
    195197        FileNode node = (FileNode) collection_tree.getModel().getRoot();
    196198        Gatherer.f_man.newFolder(collection_tree, node);
    197         //JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("FileActions.No_Parent_For_New_Folder"), Gatherer.dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
     199        //JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("FileActions.No_Parent_For_New_Folder"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    198200        }
    199201    }
     
    203205    }
    204206    /** Called whenever a significant change occurs in the current collections state, such as a new collection being loaded or the current one being closed. Several actions must occur in the GUI to indicate this change to the user, such as en/disabling the collection tree.
    205       * @param ready <i>true</i> if a collection is loaded and ready to be modified, <i>false</i> otherwise.
    206       * @see org.greenstone.gatherer.Configuration
    207       * @see org.greenstone.gatherer.Gatherer
    208       * @see org.greenstone.gatherer.collection.CollectionManager
    209       * @see org.greenstone.gatherer.gui.Coloring
    210       * @see org.greenstone.gatherer.gui.Filter
    211       * @see org.greenstone.gatherer.util.TreeSynchronizer
    212       */
     207     * @param ready <i>true</i> if a collection is loaded and ready to be modified, <i>false</i> otherwise.
     208     * @see org.greenstone.gatherer.Configuration
     209     * @see org.greenstone.gatherer.Gatherer
     210     * @see org.greenstone.gatherer.collection.CollectionManager
     211     * @see org.greenstone.gatherer.gui.Coloring
     212     * @see org.greenstone.gatherer.gui.Filter
     213     * @see org.greenstone.gatherer.util.TreeSynchronizer
     214     */
    213215    public void collectionChanged(boolean ready) {
    214216    // Try to retrieve the collections record set.
     
    217219        args = new String[1];
    218220        args[0] = Gatherer.c_man.getCollection().getName();
    219         collection_label.setText(get("Collection", args));
     221        Dictionary.setText(collection_label, "Collection.Collection", args);
    220222        collection_tree.setModel(collection);
    221223        collection_tree.repaint();
     
    224226    else {
    225227        String args[] = new String[1];
    226         args[0] = get("Collection.No_Collection");
    227         collection_label.setText(get("Collection", args));
     228        args[0] = Dictionary.newget("Collection.No_Collection");
     229        Dictionary.setText(collection_label, "Collection.Collection", args);
    228230        args = null;
    229231        collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Error")));
     
    232234    collection_tree.setEnabled(ready);
    233235    collection_filter.setEnabled(ready);
     236    Dictionary.setTooltip(collection_filter.getComboBox(), "Collection.Filter_Tooltip");
    234237
    235238    // Change the label at the top of collection tree.
     
    258261    workspace_pane.setSize(TREE_SIZE);
    259262
    260     workspace_label = new JLabel(get("Collection.Workspace"));
     263    workspace_label = new JLabel();
    261264    workspace_label.setOpaque(true);
    262265    workspace_label.setBackground(Gatherer.config.getColor("coloring.workspace_heading_background", false));
    263266    workspace_label.setForeground(Gatherer.config.getColor("coloring.workspace_heading_foreground", false));
     267    Dictionary.setText(workspace_label, "Collection.Workspace");
    264268
    265269    workspace = Gatherer.c_man.getWorkspace();
     
    289293    fcb.setBackgroundSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    290294    fcb.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     295    Dictionary.setTooltip(fcb, "Collection.Filter_Tooltip");
    291296    fcb = null;
    292297
     
    298303
    299304    args = new String[1];
    300     args[0] = get("Collection.No_Collection");
    301     collection_label = new JLabel(get("Collection", args));
     305    args[0] = Dictionary.newget("Collection.No_Collection");
     306    collection_label = new JLabel();
    302307    collection_label.setOpaque(true);
     308    Dictionary.setText(collection_label, "Collection.Collection", args);
    303309
    304310    collection = Gatherer.c_man.getRecordSet();
     
    369375    bin_button.setMinimumSize(MIN_SIZE);
    370376    bin_button.setPreferredSize(MIN_SIZE);
    371     bin_button.setToolTipText(get("Collection.Delete_Tooltip"));
     377    Dictionary.setTooltip(bin_button, "Collection.Delete_Tooltip");
    372378    group.add(bin_button);
    373379
     
    498504    }
    499505
    500     /** Retrieve a phrase from the dictionary based on the key.
    501       * @param key A <strong>String</strong> used to uniquely identify the phrase to be retrieved.
    502       */
    503     private String get(String key) {
    504     return get(key, null);
    505     }
    506     /** Retrieve a phrase from the dictionary based on the key, and filled in using text fragments from an arguments array.
    507       * @param key A <strong>String</strong> used to uniquely identify the phrase to be retrieved.
    508       * @param args A <strong>String[]</strong> used as parameters to be inserted in the phrase retrieved.
    509       * @see org.greenstone.gatherer.Dictionary
    510       * @see org.greenstone.gatherer.Gatherer
    511       */
    512     private String get(String key, String args[]) {
    513     if(key.indexOf('.') == -1) {
    514         key = "Collection." + key;
    515     }
    516     return Gatherer.dictionary.get(key, args);
    517     }
     506
    518507    /** Used to set the enabled state, and hence the colouring, of the two tree labels.
    519508      * @param label The <strong>JLabel</strong> to be affected.
     
    563552        // Set Options based on selection and tree
    564553        if(tree.getSelectionCount() != 0 && tree == collection_tree) {
    565             show_metaaudit = new JMenuItem(get("Menu.Metadata_View") + " " + collection_tree.getSelectionDetails(), KeyEvent.VK_V);
     554            String[] args = new String[1];
     555            args[0] = collection_tree.getSelectionDetails();
     556            show_metaaudit = new JMenuItem(Dictionary.newget("Menu.Metadata_View", args), KeyEvent.VK_V);
    566557            show_metaaudit.addActionListener(this);
    567558            add(show_metaaudit);
    568559        }
    569560        if(tree == collection_tree && node != null && node.getFile() != null && node.getFile().isDirectory() && !node.isReadOnly()) {
    570             new_folder = new JMenuItem(get("CollectionPopupMenu.New_Folder"), KeyEvent.VK_N);
     561            new_folder = new JMenuItem(Dictionary.newget("CollectionPopupMenu.New_Folder"), KeyEvent.VK_N);
    571562            new_folder.addActionListener(this);
    572563            add(new_folder);
     
    574565        }
    575566        if(node == null || (node != null && !node.isReadOnly())) {
    576             delete = new JMenuItem(get("CollectionPopupMenu.Delete"), KeyEvent.VK_D);
     567            delete = new JMenuItem(Dictionary.newget("CollectionPopupMenu.Delete"), KeyEvent.VK_D);
    577568            delete.addActionListener(this);
    578569            add(delete);
     
    581572            String node_name = node.toString();
    582573            FileNode root = (FileNode) tree.getModel().getRoot();
    583             if(!node_name.equals(get("Tree.World")) && !node_name.equals(get("Tree.Root")) && !node_name.equals(get("Tree.Public")) && !node_name.equals(get("Tree.Private"))) {
     574            if(!node_name.equals(Dictionary.newget("Tree.World")) && !node_name.equals(Dictionary.newget("Tree.Root")) && !node_name.equals(Dictionary.newget("Tree.Public")) && !node_name.equals(Dictionary.newget("Tree.Private"))) {
    584575            // You can unmap 1st level nodes.
    585576            if(root.getIndex(node) != -1) {
    586                 unmap = new JMenuItem(get("MappingPrompt.Unmap"), KeyEvent.VK_U);
     577                unmap = new JMenuItem(Dictionary.newget("MappingPrompt.Unmap"), KeyEvent.VK_U);
    587578                unmap.addActionListener(this);
    588579                add(unmap);
     
    590581            // Or map any other level directories.
    591582            else {
    592                 map = new JMenuItem(get("MappingPrompt.Map"), KeyEvent.VK_M);
     583                map = new JMenuItem(Dictionary.newget("MappingPrompt.Map"), KeyEvent.VK_M);
    593584                map.addActionListener(this);
    594585                add(map);
     
    639630        }
    640631    }
    641     /** Retrieve a phrase from the dictionary based on the key.
    642             * @param key A <strong>String</strong> used to uniquely identify the phrase to be retrieved.
    643             */
    644     private String get(String key) {
    645         return get(key, null);
    646     }
    647     /** Retrieve a phrase from the dictionary based on the key, and filled in using text fragments from an arguments array.
    648             * @param key A <strong>String</strong> used to uniquely identify the phrase to be retrieved.
    649             * @param args A <strong>String[]</strong> used as parameters to be inserted in the phrase retrieved.
    650             * @see org.greenstone.gatherer.Dictionary
    651             * @see org.greenstone.gatherer.Gatherer
    652             */
    653     private String get(String key, String args[]) {
    654         if(key.indexOf('.') == -1) {
    655         key = "CollectionPopupMenu." + key;
    656         }
    657         return Gatherer.dictionary.get(key, args);
    658     }
    659     }
     632    }
     633
    660634    /** This class listens for certain key presses, such as [Enter] or [Delete], and responds appropriately. */
    661635    private class KeyListenerImpl
     
    715689        setModal(true);
    716690        setSize(DIALOG_SIZE);
    717         setTitle(get("MappingPrompt.Title"));
    718                 // Creation
     691        Dictionary.setText(this, "MappingPrompt.Title");
     692
     693        // Creation
    719694        JPanel content_pane = (JPanel) getContentPane();
    720695        JPanel center_pane = new JPanel();
    721696        JPanel file_pane = new JPanel();
    722         JLabel file_label = new JLabel(get("MappingPrompt.File"));
     697        JLabel file_label = new JLabel();
    723698        file_label.setPreferredSize(LABEL_SIZE);
     699        Dictionary.setText(file_label, "MappingPrompt.File");
    724700        JLabel file_field = new JLabel(file.getAbsolutePath());
    725701        JPanel name_pane = new JPanel();
    726         JLabel name_label = new JLabel(get("MappingPrompt.Name"));
     702        JLabel name_label = new JLabel();
    727703        name_label.setPreferredSize(LABEL_SIZE);
     704        Dictionary.setText(name_label, "MappingPrompt.Name");
    728705        name_field = new JTextField(file.getName());
    729706        JPanel button_pane = new JPanel();
    730         ok_button = new JButton(get("General.OK"));
     707        ok_button = new JButton();
    731708        ok_button.setEnabled(name_field.getText().length() > 0);
    732         cancel_button = new JButton(get("General.Cancel"));
    733                 // Connection
     709        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     710        cancel_button = new JButton();
     711        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Cancel_Tooltip");
     712
     713        // Connection
    734714        cancel_button.addActionListener(this);
    735715        ok_button.addActionListener(this);
    736716        name_field.addKeyListener(this);
    737                 // Layout
     717        // Layout
    738718        file_pane.setLayout(new BorderLayout());
    739719        file_pane.add(file_label, BorderLayout.WEST);
     
    757737        content_pane.add(center_pane, BorderLayout.CENTER);
    758738        content_pane.add(button_pane, BorderLayout.SOUTH);
    759                 // Display
     739        // Display
    760740        Dimension screen_size = Gatherer.config.screen_size;
    761741        setLocation((screen_size.width - DIALOG_SIZE.width) / 2, (screen_size.height - DIALOG_SIZE.height) / 2);
    762742        show();
    763                 // If not cancelled create mapping.
     743        // If not cancelled create mapping.
    764744        if(!cancelled) {
    765745        Gatherer.c_man.addDirectoryMapping(name_field.getText(), file);
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r5527 r5529  
    7575import org.greenstone.gatherer.msm.ElementWrapper;
    7676import org.greenstone.gatherer.msm.Metadata;
    77 import org.greenstone.gatherer.sarm.SearchAndReplace;
     77// import org.greenstone.gatherer.sarm.SearchAndReplace;
    7878import org.greenstone.gatherer.shell.GShell;
    7979import org.greenstone.gatherer.util.TreeSynchronizer;
     
    124124    private JTabbedPane tab_pane = null;
    125125    /** A reference to any existing search and replace module/dialog. */
    126     private SearchAndReplace sar = null;
     126    // private SearchAndReplace sar = null;
    127127    /** A threaded tab changer to try and avoid NPE on exit. */
    128128    private TabUpdater tab_updater = null;
     
    251251        }
    252252    }
    253     else if(esrc == menu_bar.edit_search) {
    254         if(sar != null) {
    255         sar.dispose();
    256         }
    257         sar = new SearchAndReplace(false);
    258     }
    259     else if(esrc == menu_bar.edit_replace) {
    260         if(sar != null) {
    261         sar.dispose();
    262         }
    263         sar = new SearchAndReplace(true);
    264     }
     253//      else if(esrc == menu_bar.edit_search) {
     254//          if(sar != null) {
     255//          sar.dispose();
     256//          }
     257//          sar = new SearchAndReplace(false);
     258//      }
     259//      else if(esrc == menu_bar.edit_replace) {
     260//          if(sar != null) {
     261//          sar.dispose();
     262//          }
     263//          sar = new SearchAndReplace(true);
     264//      }
    265265    // *************
    266266    // Tools Options.
  • trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java

    r5527 r5529  
    4545import javax.swing.table.*;
    4646import javax.swing.tree.*;
     47import org.greenstone.gatherer.Dictionary;
    4748import org.greenstone.gatherer.Gatherer;
    4849import org.greenstone.gatherer.file.FileNode;
     
    138139    this.tree_sync = tree_sync;
    139140
    140     add = new JButton("MetaEdit.Accumulate");
     141    add = new JButton();
    141142    add.addActionListener(this);
    142143    add.setEnabled(false);
    143144    add.setMnemonic(KeyEvent.VK_A);
    144145    add.setPreferredSize(BUTTON_SIZE);
    145 
    146     update = new JButton("MetaEdit.Overwrite");
     146    Dictionary.setBoth(add, "MetaEdit.Accumulate", "MetaEdit.Accumulate_Tooltip");
     147
     148    update = new JButton();
    147149    update.addActionListener(this);
    148150    update.setEnabled(false);
    149151    update.setMnemonic(KeyEvent.VK_P);
    150152    update.setPreferredSize(BUTTON_SIZE);
    151 
    152     remove = new JButton("MetaEdit.Remove");
     153    Dictionary.setBoth(update, "MetaEdit.Overwrite", "MetaEdit.Overwrite_Tooltip");
     154
     155    remove = new JButton();
    153156    remove.addActionListener(this);
    154157    remove.setEnabled(false);
    155158    remove.setMnemonic(KeyEvent.VK_R);
    156159    remove.setPreferredSize(BUTTON_SIZE);
    157 
    158     expand = new JButton("MetaEdit.Expand");
     160    Dictionary.setBoth(remove, "MetaEdit.Remove", "MetaEdit.Remove_Tooltip");
     161
     162    expand = new JButton();
    159163    expand.addActionListener(this);
    160164    expand.setEnabled(true);
    161165    expand.setMnemonic(KeyEvent.VK_E);
    162166    expand.setPreferredSize(new Dimension(25, 25));
     167    Dictionary.setBoth(expand, "MetaEdit.Expand", "MetaEdit.Expand_Tooltip");
    163168
    164169    tree = new GValueTree(CONTROL_SIZE.width, CONTROL_SIZE.height);
    165 
    166     // Dictionary registration
    167     Gatherer.dictionary.register(add, null, false);
    168     Gatherer.dictionary.register(update, null, false);
    169     Gatherer.dictionary.register(remove, null, false);
    170     Gatherer.dictionary.register(expand, null, false);
    171170    }
    172171
     
    302301        String[] args = new String[1];
    303302        args[0] = Gatherer.c_man.getCollection().getName();
    304         collection_label.setText(get("Collection.Collection", args));
     303        Dictionary.setText(collection_label, "Collection.Collection", args);
    305304        // Update label coloring.
    306305        collection_label.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false));
     
    321320    }
    322321    else {
    323         collection_label.setText(get("Collection.No_Collection"));
     322        Dictionary.setText(collection_label, "Collection.No_Collection");
    324323        collection_label.setBackground(Color.lightGray);
    325324        collection_label.setForeground(Color.black);
    326         collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode(get("Collection.No_Collection"))));
     325        collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode(Dictionary.newget("Collection.No_Collection"))));
    327326    }
    328327
     
    353352
    354353    ///atherer.println("\tCreating collection_label");
    355     collection_label = new JLabel(get("Collection.Collection"));
     354    collection_label = new JLabel();
     355    Dictionary.setText(collection_label, "Collection.Collection");
    356356    collection_label.setOpaque(true);
    357 
    358357
    359358    DragGroup group = new DragGroup();
     
    385384    fcb.setBackgroundSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    386385    fcb.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     386    Dictionary.setTooltip(fcb, "Collection.Filter_Tooltip");
    387387    fcb = null;
    388388
     
    416416    JPanel table_title_pane = new JPanel();
    417417
    418     table_label = new JTextField("MetaEdit.No_File");
     418    table_label = new JTextField();
    419419    table_label.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    420420    table_label.setEditable(false);
     421    Dictionary.setText(table_label, "MetaEdit.No_File");
    421422
    422423    card_layout = new CardLayout();
     
    430431    table_pane_two.setOpaque(false);
    431432
    432     JLabel no_file_message = new JLabel("MetaEdit.No_File");
     433    JLabel no_file_message = new JLabel();
    433434    no_file_message.setHorizontalAlignment(JLabel.CENTER);
    434435    no_file_message.setOpaque(false);
    435436    no_file_message.setVerticalAlignment(JLabel.CENTER);
    436 
    437     JLabel no_metadata_message = new JLabel("MetaEdit.No_Metadata");
     437    Dictionary.setText(no_file_message, "MetaEdit.No_File");
     438
     439    JLabel no_metadata_message = new JLabel();
    438440    no_metadata_message.setHorizontalAlignment(JLabel.CENTER);
    439441    no_metadata_message.setOpaque(false);
    440442    no_metadata_message.setVerticalAlignment(JLabel.CENTER);
     443    Dictionary.setText(no_metadata_message, "MetaEdit.No_Metadata");
    441444
    442445    JPanel table_pane_one = new JPanel();
     
    483486    JPanel tools_off_pane = new JPanel();
    484487
    485     JLabel tools_off_label = new JLabel("MetaEdit.No_Metadata_Element");
     488    JLabel tools_off_label = new JLabel();
    486489    tools_off_label.setHorizontalAlignment(JLabel.CENTER);
    487490    tools_off_label.setOpaque(false);
    488491    tools_off_label.setVerticalAlignment(JLabel.CENTER);
     492    Dictionary.setText(tools_off_label, "MetaEdit.No_Metadata_Element");
    489493
    490494    JPanel tools_on_pane = new JPanel();
     
    538542    this.setLayout(new BorderLayout());
    539543    this.add(external_split, BorderLayout.CENTER);
    540 
    541     // Dictionary registration
    542     Gatherer.dictionary.register(table_label, null, false);
    543     Gatherer.dictionary.register(no_file_message, null, false);
    544     Gatherer.dictionary.register(no_metadata_message, null, false);
    545     Gatherer.dictionary.register(tools_off_label, null, false);
    546544    }
    547545
     
    742740    else {
    743741        records = null;
    744         table_label.setText(get("MetaEdit.No_File"));
     742        Dictionary.setText(table_label, "MetaEdit.No_File");
     743
    745744        // Remove old model from msm
    746745        if(Gatherer.c_man.ready()) {
     
    771770    table.doLayout();
    772771    validateControls();
    773     }
    774 
    775 
    776     /** Retrieve a phrase from the Dictionary based on the given key.
    777      * @param key The <strong>String</strong> which maps to the phrase to retrieve.
    778      * @return The desired phrase as a <strong>String</strong>, or possibly an error message if no such phrase exists.
    779      */
    780     private String get(String key) {
    781     return get(key, null);
    782     }
    783     /** Retrieve a phrase from the Dictionary based on the given key and filled in with the given arguments.
    784      * @param key The <strong>String</strong> which maps to the phrase to retrieve.
    785      * @param args A <strong>String[]</strong> of arguments to be inserted in the phrase.
    786      * @return The desired phrase as a <strong>String</strong>, or possibly an error message if no such phrase exists.
    787      * @see org.greenstone.gatherer.Dictionary
    788      * @see org.greenstone.gatherer.Gatherer
    789      */
    790     private String get(String key, String args[]) {
    791     if(key.indexOf('.') == -1) {
    792         key = "MetaEdit." + key;
    793     }
    794     return Gatherer.dictionary.get(key,args);
    795772    }
    796773
     
    950927        super();
    951928        // Creation
    952         JMenuItem show_metaaudit = new JMenuItem(get("Menu.Metadata_View") + " " + collection_tree.getSelectionDetails(), KeyEvent.VK_V);
     929        String[] args = new String[1];
     930        args[0] = collection_tree.getSelectionDetails();
     931        JMenuItem show_metaaudit = new JMenuItem(Dictionary.newget("Menu.Metadata_View", args), KeyEvent.VK_V);
    953932        show_metaaudit.addActionListener(this);
    954933        add(show_metaaudit);
     
    10961075        this.add(extracted_pane, NONE);
    10971076        card_showing = TREE;
    1098 
    1099         // Dictionary registration
    1100         Gatherer.dictionary.register(value_label, null, false);
    1101         Gatherer.dictionary.register(value, null, false);
    1102         Gatherer.dictionary.register(tree_label, null, false);
    11031077    }
    11041078
     
    11541128        String[] args = new String[1];
    11551129        args[0] = selected_metadata_element.toString();
    1156         extracted_message.setText(get("MetaEdit.AutoMessage", args));
     1130        Dictionary.setText(extracted_message, "MetaEdit.AutoMessage", args);
    11571131        card_layout.show(this, NONE);
    11581132        card_showing = NONE;
     
    11891163        manual_text_edit_event = true;
    11901164        }
    1191     }
    1192 
    1193 
    1194     private String get(String key, String args[]) {
    1195         return Gatherer.dictionary.get(key, args);
    11961165    }
    11971166
  • trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPrompt.java

    r5527 r5529  
    5252    private JButton update;
    5353    private JButton update_all;
     54
    5455    static private Dimension LABEL_SIZE = new Dimension(100, 25);
    5556    static private Dimension SIZE = new Dimension(712, 250);
     
    117118    JPanel buttons_pane = new JPanel();
    118119
    119     accumulate = new JButton("MetaEditPrompt.Accumulate");
     120    accumulate = new JButton("MetaEdit.Accumulate");
    120121    accumulate.setEnabled(type == ADD_PROMPT);
    121122    accumulate.setMnemonic(KeyEvent.VK_A);
     
    125126    accumulate_all.setMnemonic(KeyEvent.VK_L);
    126127
    127     overwrite = new JButton("MetaEditPrompt.Overwrite");
     128    overwrite = new JButton("MetaEdit.Overwrite");
    128129    overwrite.setEnabled(type == UPDATE_PROMPT);
    129130    overwrite.setMnemonic(KeyEvent.VK_R);
     
    133134    overwrite_all.setMnemonic(KeyEvent.VK_P);
    134135
    135     remove = new JButton("MetaEditPrompt.Remove");
     136    remove = new JButton("MetaEdit.Remove");
    136137    remove.setEnabled(type == REMOVE_PROMPT);
    137138    remove.setMnemonic(KeyEvent.VK_R);
     
    145146    skip.setMnemonic(KeyEvent.VK_S);
    146147
    147     cancel = new JButton("MetaEditPrompt.Cancel");
     148    cancel = new JButton("General.Cancel");
    148149    cancel.setMnemonic(KeyEvent.VK_C);
    149150
     
    185186
    186187    buttons_pane.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
    187     buttons_pane.setLayout(new GridLayout(2,4,0,0));
    188     buttons_pane.add(accumulate);
    189     buttons_pane.add(overwrite);
    190     buttons_pane.add(remove);
    191     buttons_pane.add(skip);
    192     buttons_pane.add(accumulate_all);
    193     buttons_pane.add(overwrite_all);
    194     buttons_pane.add(remove_all);
    195     buttons_pane.add(cancel);
     188    buttons_pane.setLayout(new GridLayout(1,4,0,0));
     189
     190    if (type.equals(ADD_PROMPT)) {
     191        buttons_pane.add(accumulate);
     192        buttons_pane.add(accumulate_all);
     193    }
     194    else if (type.equals(UPDATE_PROMPT)) {
     195        buttons_pane.add(overwrite);
     196        buttons_pane.add(overwrite_all);
     197    }
     198    else if (type.equals(REMOVE_PROMPT)) {
     199        buttons_pane.add(remove);
     200        buttons_pane.add(remove_all);
     201    }
     202    buttons_pane.add(skip);
     203    buttons_pane.add(cancel);
    196204
    197205    content_pane.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
  • trunk/gli/src/org/greenstone/gatherer/gui/MirrorPane.java

    r5329 r5529  
    4343import javax.swing.event.*;
    4444import javax.swing.tree.*;
     45import org.greenstone.gatherer.Dictionary;
    4546import org.greenstone.gatherer.Gatherer;
    46 import org.greenstone.gatherer.Message;
    4747import org.greenstone.gatherer.WGet;
    48 import org.greenstone.gatherer.file.FileSystemModel;
    49 import org.greenstone.gatherer.gui.Filter;
    50 import org.greenstone.gatherer.gui.GComboBox;
    51 import org.greenstone.gatherer.gui.tree.DragTree;
    52 import org.greenstone.gatherer.util.DragGroup;
    53 import org.greenstone.gatherer.util.GURL;
    54 import org.greenstone.gatherer.util.TreeSynchronizer;
    5548import org.greenstone.gatherer.util.Utility;
    5649/**
     
    7265    private JTextField url_textfield = null;
    7366    private WGet getter = null;
     67
    7468    public MirrorPane() {
    7569    super();
     
    8579
    8680    JPanel url_pane = new JPanel();
    87     JLabel url_label = new JLabel(Gatherer.dictionary.get("Mirroring.Source_URL"));
     81    JLabel url_label = new JLabel();
    8882    url_label.setPreferredSize(Utility.LABEL_SIZE);
     83    Dictionary.setText(url_label, "Mirroring.Source_URL");
    8984    url_textfield = new JTextField();
     85    Dictionary.setTooltip(url_textfield, "Mirroring.Source_URL_Tooltip");
    9086
    9187    JPanel depth_pane = new JPanel();
    92     JLabel depth_label = new JLabel(Gatherer.dictionary.get("Mirroring.Download_Depth"));
     88    JLabel depth_label = new JLabel();
     89    Dictionary.setText(depth_label, "Mirroring.Download_Depth");
    9390    depth_spinner = new JSpinner();
     91    Dictionary.setTooltip(depth_spinner, "Mirroring.Download_Depth_Tooltip");
    9492
    9593    JPanel destination_pane = new JPanel();
    96     JLabel destination_label = new JLabel(Gatherer.dictionary.get("Mirroring.Destination_Folder"));
     94    JLabel destination_label = new JLabel();
     95    Dictionary.setText(destination_label, "Mirroring.Destination_Folder");
    9796    ButtonGroup group = new ButtonGroup();
    98     public_radiobutton = new JRadioButton(Gatherer.dictionary.get("Tree.Public"));
    99     private_radiobutton = new JRadioButton(Gatherer.dictionary.get("Tree.Private"));
     97    public_radiobutton = new JRadioButton();
     98    public_radiobutton.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     99    public_radiobutton.setOpaque(false);
     100    Dictionary.setText(public_radiobutton, "Tree.Public");
     101    private_radiobutton = new JRadioButton();
     102    private_radiobutton.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     103    private_radiobutton.setOpaque(false);
     104    Dictionary.setText(private_radiobutton, "Tree.Private");
    100105    group.add(public_radiobutton);
    101106    group.add(private_radiobutton);
     
    103108
    104109    JPanel first_pane = new JPanel();
    105     automatic_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Download_Hidden"));
    106     overwrite_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Overwrite_Existing"));
     110    automatic_checkbox = new JCheckBox();
     111    Dictionary.setText(automatic_checkbox, "Mirroring.Download_Hidden");
     112    overwrite_checkbox = new JCheckBox();
     113    Dictionary.setText(overwrite_checkbox, "Mirroring.Overwrite_Existing");
    107114
    108115    JPanel second_pane = new JPanel();
    109     higher_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Higher_Directories"));
    110     same_host_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Same_Host"));
    111 
    112     remove_failed_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Remove_Failed"));
    113     JLabel further_label = new JLabel(Gatherer.dictionary.get("Mirroring.Further_Options"));
    114    
     116    higher_checkbox = new JCheckBox();
     117    Dictionary.setText(higher_checkbox, "Mirroring.Higher_Directories");
     118    same_host_checkbox = new JCheckBox();
     119    Dictionary.setText(same_host_checkbox, "Mirroring.Same_Host");
     120
     121    remove_failed_checkbox = new JCheckBox();
     122    Dictionary.setText(remove_failed_checkbox, "Mirroring.Remove_Failed");
     123
     124    JLabel further_label = new JLabel();
     125    Dictionary.setText(further_label, "Mirroring.Further_Options");
     126
    115127    JPanel button_pane = new JPanel();
    116     download_button = new JButton(Gatherer.dictionary.get("Mirroring.Download"));
     128    download_button = new JButton();
     129    Dictionary.setBoth(download_button, "Mirroring.Download", "Mirroring.Download_Tooltip");
    117130
    118131    // Connect
     
    156169    button_pane.add(download_button);
    157170
    158     edit_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(2,0,0,0), BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Gatherer.dictionary.get("Mirroring.Download_Controls")), BorderFactory.createEmptyBorder(2,2,2,2))));
     171    edit_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(2,0,0,0), BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("Mirroring.Download_Controls")), BorderFactory.createEmptyBorder(2,2,2,2))));
    159172    edit_pane.setLayout(new BorderLayout());
    160173    edit_pane.add(details_pane, BorderLayout.CENTER);
     
    182195
    183196    public void actionPerformed(ActionEvent event) {
    184         // Retrieve the current url and confirm its valid
     197        // Retrieve the current url and confirm it is valid
    185198        String url_str = url_textfield.getText();
    186199        URL url = null;
     
    189202        }
    190203        catch(MalformedURLException error) {
    191         JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("Mirroring.Invalid_URL"), Gatherer.dictionary.get("Mirroring.Invalid_URL__Title"), JOptionPane.ERROR_MESSAGE);
     204        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("Mirroring.Invalid_URL"), Dictionary.newget("Mirroring.Invalid_URL__Title"), JOptionPane.ERROR_MESSAGE);
    192205        }
    193206        if(url != null) {
Note: See TracChangeset for help on using the changeset viewer.