Changeset 6318


Ignore:
Timestamp:
2003-12-19T14:45:12+13:00 (20 years ago)
Author:
jmt12
Message:

Changed JButtons for GLIButtons, which know whether they should paint their background depending on what platform they are run on, and finished keyboard shortcuts

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

Legend:

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

    r5593 r6318  
    4141import java.net.*;
    4242import javax.swing.*;
     43import org.greenstone.gatherer.gui.GLIButton;
    4344
    4445/** Provides a graphic authenticator for network password requests.
     
    8990    Dictionary.setTooltip(password, "GAuthenticator.Password_Tooltip");
    9091    JPanel button_panel = new JPanel();
    91     ok_button = new JButton();
     92    ok_button = new GLIButton();
     93    ok_button.setMnemonic(KeyEvent.VK_O);
    9294    Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    93     cancel_button = new JButton();
     95    cancel_button = new GLIButton();
     96    cancel_button.setMnemonic(KeyEvent.VK_C);
    9497    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Cancel_Tooltip");
    9598
  • trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java

    r6087 r6318  
    5252import org.greenstone.gatherer.gui.DoubleImageButton;
    5353import org.greenstone.gatherer.gui.GComboBox;
     54import org.greenstone.gatherer.gui.GLIButton;
    5455import org.greenstone.gatherer.msm.MSMEvent;
    5556import org.greenstone.gatherer.msm.MSMListener;
     
    571572        Collections.sort(library);
    572573        // Create
    573         add = new JButton();
     574        add = new GLIButton();
     575        add.setMnemonic(KeyEvent.VK_A);
    574576        Dictionary.registerBoth(add, "CDM.ClassifierManager.Add", "CDM.ClassifierManager.Add_Tooltip");
    575577        JPanel button_pane = new JPanel();
    576578        JPanel central_pane = new JPanel();
    577         configure = new JButton();
     579        configure = new GLIButton();
    578580        configure.setEnabled(false);
     581        configure.setMnemonic(KeyEvent.VK_C);
    579582        Dictionary.registerBoth(configure, "CDM.ClassifierManager.Configure", "CDM.ClassifierManager.Configure_Tooltip");
    580583        JPanel header_pane = new JPanel();
     
    608611        JPanel classifier_list_pane = new JPanel();
    609612        JPanel classifier_pane = new JPanel();
    610         remove = new JButton();
     613        remove = new GLIButton();
    611614        remove.setEnabled(false);
     615        remove.setMnemonic(KeyEvent.VK_R);
    612616        Dictionary.registerBoth(remove, "CDM.ClassifierManager.Remove", "CDM.ClassifierManager.Remove_Tooltip");
    613617
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java

    r6051 r6318  
    3434import org.greenstone.gatherer.Gatherer;
    3535import org.greenstone.gatherer.cdm.CommandTokenizer;
     36import org.greenstone.gatherer.gui.GLIButton;
    3637import org.greenstone.gatherer.msm.MSMUtils;
    3738import org.greenstone.gatherer.util.DOMTree;
     
    337338    JPanel content_pane = (JPanel) dialog.getContentPane();
    338339    final DOMTree tree = new DOMTree(document);
    339     JButton refresh_button = new JButton("Refresh Tree");
     340    JButton refresh_button = new GLIButton("Refresh Tree");
     341    refresh_button.setMnemonic(KeyEvent.VK_R);
    340342    refresh_button.addActionListener(new ActionListener() {
    341343        public void actionPerformed(ActionEvent event) {
     
    12281230    Element command_element = null;
    12291231    boolean use_metadata_files = false;
    1230     boolean show_progress = false;
    12311232    try {
    12321233        CommandTokenizer tokenizer = new CommandTokenizer(command_str);
     
    12501251            use_metadata_files = true;
    12511252            }
    1252             else if(name.substring(1).equals(SHOW_PROGRESS_ARGUMENT)) {
    1253                show_progress = true;
    1254             }
    12551253            option_element.setAttribute(NAME_ATTRIBUTE, name.substring(1));
    12561254            option_element.setAttribute(ASSIGNED_ATTRIBUTE, TRUE_STR);
     
    12771275        // We must have some RecPlug options: use_metadata_files, and show_progress
    12781276        if (type.equals(RECPLUG_STR)) {
    1279             if (!use_metadata_files) {
     1277            if (!use_metadata_files) {
    12801278            Element option_element = document.createElement(OPTION_ELEMENT);
    12811279            option_element.setAttribute(NAME_ATTRIBUTE, USE_METADATA_FILES_ARGUMENT);
     
    12841282            command_element.appendChild(option_element);
    12851283            option_element = null;
    1286             }
    1287             if(!show_progress) {
    1288                Element option_element = document.createElement(OPTION_ELEMENT);
    1289                option_element.setAttribute(NAME_ATTRIBUTE, SHOW_PROGRESS_ARGUMENT);
    1290                option_element.setAttribute(ASSIGNED_ATTRIBUTE, TRUE_STR);
    1291                option_element.setAttribute(CUSTOM_ATTRIBUTE, TRUE_STR);
    1292                command_element.appendChild(option_element);
    1293                option_element = null;
    1294             }
     1284            }
    12951285        }
    12961286        type = null;
  • trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r5755 r6318  
    4747import org.greenstone.gatherer.cdm.DOMProxyListModel;
    4848import org.greenstone.gatherer.cdm.Format;
     49import org.greenstone.gatherer.gui.GLIButton;
    4950import org.greenstone.gatherer.msm.ElementWrapper;
    5051import org.greenstone.gatherer.util.StaticStrings;
     
    305306        Dictionary.registerText(editor_label, "CDM.FormatManager.Editor");
    306307
    307         //default_button = new JButton();
     308        //default_button = new GLIButton();
    308309        //default_button.setEnabled(false);
    309310        //default_button.setMnemonic(KeyEvent.VK_D);
     
    324325        Dictionary.registerTooltip(variable_combobox, "CDM.FormatManager.Variable_Tooltip");
    325326
    326         insert_button = new JButton();
     327        insert_button = new GLIButton();
    327328        insert_button.setMnemonic(KeyEvent.VK_I);
    328329        Dictionary.registerBoth(insert_button, "CDM.FormatManager.Insert", "CDM.FormatManager.Insert_Tooltip");
     
    333334
    334335        JPanel button_pane = new JPanel();
    335         add_button = new JButton();
     336        add_button = new GLIButton();
    336337        add_button.setEnabled(false);
    337338        add_button.setMnemonic(KeyEvent.VK_A);
    338339        Dictionary.registerBoth(add_button, "CDM.FormatManager.Add", "CDM.FormatManager.Add_Tooltip");
    339         replace_button = new JButton();
     340        replace_button = new GLIButton();
    340341        replace_button.setEnabled(false);
    341342        replace_button.setMnemonic(KeyEvent.VK_C);
    342343        Dictionary.registerBoth(replace_button, "CDM.FormatManager.Replace", "CDM.FormatManager.Replace_Tooltip");
    343         remove_button = new JButton();
     344        remove_button = new GLIButton();
    344345        remove_button.setEnabled(false);
    345346        remove_button.setMnemonic(KeyEvent.VK_R);
  • trunk/gli/src/org/greenstone/gatherer/cdm/IndexManager.java

    r6051 r6318  
    4242import org.greenstone.gatherer.gui.DoubleImageButton;
    4343import org.greenstone.gatherer.gui.GComboBox;
     44import org.greenstone.gatherer.gui.GLIButton;
    4445import org.greenstone.gatherer.msm.ElementWrapper;
    4546import org.greenstone.gatherer.msm.MSMUtils;
     
    596597
    597598        JPanel button_pane = new JPanel();
    598         add_button = new JButton();
     599        add_button = new GLIButton();
    599600        add_button.setEnabled(false);
    600601        add_button.setMnemonic(KeyEvent.VK_A);
    601602        Dictionary.registerBoth(add_button, "CDM.IndexManager.Add_Index", "CDM.IndexManager.Add_Index_Tooltip");
    602         set_default_button = new JButton();
     603        set_default_button = new GLIButton();
    603604        set_default_button.setEnabled(false);
    604605        set_default_button.setMnemonic(KeyEvent.VK_S);
    605606        Dictionary.registerBoth(set_default_button, "CDM.IndexManager.Set_Default", "CDM.IndexManager.Set_Default_Tooltip");
    606         remove_button = new JButton();
     607        remove_button = new GLIButton();
    607608        remove_button.setEnabled(false);
    608609        remove_button.setMnemonic(KeyEvent.VK_R);
     
    981982        JPanel index_button_panel = new JPanel();
    982983
    983         add_index_button = new JButton();
     984        add_index_button = new GLIButton();
    984985        add_index_button.setEnabled(false);
    985986        add_index_button.setMnemonic(KeyEvent.VK_A);
    986987        Dictionary.registerBoth(add_index_button, "CDM.IndexManager.Add_Index", "CDM.IndexManager.Add_Index_Tooltip");
    987988
    988         add_all_button = new JButton();
     989        add_all_button = new GLIButton();
    989990        add_all_button.setEnabled(true);
    990991        add_all_button.setMnemonic(KeyEvent.VK_L);
    991992        Dictionary.registerBoth(add_all_button, "CDM.IndexManager.MGPP.Add_All_Metadata", "CDM.IndexManager.MGPP.Add_All_Metadata_Tooltip");
    992993
    993         replace_button = new JButton();
     994        replace_button = new GLIButton();
    994995        replace_button.setEnabled(false);
    995996        replace_button.setMnemonic(KeyEvent.VK_C);
    996997        Dictionary.registerBoth(replace_button, "CDM.IndexManager.MGPP.Replace_Index", "CDM.IndexManager.MGPP.Replace_Index_Tooltip");
    997998
    998         remove_index_button = new JButton();
     999        remove_index_button = new GLIButton();
    9991000        remove_index_button.setEnabled(false);
    10001001        remove_index_button.setMnemonic(KeyEvent.VK_A);
     
    11151116        JPanel level_button_panel = new JPanel();
    11161117
    1117         add_level_button = new JButton("CDM.IndexManager.MGPP.Add_Level");
     1118        add_level_button = new GLIButton("CDM.IndexManager.MGPP.Add_Level");
    11181119        add_level_button.setEnabled(false);
    11191120        add_level_button.setMnemonic(KeyEvent.VK_A);
    11201121        Dictionary.registerBoth(add_level_button, "CDM.IndexManager.MGPP.Add_Level", "CDM.IndexManager.MGPP.Add_Level_Tooltip");
    11211122
    1122         remove_level_button = new JButton("CDM.IndexManager.MGPP.Remove_Level");
     1123        remove_level_button = new GLIButton("CDM.IndexManager.MGPP.Remove_Level");
    11231124        remove_level_button.setEnabled(false);
    11241125        remove_level_button.setMnemonic(KeyEvent.VK_A);
  • trunk/gli/src/org/greenstone/gatherer/cdm/LanguageManager.java

    r5902 r6318  
    4646import org.greenstone.gatherer.cdm.Language;
    4747import org.greenstone.gatherer.cdm.LanguageListCellRenderer;
     48import org.greenstone.gatherer.gui.GLIButton;
    4849import org.w3c.dom.*;
    4950
     
    294295        JPanel button_panel = new JPanel();
    295296
    296         add_button = new JButton();
     297        add_button = new GLIButton();
    297298        add_button.setMnemonic(KeyEvent.VK_A);
    298299        Dictionary.registerBoth(add_button, "CDM.LanguageManager.Add", "CDM.LanguageManager.Add_Tooltip");
    299300
    300         remove_button = new JButton();
     301        remove_button = new GLIButton();
    301302        remove_button.setMnemonic(KeyEvent.VK_R);
    302303        remove_button.setEnabled(false);
    303304        Dictionary.registerBoth(remove_button, "CDM.LanguageManager.Remove", "CDM.LanguageManager.Remove_Tooltip");
    304305
    305         clear_button = new JButton();
     306        clear_button = new GLIButton();
    306307        clear_button.setMnemonic(KeyEvent.VK_C);
    307308        // If there is a default language, then this is enabled
     
    309310        Dictionary.registerBoth(clear_button, "CDM.LanguageManager.Clear_Default", "CDM.LanguageManager.Clear_Default_Tooltip");
    310311
    311         set_button = new JButton();
     312        set_button = new GLIButton();
    312313        set_button.setMnemonic(KeyEvent.VK_S);
    313314        set_button.setEnabled(false);
  • trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java

    r6254 r6318  
    4646import org.greenstone.gatherer.gui.DoubleImageButton;
    4747import org.greenstone.gatherer.gui.GComboBox;
     48import org.greenstone.gatherer.gui.GLIButton;
    4849import org.greenstone.gatherer.msm.MSMUtils;
    4950import org.greenstone.gatherer.util.StaticStrings;
     
    590591    public PlugInControl() {
    591592        // Create
    592         add = new JButton();
     593        add = new GLIButton();
    593594        add.setMnemonic(KeyEvent.VK_A);
    594595        Dictionary.registerBoth(add, "CDM.PlugInManager.Add", "CDM.PlugInManager.Add_Tooltip");
     
    597598        central_pane = new JPanel();
    598599
    599         configure = new JButton();
     600        configure = new GLIButton();
    600601        configure.setEnabled(false);
    601602        configure.setMnemonic(KeyEvent.VK_C);
     
    662663        plugin_pane = new JPanel();
    663664
    664         remove = new JButton();
     665        remove = new GLIButton();
    665666        remove.setEnabled(false);
    666667        remove.setMnemonic(KeyEvent.VK_R);
  • trunk/gli/src/org/greenstone/gatherer/cdm/SearchTypeManager.java

    r6051 r6318  
    4545import org.greenstone.gatherer.gui.DoubleImageButton;
    4646import org.greenstone.gatherer.gui.GComboBox;
     47import org.greenstone.gatherer.gui.GLIButton;
    4748import org.greenstone.gatherer.msm.MSMUtils;
    4849import org.greenstone.gatherer.util.Utility;
     
    219220
    220221        JPanel button_panel = new JPanel();
    221         add_button = new JButton();
     222        add_button = new GLIButton();
    222223        add_button.setEnabled(false);
    223224        add_button.setMnemonic(KeyEvent.VK_A);
    224225        Dictionary.registerBoth(add_button, "CDM.SearchTypeManager.Add", "CDM.SearchTypeManager.Add_Tooltip");
    225226
    226         remove_button = new JButton();
     227        remove_button = new GLIButton();
    227228        remove_button.setEnabled(false);
    228229        remove_button.setMnemonic(KeyEvent.VK_R);
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndexManager.java

    r5903 r6318  
    4040import org.greenstone.gatherer.cdm.Subcollection;
    4141import org.greenstone.gatherer.cdm.SubcollectionIndex;
     42import org.greenstone.gatherer.gui.GLIButton;
    4243import org.greenstone.gatherer.msm.ElementWrapper;
    4344import org.greenstone.gatherer.util.ExclusiveListSelectionListener;
     
    223224        JPanel button_pane = new JPanel();
    224225
    225         add_index_button = new JButton();
     226        add_index_button = new GLIButton();
    226227        add_index_button.setMnemonic(KeyEvent.VK_A);
    227228        add_index_button.setEnabled(false);
    228229        Dictionary.registerBoth(add_index_button, "CDM.SubcollectionIndexManager.Add_Subindex", "CDM.SubcollectionIndexManager.Add_Subindex_Tooltip");
    229230
    230         clear_default_button = new JButton();
     231        clear_default_button = new GLIButton();
    231232        clear_default_button.setMnemonic(KeyEvent.VK_C);
    232233        clear_default_button.setEnabled(default_index != null);
     
    247248        default_value_field.setEditable(false);
    248249
    249         remove_index_button = new JButton();
     250        remove_index_button = new GLIButton();
    250251        remove_index_button.setMnemonic(KeyEvent.VK_R);
    251252        remove_index_button.setEnabled(false);
    252253        Dictionary.registerBoth(remove_index_button, "CDM.SubcollectionIndexManager.Remove_Subindex", "CDM.SubcollectionIndexManager.Remove_Subindex_Tooltip");
    253254
    254         set_default_button = new JButton();
     255        set_default_button = new GLIButton();
    255256        set_default_button.setMnemonic(KeyEvent.VK_S);
    256257        set_default_button.setEnabled(false);
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java

    r5785 r6318  
    4343import org.greenstone.gatherer.cdm.DOMProxyListModel;
    4444import org.greenstone.gatherer.cdm.Subcollection;
     45import org.greenstone.gatherer.gui.GLIButton;
    4546import org.greenstone.gatherer.gui.NonWhitespaceField;
    4647import org.greenstone.gatherer.msm.ElementWrapper;
     
    192193
    193194        JPanel button_pane_3 = new JPanel();
    194         add_button = new JButton();
     195        add_button = new GLIButton();
    195196        add_button.setMnemonic(KeyEvent.VK_A);
    196197        add_button.setEnabled(false);
    197198        Dictionary.registerBoth(add_button, "CDM.SubcollectionManager.Add", "CDM.SubcollectionManager.Add_Tooltip");
    198         remove_button = new JButton();
     199        remove_button = new GLIButton();
    199200        remove_button.setMnemonic(KeyEvent.VK_R);
    200201        remove_button.setEnabled(false);
    201202        Dictionary.registerBoth(remove_button, "CDM.SubcollectionManager.Remove", "CDM.SubcollectionManager.Remove_Tooltip");
    202         update_button = new JButton();
     203        update_button = new GLIButton();
    203204        update_button.setMnemonic(KeyEvent.VK_U);
    204205        update_button.setEnabled(false);
  • trunk/gli/src/org/greenstone/gatherer/cdm/TranslationView.java

    r5901 r6318  
    4242import org.greenstone.gatherer.cdm.LanguageListCellRenderer;
    4343import org.greenstone.gatherer.cdm.SubcollectionIndex;
     44import org.greenstone.gatherer.gui.GLIButton;
    4445
    4546/** This class provides a graphical interface to allow a user to quickly and conviently (ie all in one place) translate the text fragments associated with general metadata and indexes into each of the assigned languages in the collection. It should provide clear controls for the editing of these text fragments, plus clear indicate what languages still need further translation, which it will do through a combination of coloring and other visual indicators.
     
    260261
    261262        JPanel button_pane = new JPanel();
    262         add_button = new JButton();
     263        add_button = new GLIButton();
    263264        add_button.setEnabled(false);
    264265        add_button.setMnemonic(KeyEvent.VK_A);
    265266        Dictionary.registerBoth(add_button, "CDM.TranslationManager.Add", "CDM.TranslationManager.Add_Tooltip");
    266         replace_button = new JButton();
     267        replace_button = new GLIButton();
    267268        replace_button.setEnabled(false);
    268269        replace_button.setMnemonic(KeyEvent.VK_C);
    269270        Dictionary.registerBoth(replace_button, "CDM.TranslationManager.Replace", "CDM.TranslationManager.Replace_Tooltip");
    270         remove_button = new JButton();
     271        remove_button = new GLIButton();
    271272        remove_button.setEnabled(false);
    272273        remove_button.setMnemonic(KeyEvent.VK_R);
  • trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java

    r6146 r6318  
    4646import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
    4747import org.greenstone.gatherer.collection.Collection;
     48import org.greenstone.gatherer.gui.GLIButton;
    4849import org.greenstone.gatherer.gui.ModalDialog;
    4950import org.greenstone.gatherer.gui.SimpleMenuBar;
     
    9596    public DeleteCollectionPrompt() {
    9697    super(Gatherer.g_man);
    97     close_button = new JButton();
     98    close_button = new GLIButton();
    9899    close_button.setMnemonic(KeyEvent.VK_C);
    99100    Dictionary.setBoth(close_button, "General.Close", "General.Close_Tooltip");
     
    110111    Dictionary.setText(list_label, "DeleteCollectionPrompt.Collection_List");
    111112    list_model = new DefaultListModel();
    112     ok_button = new JButton();
     113    ok_button = new GLIButton();
    113114    ok_button.setMnemonic(KeyEvent.VK_D);
    114115    Dictionary.setBoth(ok_button, "DeleteCollectionPrompt.Delete", "DeleteCollectionPrompt.Delete_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/collection/ExportCollectionPrompt.java

    r6149 r6318  
    4949import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
    5050import org.greenstone.gatherer.collection.Collection;
     51import org.greenstone.gatherer.gui.GLIButton;
    5152import org.greenstone.gatherer.gui.ModalDialog;
    5253import org.greenstone.gatherer.gui.SimpleMenuBar;
     
    114115    public ExportCollectionPrompt() {
    115116    super(Gatherer.g_man, true);
    116     cancel_button = new JButton();
     117    cancel_button = new GLIButton();
    117118    cancel_button.setMnemonic(KeyEvent.VK_C);
    118119    Dictionary.setBoth(cancel_button, "General.Close", "General.Close_Tooltip");
     
    138139    list_label = new JLabel();
    139140    Dictionary.setText(list_label, "DeleteCollectionPrompt.Collection_List");
    140     ok_button = new JButton();
     141    ok_button = new GLIButton();
    141142    ok_button.setMnemonic(KeyEvent.VK_D);
    142143    Dictionary.setBoth(ok_button, "ExportCollectionPrompt.Export", "ExportCollectionPrompt.Export_Tooltip");
     
    545546
    546547        JPanel button_pane = new JPanel();
    547         JButton close_button = new JButton("Close");
     548        JButton close_button = new GLIButton("Close");
     549        close_button.setMnemonic(KeyEvent.VK_C);
    548550        close_button.addActionListener(new CloseButtonListener());
    549551
  • trunk/gli/src/org/greenstone/gatherer/collection/SaveCollectionBox.java

    r5581 r6318  
    4242import org.greenstone.gatherer.Dictionary;
    4343import org.greenstone.gatherer.Gatherer;
     44import org.greenstone.gatherer.gui.GLIButton;
    4445
    4546/** Provides a prompt allowing the user some choice in whether a collection saves. */
     
    115116    content_pane.add(button_pane);
    116117    // We add both mnemonics and key listener so that the 'y' of yes is underlined, but pressing just [Y] (rather than [CTL]-[Y]) performs a systematic click.
    117     yes = new JButton();
     118    yes = new GLIButton();
    118119    yes.addActionListener(this);
    119120    KeyListenerImpl key_listener = new KeyListenerImpl();
     
    122123    Dictionary.setBoth(yes, "General.Yes", "General.Yes_Tooltip");
    123124    button_pane.add(yes);
    124     no = new JButton();
     125    no = new GLIButton();
    125126    no.addActionListener(this);
    126127    no.addKeyListener(key_listener);
     
    128129    Dictionary.setBoth(no, "General.No", "General.No_Tooltip");
    129130    button_pane.add(no);
    130     cancel = new JButton();
     131    cancel = new GLIButton();
    131132    cancel.addActionListener(this);
    132133    cancel.addKeyListener(key_listener);
  • trunk/gli/src/org/greenstone/gatherer/gui/AboutDialog.java

    r6206 r6318  
    4242import org.greenstone.gatherer.Dictionary;
    4343import org.greenstone.gatherer.Gatherer;
     44import org.greenstone.gatherer.gui.GLIButton;
    4445import org.greenstone.gatherer.util.Utility;
    4546
     
    8485
    8586    JPanel button_pane = new JPanel();
    86     close_button = new JButton();
     87    close_button = new GLIButton();
     88    close_button.setMnemonic(KeyEvent.VK_C);
    8789    Dictionary.setBoth(close_button, "General.Close", "General.Close_Tooltip");
    8890
  • trunk/gli/src/org/greenstone/gatherer/gui/BrowsingPane.java

    r5571 r6318  
    4545import org.greenstone.gatherer.Dictionary;
    4646import org.greenstone.gatherer.Gatherer;
     47import org.greenstone.gatherer.gui.GLIButton;
    4748import org.greenstone.gatherer.util.GURL;
    4849import org.greenstone.gatherer.util.Utility;
     
    8788    JPanel left_button_pane = new JPanel();
    8889
    89     back_button = new JButton(Utility.getImage("back.gif"));
     90    back_button = new GLIButton(Utility.getImage("back.gif"));
    9091    back_button.setEnabled(false);
     92    back_button.setMnemonic(KeyEvent.VK_BACK_SPACE);
    9193    Dictionary.registerTooltip(back_button, "Browser.Back_Tooltip");
    9294
    93     // refresh_button = new JButton(Utility.getImage("reload.gif"));
     95    // refresh_button = new GLIButton(Utility.getImage("reload.gif"));
    9496    // refresh_button.setEnabled(false);
     97    // refresh_button.setMnemonic(KeyEvent.VK_R);
    9598    // Dictionary.registerTooltip(refresh_button, "Browser.Reload");
    9699
    97     bookmarks_button = new JButton(Utility.getImage("bookmark.gif"));
     100    bookmarks_button = new GLIButton(Utility.getImage("bookmark.gif"));
    98101    bookmarks_button.setEnabled(false);
     102    bookmarks_button.setMnemonic(KeyEvent.VK_M);
    99103    Dictionary.registerTooltip(bookmarks_button, "Browser.Bookmarks");
    100104
    101     home_button = new JButton(Utility.getImage("home.gif"));
     105    home_button = new GLIButton(Utility.getImage("home.gif"));
     106    home_button.setMnemonic(KeyEvent.VK_H);
    102107    Dictionary.registerTooltip(home_button, "Browser.Home_Tooltip");
    103108
     
    107112
    108113    JPanel right_button_pane = new JPanel();
    109     go_button = new JButton(Utility.getImage("go.gif"));
     114    go_button = new GLIButton(Utility.getImage("go.gif"));
     115    go_button.setMnemonic(KeyEvent.VK_ENTER);
    110116    Dictionary.registerTooltip(go_button, "Browser.Go_Tooltip");
    111117
    112     stop_button = new JButton(Utility.getImage("stop.gif"));
     118    stop_button = new GLIButton(Utility.getImage("stop.gif"));
    113119    stop_button.setEnabled(false);
     120    stop_button.setMnemonic(KeyEvent.VK_S);
    114121    Dictionary.registerTooltip(stop_button, "Browser.Stop_Tooltip");
    115122
    116     forward_button = new JButton(Utility.getImage("forward.gif"));
     123    forward_button = new GLIButton(Utility.getImage("forward.gif"));
    117124    forward_button.setEnabled(false);
     125    forward_button.setMnemonic(KeyEvent.VK_F);
    118126    Dictionary.registerTooltip(forward_button, "Browser.Forward_Tooltip");
    119127
  • trunk/gli/src/org/greenstone/gatherer/gui/CollectionPane.java

    r6219 r6318  
    5252import org.greenstone.gatherer.gui.Filter;
    5353import org.greenstone.gatherer.gui.GComboBox;
     54import org.greenstone.gatherer.gui.GLIButton;
    5455import org.greenstone.gatherer.gui.tree.DragTree;
    5556import org.greenstone.gatherer.gui.tree.WorkspaceTree;
     
    138139   
    139140    // Create components.
    140     stop_action = new JButton();
     141    stop_action = new GLIButton();
    141142    stop_action.addActionListener(this);
    142143    stop_action.setEnabled(false);
     144    stop_action.setMnemonic(KeyEvent.VK_S);
    143145    file_queue.registerStopButton(stop_action);
    144146    Dictionary.registerBoth(stop_action, "Collection.Stop", "Collection.Stop_Tooltip");
    145147   
    146     new_folder = new JButton(Utility.getImage("folder.gif"));
     148    new_folder = new GLIButton(Utility.getImage("folder.gif"));
    147149    new_folder.addActionListener(this);
    148150    new_folder.setEnabled(false);
    149151    new_folder.setMinimumSize(MIN_SIZE);
     152    new_folder.setMnemonic(KeyEvent.VK_N);
    150153    new_folder.setPreferredSize(MIN_SIZE);
    151154    Dictionary.registerTooltip(new_folder, "Collection.New_Folder_Tooltip");
     
    735738        name_field = new JTextField(file.getName());
    736739        JPanel button_pane = new JPanel();
    737         ok_button = new JButton();
     740        ok_button = new GLIButton();
    738741        ok_button.setEnabled(name_field.getText().length() > 0);
     742        ok_button.setMnemonic(KeyEvent.VK_O);
    739743        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    740         cancel_button = new JButton();
     744        cancel_button = new GLIButton();
     745        cancel_button.setMnemonic(KeyEvent.VK_C);
    741746        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Cancel_Tooltip");
    742747
  • trunk/gli/src/org/greenstone/gatherer/gui/CreatePane.java

    r6180 r6318  
    4949import org.greenstone.gatherer.collection.BuildOptions;
    5050import org.greenstone.gatherer.collection.Collection;
     51import org.greenstone.gatherer.gui.GLIButton;
    5152import org.greenstone.gatherer.gui.OptionsPane;
    5253import org.greenstone.gatherer.shell.GBasicProgressMonitor;
     
    205206
    206207    // Buttons
    207     build_button = new JButton();
     208    build_button = new GLIButton();
    208209    build_button.addActionListener(new BuildButtonListener());
     210    build_button.setMnemonic(KeyEvent.VK_B);
    209211    build_button.setPreferredSize(BUTTON_SIZE);
    210212    Dictionary.registerBoth(build_button, "CreatePane.Build_Collection", "CreatePane.Build_Collection_Tooltip");
    211213
    212     cancel_button = new JButton();
     214    cancel_button = new GLIButton();
    213215    cancel_button.addActionListener(new CancelButtonListener());
    214216    cancel_button.setEnabled(false);
     217    cancel_button.setMnemonic(KeyEvent.VK_C);
    215218    cancel_button.setPreferredSize(BUTTON_SIZE);
    216219    Dictionary.registerBoth(cancel_button, "CreatePane.Cancel_Build", "CreatePane.Cancel_Build_Tooltip");
    217220
    218     preview_button = new JButton();
     221    preview_button = new GLIButton();
    219222    preview_button.addActionListener(new PreviewButtonListener());
    220223    preview_button.setEnabled(false);
     224    preview_button.setMnemonic(KeyEvent.VK_P);
    221225    preview_button.setPreferredSize(BUTTON_SIZE);
    222226    Dictionary.registerBoth(preview_button, "CreatePane.Preview_Collection", "CreatePane.Preview_Collection_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/gui/DoubleImageButton.java

    r5166 r6318  
     1/**
     2 *#########################################################################
     3 *
     4 * A component of the Gatherer application, part of the Greenstone digital
     5 * library suite from the New Zealand Digital Library Project at the
     6 * University of Waikato, New Zealand.
     7 *
     8 * <BR><BR>
     9 *
     10 * Author: John Thompson, Greenstone Digital Library, University of Waikato
     11 *
     12 * <BR><BR>
     13 *
     14 * Copyright (C) 1999 New Zealand Digital Library Project
     15 *
     16 * <BR><BR>
     17 *
     18 * This program is free software; you can redistribute it and/or modify
     19 * it under the terms of the GNU General Public License as published by
     20 * the Free Software Foundation; either version 2 of the License, or
     21 * (at your option) any later version.
     22 *
     23 * <BR><BR>
     24 *
     25 * This program is distributed in the hope that it will be useful,
     26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     28 * GNU General Public License for more details.
     29 *
     30 * <BR><BR>
     31 *
     32 * You should have received a copy of the GNU General Public License
     33 * along with this program; if not, write to the Free Software
     34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     35 *########################################################################
     36 */
    137package org.greenstone.gatherer.gui;
    238
    339import java.awt.*;
    440import javax.swing.*;
     41import org.greenstone.gatherer.util.Utility;
    542
    643/** A button that allows for an icon at both the left and right sides. */
     
    1754    public DoubleImageButton(String title, ImageIcon enabled_icon, ImageIcon disabled_icon) {
    1855    super(title);
    19 
     56    setOpaque(!Utility.isMac());
    2057    setPreferredSize(SIZE);
    2158
  • trunk/gli/src/org/greenstone/gatherer/gui/EditorDialog.java

    r5718 r6318  
    4242import org.greenstone.gatherer.Dictionary;
    4343import org.greenstone.gatherer.Gatherer;
     44import org.greenstone.gatherer.gui.GLIButton;
    4445import org.greenstone.gatherer.gui.SimpleMenuBar;
    4546import org.greenstone.gatherer.gui.ModalDialog;
     
    9899    Dictionary.setTooltip(text, "MetaEdit.Value_Field_Tooltip");
    99100
    100     cancel = new JButton();
     101    cancel = new GLIButton();
    101102    cancel.setMnemonic(KeyEvent.VK_C);
    102103    Dictionary.setBoth(cancel, "General.Cancel", "General.Pure_Cancel_Tooltip");
    103     ok = new JButton();
     104    ok = new GLIButton();
    104105    ok.setMnemonic(KeyEvent.VK_O);
    105106    Dictionary.setBoth(ok, "General.OK", "General.OK_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/gui/ExternalCollectionPrompt.java

    r5795 r6318  
     1/**
     2 *#########################################################################
     3 *
     4 * A component of the Gatherer application, part of the Greenstone digital
     5 * library suite from the New Zealand Digital Library Project at the
     6 * University of Waikato, New Zealand.
     7 *
     8 * <BR><BR>
     9 *
     10 * Author: John Thompson, Greenstone Project, NZDL, University of Waikato
     11 *
     12 * <BR><BR>
     13 *
     14 * Copyright (C) 2003 New Zealand Digital Library Project
     15 *
     16 * <BR><BR>
     17 *
     18 * This program is free software; you can redistribute it and/or modify
     19 * it under the terms of the GNU General Public License as published by
     20 * the Free Software Foundation; either version 2 of the License, or
     21 * (at your option) any later version.
     22 *
     23 * <BR><BR>
     24 *
     25 * This program is distributed in the hope that it will be useful,
     26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     28 * GNU General Public License for more details.
     29 *
     30 * <BR><BR>
     31 *
     32 * You should have received a copy of the GNU General Public License
     33 * along with this program; if not, write to the Free Software
     34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     35 *########################################################################
     36 */
    137package org.greenstone.gatherer.gui;
    238
     
    1147import org.greenstone.gatherer.checklist.CheckList;
    1248import org.greenstone.gatherer.checklist.Entry;
     49import org.greenstone.gatherer.gui.GLIButton;
    1350import org.greenstone.gatherer.gui.SimpleMenuBar;
    1451import org.greenstone.gatherer.gui.ModalDialog;
     
    80117    */
    81118    JPanel button_pane = new JPanel();
    82     JButton ok_button = new JButton();
     119    JButton ok_button = new GLIButton();
    83120    ok_button.setMnemonic(KeyEvent.VK_O);
    84121    Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    85     JButton cancel_button = new JButton();
     122    JButton cancel_button = new GLIButton();
    86123    cancel_button.setMnemonic(KeyEvent.VK_C);
    87124    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/gui/FileAssociationDialog.java

    r6253 r6318  
    4949import org.greenstone.gatherer.file.FileAssociationManager;
    5050import org.greenstone.gatherer.gui.GComboBox;
     51import org.greenstone.gatherer.gui.GLIButton;
    5152import org.greenstone.gatherer.gui.ModalDialog;
    5253import org.greenstone.gatherer.gui.NonWhitespaceField;
     
    120121    JPanel command_pane = new JPanel();
    121122    command_field = new JTextField();
    122     browse_button = new JButton();
     123    browse_button = new GLIButton();
    123124    browse_button.setEnabled(!Utility.isMac());
    124125    browse_button.setMnemonic(KeyEvent.VK_B);
    125     browse_button.setOpaque(false);
     126
     127    JPanel button_pane = new JPanel();
    126128   
    127 
    128     JPanel button_pane = new JPanel();
    129     add_button = new JButton();
     129    add_button = new GLIButton();
    130130    add_button.setEnabled(false);
    131131    add_button.setMnemonic(KeyEvent.VK_A);
    132     add_button.setOpaque(false);
    133     replace_button = new JButton();
     132
     133    replace_button = new GLIButton();
    134134    replace_button.setEnabled(false);
    135135    replace_button.setMnemonic(KeyEvent.VK_P);
    136     replace_button.setOpaque(false);
    137     remove_button = new JButton();
     136
     137    remove_button = new GLIButton();
    138138    remove_button.setEnabled(false);
    139139    remove_button.setMnemonic(KeyEvent.VK_R);
    140     remove_button.setOpaque(false);
    141     close_button = new JButton();
     140
     141    close_button = new GLIButton();
    142142    close_button.setMnemonic(KeyEvent.VK_C);
    143     close_button.setOpaque(false);
    144143
    145144    // Connection
  • trunk/gli/src/org/greenstone/gatherer/gui/GProgressBar.java

    r5595 r6318  
    4444import org.greenstone.gatherer.Gatherer;
    4545import org.greenstone.gatherer.collection.Job;
     46import org.greenstone.gatherer.gui.GLIButton;
    4647import org.greenstone.gatherer.util.Utility;
    4748
     
    101102    inner_pane.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
    102103
    103     action = new JButton(Utility.getImage("vcrplay.gif"));
     104    action = new GLIButton(Utility.getImage("vcrplay.gif"));
    104105    action.addActionListener(this);
    105106    action.addActionListener(owner);
     107    action.setMnemonic(KeyEvent.VK_ENTER);
    106108    Dictionary.setTooltip(action, "Mirroring.Job.Start_Tooltip");
    107109
     
    126128    center_pane.add(results_status);
    127129
    128     cancel = new JButton(Utility.getImage("vcrstop.gif"));
     130    cancel = new GLIButton(Utility.getImage("vcrstop.gif"));
    129131    cancel.addActionListener(owner);
    130132    cancel.addActionListener(this);
     133    cancel.setMnemonic(KeyEvent.VK_BACK_SPACE);
    131134    Dictionary.setTooltip(cancel, "Mirroring.Job.Stop_Tooltip");
    132135
  • trunk/gli/src/org/greenstone/gatherer/gui/LockFileDialog.java

    r6090 r6318  
     1/**
     2 *#########################################################################
     3 *
     4 * A component of the Gatherer application, part of the Greenstone digital
     5 * library suite from the New Zealand Digital Library Project at the
     6 * University of Waikato, New Zealand.
     7 *
     8 * <BR><BR>
     9 *
     10 * Author: John Thompson, Greenstone Digital Library, University of Waikato
     11 *
     12 * <BR><BR>
     13 *
     14 * Copyright (C) 1999 New Zealand Digital Library Project
     15 *
     16 * <BR><BR>
     17 *
     18 * This program is free software; you can redistribute it and/or modify
     19 * it under the terms of the GNU General Public License as published by
     20 * the Free Software Foundation; either version 2 of the License, or
     21 * (at your option) any later version.
     22 *
     23 * <BR><BR>
     24 *
     25 * This program is distributed in the hope that it will be useful,
     26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     28 * GNU General Public License for more details.
     29 *
     30 * <BR><BR>
     31 *
     32 * You should have received a copy of the GNU General Public License
     33 * along with this program; if not, write to the Free Software
     34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     35 *########################################################################
     36 */
    137package org.greenstone.gatherer.gui;
    238
     
    743import org.greenstone.gatherer.Dictionary;
    844import org.greenstone.gatherer.Gatherer;
     45import org.greenstone.gatherer.gui.GLIButton;
    946import org.greenstone.gatherer.gui.SimpleMenuBar;
    1047import org.greenstone.gatherer.gui.ModalDialog;
     
    92129    Dictionary.setText(central_label, "LockFileDialog.Lockfile_Message_Two");
    93130    JPanel button_pane = new JPanel();
    94     ok_button = new JButton();
     131    ok_button = new GLIButton();
    95132    ok_button.setMnemonic(KeyEvent.VK_O);
    96133    Dictionary.setBoth(ok_button, "General.OK", "LockFileDialog.OK_Tooltip");
    97     cancel_button = new JButton();
     134    cancel_button = new GLIButton();
    98135    cancel_button.setMnemonic(KeyEvent.VK_C);
    99136    Dictionary.setBoth(cancel_button, "General.Cancel", "LockFileDialog.Cancel_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java

    r6216 r6318  
    5151import org.greenstone.gatherer.gui.Filter;
    5252import org.greenstone.gatherer.gui.GComboBox;
     53import org.greenstone.gatherer.gui.GLIButton;
    5354import org.greenstone.gatherer.gui.MetaEditPrompt;
    5455import org.greenstone.gatherer.gui.TransformCharacterTextField;
     
    147148    this.tree_sync = tree_sync;
    148149
    149     add = new JButton();
     150    add = new GLIButton();
    150151    add.addActionListener(this);
    151152    add.setEnabled(false);
     
    154155    Dictionary.registerBoth(add, "MetaEdit.Accumulate", "MetaEdit.Accumulate_Tooltip");
    155156
    156     update = new JButton();
     157    update = new GLIButton();
    157158    update.addActionListener(this);
    158159    update.setEnabled(false);
     
    161162    Dictionary.registerBoth(update, "MetaEdit.Overwrite", "MetaEdit.Overwrite_Tooltip");
    162163
    163     remove = new JButton();
     164    remove = new GLIButton();
    164165    remove.addActionListener(this);
    165166    remove.setEnabled(false);
     
    168169    Dictionary.registerBoth(remove, "MetaEdit.Remove", "MetaEdit.Remove_Tooltip");
    169170
    170     expand = new JButton();
     171    expand = new GLIButton();
    171172    expand.addActionListener(this);
    172173    expand.setEnabled(true);
     
    175176    Dictionary.registerBoth(expand, "MetaEdit.Expand", "MetaEdit.Expand_Tooltip");
    176177
    177     expand_for_extracted = new JButton();
     178    expand_for_extracted = new GLIButton();
    178179    expand_for_extracted.addActionListener(this);
    179180    expand_for_extracted.setEnabled(true);
  • trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPrompt.java

    r5536 r6318  
    3333import org.greenstone.gatherer.Dictionary;
    3434import org.greenstone.gatherer.Gatherer;
     35import org.greenstone.gatherer.gui.GLIButton;
    3536import org.greenstone.gatherer.gui.SimpleMenuBar;
    3637import org.greenstone.gatherer.gui.ModalDialog;
     
    128129    JPanel buttons_pane = new JPanel();
    129130
    130     accumulate = new JButton();
     131    accumulate = new GLIButton();
    131132    accumulate.setEnabled(type == ADD_PROMPT);
    132133    accumulate.setMnemonic(KeyEvent.VK_A);
    133134    Dictionary.setBoth(accumulate, "MetaEdit.Accumulate", "MetaEdit.Accumulate_Tooltip");
    134135
    135     accumulate_all = new JButton();
     136    accumulate_all = new GLIButton();
    136137    accumulate_all.setEnabled(type == ADD_PROMPT && multiple_selection);
    137138    accumulate_all.setMnemonic(KeyEvent.VK_L);
    138139    Dictionary.setBoth(accumulate_all, "MetaEditPrompt.Accumulate_All", "MetaEditPrompt.Accumulate_All_Tooltip");
    139140
    140     overwrite = new JButton();
     141    overwrite = new GLIButton();
    141142    overwrite.setEnabled(type == UPDATE_PROMPT);
    142143    overwrite.setMnemonic(KeyEvent.VK_R);
    143144    Dictionary.setBoth(overwrite, "MetaEdit.Overwrite", "MetaEdit.Overwrite_Tooltip");
    144145
    145     overwrite_all = new JButton();
     146    overwrite_all = new GLIButton();
    146147    overwrite_all.setEnabled(type == UPDATE_PROMPT && multiple_selection);
    147148    overwrite_all.setMnemonic(KeyEvent.VK_P);
    148149    Dictionary.setBoth(overwrite_all, "MetaEditPrompt.Overwrite_All", "MetaEditPrompt.Overwrite_All_Tooltip");
    149150
    150     remove = new JButton();
     151    remove = new GLIButton();
    151152    remove.setEnabled(type == REMOVE_PROMPT);
    152153    remove.setMnemonic(KeyEvent.VK_R);
    153154    Dictionary.setBoth(remove, "MetaEdit.Remove", "MetaEdit.Remove_Tooltip");
    154155
    155     remove_all = new JButton();
     156    remove_all = new GLIButton();
    156157    remove_all.setEnabled(type == REMOVE_PROMPT && multiple_selection);
    157158    remove_all.setMnemonic(KeyEvent.VK_A);
    158159    Dictionary.setBoth(remove_all, "MetaEditPrompt.Remove_All", "MetaEditPrompt.Remove_All_Tooltip");
    159160
    160     skip = new JButton();
     161    skip = new GLIButton();
    161162    skip.setEnabled(multiple_selection);
    162163    skip.setMnemonic(KeyEvent.VK_S);
    163164    Dictionary.setBoth(skip, "MetaEditPrompt.Skip", "MetaEditPrompt.Skip_Tooltip");
    164165
    165     cancel = new JButton();
     166    cancel = new GLIButton();
    166167    cancel.setMnemonic(KeyEvent.VK_C);
    167168    Dictionary.setBoth(cancel, "General.Cancel", "General.Cancel_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/gui/MirrorPane.java

    r5869 r6318  
    4949import org.greenstone.gatherer.WGet;
    5050import org.greenstone.gatherer.file.FileNode;
     51import org.greenstone.gatherer.gui.GLIButton;
    5152import org.greenstone.gatherer.util.Utility;
    5253
     
    130131
    131132    JPanel button_pane = new JPanel();
    132     download_button = new JButton();
     133    download_button = new GLIButton();
     134    download_button.setMnemonic(KeyEvent.VK_ENTER);
    133135    Dictionary.registerBoth(download_button, "Mirroring.Download", "Mirroring.Download_Tooltip");
    134136
  • trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java

    r6168 r6318  
    66 * University of Waikato, New Zealand.
    77 *
    8  * Author: John Thompson, Greenstone Digital Library, University of Waikato
     8 * Author: John Thompson, Greenstone Project, NZDL, University of Waikato
    99 *
    10  * Copyright (C) 1999 New Zealand Digital Library Project
     10 * Copyright (C) 2003 New Zealand Digital Library Project
    1111 *
    1212 * This program is free software; you can redistribute it and/or modify
     
    3737import org.greenstone.gatherer.Gatherer;
    3838import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
     39import org.greenstone.gatherer.gui.GLIButton;
    3940import org.greenstone.gatherer.gui.SimpleMenuBar;
    4041import org.greenstone.gatherer.gui.ModalDialog;
     
    178179
    179180    JPanel button_pane = new JPanel();
    180     create_button = new JButton();
     181    create_button = new GLIButton();
    181182    create_button.setMnemonic(KeyEvent.VK_O);
    182183    Dictionary.setBoth(create_button, "General.OK", "General.OK_Tooltip");
    183     JButton cancel_button = new JButton();
     184    JButton cancel_button = new GLIButton();
    184185    cancel_button.setMnemonic(KeyEvent.VK_C);
    185186    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Cancel_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionMetadataPrompt.java

    r6162 r6318  
     1/**
     2 *#########################################################################
     3 *
     4 * A component of the Gatherer application, part of the Greenstone digital
     5 * library suite from the New Zealand Digital Library Project at the
     6 * University of Waikato, New Zealand.
     7 *
     8 * Author: John Thompson, Greenstone Digital Library, University of Waikato
     9 *
     10 * Copyright (C) 1999 New Zealand Digital Library Project
     11 *
     12 * This program is free software; you can redistribute it and/or modify
     13 * it under the terms of the GNU General Public License as published by
     14 * the Free Software Foundation; either version 2 of the License, or
     15 * (at your option) any later version.
     16 *
     17 * This program is distributed in the hope that it will be useful,
     18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     20 * GNU General Public License for more details.
     21 *
     22 * You should have received a copy of the GNU General Public License
     23 * along with this program; if not, write to the Free Software
     24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     25 *########################################################################
     26 */
    127package org.greenstone.gatherer.gui;
    228
     
    1137import org.greenstone.gatherer.checklist.CheckList;
    1238import org.greenstone.gatherer.checklist.Entry;
     39import org.greenstone.gatherer.gui.GLIButton;
    1340import org.greenstone.gatherer.gui.SimpleMenuBar;
    1441import org.greenstone.gatherer.gui.ModalDialog;
     
    84111
    85112    JPanel button_pane = new JPanel();
    86     JButton ok_button = new JButton();
     113    JButton ok_button = new GLIButton();
    87114    ok_button.setMnemonic(KeyEvent.VK_O);
    88115    Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    89     JButton cancel_button = new JButton();
     116    JButton cancel_button = new GLIButton();
    90117    cancel_button.setMnemonic(KeyEvent.VK_C);
    91118    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/gui/NewFolderPrompt.java

    r5749 r6318  
     1/**
     2 *#########################################################################
     3 *
     4 * A component of the Gatherer application, part of the Greenstone digital
     5 * library suite from the New Zealand Digital Library Project at the
     6 * University of Waikato, New Zealand.
     7 *
     8 * <BR><BR>
     9 *
     10 * Author: John Thompson, Greenstone Digital Library, University of Waikato
     11 *
     12 * <BR><BR>
     13 *
     14 * Copyright (C) 1999 New Zealand Digital Library Project
     15 *
     16 * <BR><BR>
     17 *
     18 * This program is free software; you can redistribute it and/or modify
     19 * it under the terms of the GNU General Public License as published by
     20 * the Free Software Foundation; either version 2 of the License, or
     21 * (at your option) any later version.
     22 *
     23 * <BR><BR>
     24 *
     25 * This program is distributed in the hope that it will be useful,
     26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     28 * GNU General Public License for more details.
     29 *
     30 * <BR><BR>
     31 *
     32 * You should have received a copy of the GNU General Public License
     33 * along with this program; if not, write to the Free Software
     34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     35 *########################################################################
     36 */
    137package org.greenstone.gatherer.gui;
    238
     
    844import org.greenstone.gatherer.Gatherer;
    945import org.greenstone.gatherer.file.FileNode;
     46import org.greenstone.gatherer.gui.GLIButton;
    1047
    1148public class NewFolderPrompt
     
    5592
    5693    JPanel button_pane = new JPanel();
    57     ok_button = new JButton();
     94    ok_button = new GLIButton();
     95    ok_button.setMnemonic(KeyEvent.VK_O);
    5896    Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    59     cancel_button = new JButton();
     97    cancel_button = new GLIButton();
     98    cancel_button.setMnemonic(KeyEvent.VK_C);
    6099    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    61100
  • trunk/gli/src/org/greenstone/gatherer/gui/NewMetaSetPrompt.java

    r5795 r6318  
     1/**
     2 *#########################################################################
     3 *
     4 * A component of the Gatherer application, part of the Greenstone digital
     5 * library suite from the New Zealand Digital Library Project at the
     6 * University of Waikato, New Zealand.
     7 *
     8 * <BR><BR>
     9 *
     10 * Author: Katherine Don, Greenstone Digital Library, University of Waikato
     11 *
     12 * <BR><BR>
     13 *
     14 * Copyright (C) 1999 New Zealand Digital Library Project
     15 *
     16 * <BR><BR>
     17 *
     18 * This program is free software; you can redistribute it and/or modify
     19 * it under the terms of the GNU General Public License as published by
     20 * the Free Software Foundation; either version 2 of the License, or
     21 * (at your option) any later version.
     22 *
     23 * <BR><BR>
     24 *
     25 * This program is distributed in the hope that it will be useful,
     26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     28 * GNU General Public License for more details.
     29 *
     30 * <BR><BR>
     31 *
     32 * You should have received a copy of the GNU General Public License
     33 * along with this program; if not, write to the Free Software
     34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     35 *########################################################################
     36 */
    137package org.greenstone.gatherer.gui;
    238
     
    743import javax.swing.*;
    844import javax.swing.event.*;
    9 import javax.swing.*;
     45 import javax.swing.*;
    1046import javax.swing.event.*;
    1147import javax.swing.text.*;
     
    1450import org.greenstone.gatherer.checklist.CheckList;
    1551import org.greenstone.gatherer.checklist.Entry;
     52import org.greenstone.gatherer.gui.GLIButton;
    1653import org.greenstone.gatherer.gui.SimpleMenuBar;
    1754import org.greenstone.gatherer.gui.ModalDialog;
     
    78115    button_pane.setOpaque(false);
    79116   
    80     JButton ok_button = new JButton();
     117    JButton ok_button = new GLIButton();
     118    ok_button.setMnemonic(KeyEvent.VK_O);
    81119    Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    82120    ok_button.setEnabled(false);
    83     JButton cancel_button = new JButton();
     121    JButton cancel_button = new GLIButton();
     122    cancel_button.setMnemonic(KeyEvent.VK_C);
    84123    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    85124    TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
  • trunk/gli/src/org/greenstone/gatherer/gui/PreviewPane.java

    r6051 r6318  
    4545import org.greenstone.gatherer.collection.Collection;
    4646import org.greenstone.gatherer.Gatherer;
     47import org.greenstone.gatherer.gui.GLIButton;
    4748import org.greenstone.gatherer.util.GURL;
    4849import org.greenstone.gatherer.util.Utility;
     
    7071
    7172    // Create components
    72     back = new JButton(Utility.getImage("back.gif"));
     73    back = new GLIButton(Utility.getImage("back.gif"));
    7374    back.addActionListener(new BackListener());
    7475    back.setEnabled(false);
     76    back.setMnemonic(KeyEvent.VK_BACK_SPACE);
    7577    Dictionary.registerBoth(back, "Browser.Back", "Browser.Back_Tooltip");
    7678
    77     home = new JButton(Utility.getImage("home.gif"));
     79    home = new GLIButton(Utility.getImage("home.gif"));
    7880    home.addActionListener(new HomeListener());
    7981    home.setEnabled(false);
     82    home.setMnemonic(KeyEvent.VK_H);
    8083    Dictionary.registerBoth(home, "Browser.Home", "Browser.Home_Tooltip");
    8184
    82     forward = new JButton(Utility.getImage("forward.gif"));
     85    forward = new GLIButton(Utility.getImage("forward.gif"));
    8386    forward.addActionListener(new ForwardListener());
    8487    forward.setEnabled(false);
     88    forward.setMnemonic(KeyEvent.VK_F);
    8589    Dictionary.registerBoth(forward, "Browser.Forward", "Browser.Forward_Tooltip");
    8690
    87     reload = new JButton(Utility.getImage("reload.gif"));
     91    reload = new GLIButton(Utility.getImage("reload.gif"));
    8892    reload.addActionListener(new ReloadListener());
    8993    reload.setEnabled(false);
     94    reload.setMnemonic(KeyEvent.VK_R);
    9095    Dictionary.registerBoth(reload, "Browser.Reload", "Browser.Reload_Tooltip");
    9196
  • trunk/gli/src/org/greenstone/gatherer/gui/SimpleOpenCollectionDialog.java

    r6051 r6318  
    3636import org.greenstone.gatherer.Gatherer;
    3737import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
     38import org.greenstone.gatherer.gui.GLIButton;
    3839import org.greenstone.gatherer.gui.ModalDialog;
    3940import org.greenstone.gatherer.util.StaticStrings;
     
    8889
    8990    JPanel button_pane = new JPanel();
    90     open_button = new JButton();
     91    open_button = new GLIButton();
    9192    open_button.setEnabled(false);
    9293    open_button.setMnemonic(KeyEvent.VK_O);
    9394    Dictionary.setBoth(open_button, "OpenCollectionDialog.Open", "OpenCollectionDialog.Open_Tooltip");
    94     advanced_button = new JButton();
     95    advanced_button = new GLIButton();
    9596    advanced_button.setMnemonic(KeyEvent.VK_B);
    9697    Dictionary.setBoth(advanced_button, "OpenCollectionDialog.Browse", "OpenCollectionDialog.Browse_Tooltip");
    97     cancel_button = new JButton();
     98    cancel_button = new GLIButton();
    9899    cancel_button.setMnemonic(KeyEvent.VK_C);
    99100    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/AutofilterDialog.java

    r6221 r6318  
    4343import org.greenstone.gatherer.Dictionary;
    4444import org.greenstone.gatherer.Gatherer;
     45import org.greenstone.gatherer.gui.GLIButton;
    4546import org.greenstone.gatherer.gui.metaaudit.Autofilter;
    4647import org.greenstone.gatherer.gui.metaaudit.Filter;
     
    181182    }
    182183    JPanel button_pane = new JPanel();
    183     cancel_button = new JButton();
     184    cancel_button = new GLIButton();
    184185    cancel_button.setMnemonic(KeyEvent.VK_C);
    185186    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    186     remove_button = new JButton();
     187    remove_button = new GLIButton();
    187188    remove_button.setMnemonic(KeyEvent.VK_R);
    188189    Dictionary.setBoth(remove_button, "Autofilter.Remove", "Autofilter.Remove_Tooltip");
    189     set_button = new JButton();
     190    set_button = new GLIButton();
    190191    set_button.setMnemonic(KeyEvent.VK_S);
    191192    Dictionary.setBoth(set_button, "Autofilter.Set", "Autofilter.Set_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/MetaAuditFrame.java

    r5564 r6318  
    4646import org.greenstone.gatherer.file.FileNode;
    4747import org.greenstone.gatherer.util.TreeSynchronizer;
     48import org.greenstone.gatherer.gui.GLIButton;
    4849import org.greenstone.gatherer.gui.SimpleMenuBar;
    4950import org.greenstone.gatherer.gui.ModalDialog;
     
    114115    JPanel button_pane = new JPanel();
    115116
    116     JButton close_button = new JButton();
     117    JButton close_button = new GLIButton();
    117118    close_button.setMnemonic(KeyEvent.VK_C);
    118119    Dictionary.registerBoth(close_button, "MetaAudit.Close", "MetaAudit.Close_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/mem/MetadataEditorManager.java

    r6215 r6318  
    4949import org.greenstone.gatherer.gui.ComboArea;
    5050import org.greenstone.gatherer.gui.GComboBox;
     51import org.greenstone.gatherer.gui.GLIButton;
    5152import org.greenstone.gatherer.gui.SmarterTable;
    5253import org.greenstone.gatherer.gui.SmarterTree;
     
    313314    JPanel inner_button_pane = new JPanel();
    314315    inner_button_pane.setOpaque(false);
    315     add_attribute = new JButton();
     316    add_attribute = new GLIButton();
     317    add_attribute.setMnemonic(KeyEvent.VK_4);
    316318    Dictionary.setBoth(add_attribute, "MEM.Add", "MEM.Add_Attribute_Tooltip");
    317     add_element = new JButton();
     319    add_element = new GLIButton();
     320    add_element.setMnemonic(KeyEvent.VK_3);
    318321    Dictionary.setBoth(add_element, "MEM.Add", "MEM.Add_Element_Tooltip");
    319     add_file = new JButton();
     322    add_file = new GLIButton();
     323    add_file.setMnemonic(KeyEvent.VK_2);
    320324    Dictionary.setBoth(add_file, "MEM.Add", "MEM.Add_File_Tooltip");
    321     add_set = new JButton();
     325    add_set = new GLIButton();
     326    add_set.setMnemonic(KeyEvent.VK_1);
    322327    Dictionary.setBoth(add_set, "MEM.Add", "MEM.Add_Set_Tooltip");
    323     add_value = new JButton();
     328    add_value = new GLIButton();
     329    add_value.setMnemonic(KeyEvent.VK_5);
    324330    Dictionary.setBoth(add_value, "MEM.Add", "MEM.Add_Value_Tooltip");
    325331
    326     edit_attribute = new JButton();
     332    edit_attribute = new GLIButton();
     333    edit_attribute.setMnemonic(KeyEvent.VK_6);
    327334    Dictionary.setBoth(edit_attribute, "MEM.Edit", "MEM.Edit_Attribute_Tooltip");
    328     edit_value = new JButton();
     335    edit_value = new GLIButton();
     336    edit_value.setMnemonic(KeyEvent.VK_7);
    329337    Dictionary.setBoth(edit_value, "MEM.Edit", "MEM.Edit_Value_Tooltip");
    330338
    331     remove_attribute = new JButton();
     339    remove_attribute = new GLIButton();
     340    remove_attribute.setMnemonic(KeyEvent.VK_MINUS);
    332341    Dictionary.setBoth(remove_attribute, "MEM.Remove", "MEM.Remove_Attribute_Tooltip");
    333     remove_element = new JButton();
     342    remove_element = new GLIButton();
     343    remove_element.setMnemonic(KeyEvent.VK_0);
    334344    Dictionary.setBoth(remove_element, "MEM.Remove", "MEM.Remove_Element_Tooltip");
    335     remove_file = new JButton();
     345    remove_file = new GLIButton();
     346    remove_file.setMnemonic(KeyEvent.VK_9);
    336347    Dictionary.setBoth(remove_file, "MEM.Remove", "MEM.Remove_File_Tooltip");
    337     remove_set = new JButton();
     348    remove_set = new GLIButton();
     349    remove_set.setMnemonic(KeyEvent.VK_8);
    338350    Dictionary.setBoth(remove_set, "MEM.Remove", "MEM.Remove_Set_Tooltip");
    339     remove_value = new JButton();
     351    remove_value = new GLIButton();
     352    remove_value.setMnemonic(KeyEvent.VK_EQUALS);
    340353    Dictionary.setBoth(remove_value, "MEM.Remove", "MEM.Remove_Value_Tooltip");
    341354    setControls(false, false, false, false, false, false, false, false, false, false, false, false);
    342355
    343     close = new JButton();
     356    close = new GLIButton();
     357    close.setMnemonic(KeyEvent.VK_C);
    344358    Dictionary.setBoth(close, "General.Close", "General.Close_Tooltip");
    345359
     
    616630        JPanel button_pane = new JPanel();
    617631        button_pane.setOpaque(false);
    618         ok_button = new JButton();
     632        ok_button = new GLIButton();
     633        ok_button.setMnemonic(KeyEvent.VK_O);
    619634        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    620         cancel_button = new JButton();
     635        cancel_button = new GLIButton();
     636        cancel_button.setMnemonic(KeyEvent.VK_C);
    621637        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    622638
     
    10131029        button_pane.setOpaque(false);
    10141030
    1015         ok_button = new JButton();
     1031        ok_button = new GLIButton();
     1032        ok_button.setMnemonic(KeyEvent.VK_O);
    10161033        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    1017         cancel_button = new JButton();
     1034        cancel_button = new GLIButton();
     1035        cancel_button.setMnemonic(KeyEvent.VK_C);
    10181036        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    10191037
     
    11501168        button_pane.setOpaque(false);
    11511169
    1152         ok_button = new JButton();
     1170        ok_button = new GLIButton();
     1171        ok_button.setMnemonic(KeyEvent.VK_O);
    11531172        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    1154         cancel_button = new JButton();
     1173        cancel_button = new GLIButton();
     1174        cancel_button.setMnemonic(KeyEvent.VK_C);
    11551175        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    11561176
     
    12751295        button_pane.setOpaque(false);
    12761296
    1277         ok_button = new JButton();
     1297        ok_button = new GLIButton();
     1298        ok_button.setMnemonic(KeyEvent.VK_O);
    12781299        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    1279         cancel_button = new JButton();
     1300        cancel_button = new GLIButton();
     1301        cancel_button.setMnemonic(KeyEvent.VK_C);
    12801302        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    12811303        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
     
    14041426        button_pane.setOpaque(false);
    14051427
    1406         ok_button = new JButton();
     1428        ok_button = new GLIButton();
     1429        ok_button.setMnemonic(KeyEvent.VK_O);
    14071430        ok_button.setEnabled(false);
    14081431        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    1409         cancel_button = new JButton();
     1432        cancel_button = new GLIButton();
     1433        cancel_button.setMnemonic(KeyEvent.VK_C);
    14101434        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    14111435        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
  • trunk/gli/src/org/greenstone/gatherer/msm/ExportMDSPrompt.java

    r5593 r6318  
    4747import org.greenstone.gatherer.msm.MetadataSetManager;
    4848import org.greenstone.gatherer.util.Utility;
     49import org.greenstone.gatherer.gui.GLIButton;
    4950import org.greenstone.gatherer.gui.SimpleMenuBar;
    5051import org.greenstone.gatherer.gui.ModalDialog;
     
    137138    file_name = new JTextField(Utility.METADATA_DIR);
    138139    Dictionary.setTooltip(file_name, "MSMPrompt.Export_File_Tooltip");
    139     browse_button = new JButton();
     140    browse_button = new GLIButton();
     141    browse_button.setMnemonic(KeyEvent.VK_B);
    140142    Dictionary.setBoth(browse_button, "General.Browse", "General.Browse_Tooltip");
    141143
    142144    JPanel button_pane = new JPanel();
    143145    if(export) {
    144         export_button = new JButton();
     146        export_button = new GLIButton();
    145147        export_button.setEnabled(false);
    146148        export_button.setMnemonic(KeyEvent.VK_E);
     
    148150    }
    149151    else {
    150         export_button = new JButton();
     152        export_button = new GLIButton();
    151153        export_button.setEnabled(true);
    152154        export_button.setMnemonic(KeyEvent.VK_I);
     
    154156    }
    155157
    156     cancel_button = new JButton();
     158    cancel_button = new GLIButton();
    157159    cancel_button.setMnemonic(KeyEvent.VK_C);
    158160    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
  • trunk/gli/src/org/greenstone/gatherer/msm/GDMManager.java

    r6259 r6318  
    4646import org.greenstone.gatherer.Gatherer;
    4747import org.greenstone.gatherer.file.FileNode;
     48import org.greenstone.gatherer.gui.GLIButton;
    4849import org.greenstone.gatherer.gui.MetaEditPrompt;
    4950import org.greenstone.gatherer.msm.ElementWrapper;
     
    131132    documents_in_cache_combobox = new JComboBox();
    132133    documents_in_cache_combobox.addItemListener(new DOMItemListener());
    133     JButton refresh_button = new JButton("Refresh Tree");
     134    JButton refresh_button = new GLIButton("Refresh Tree");
     135    refresh_button.setMnemonic(KeyEvent.VK_R);
    134136    refresh_button.addActionListener(new ActionListener() {
    135137        public void actionPerformed(ActionEvent event) {
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMPrompt.java

    r6095 r6318  
    4545import org.greenstone.gatherer.Dictionary;
    4646import org.greenstone.gatherer.Gatherer;
     47import org.greenstone.gatherer.gui.GLIButton;
    4748import org.greenstone.gatherer.gui.ModalDialog;
    4849import org.greenstone.gatherer.gui.SimpleMenuBar;
     
    9192
    9293    // Create components
    93     cancel = new JButton();
     94    cancel = new GLIButton();
    9495    cancel.addActionListener(this);
    9596    cancel.setEnabled(true);
     
    181182    JLabel attribute_name = new JLabel(att_new.getAttribute("name"));
    182183
    183     add = new JButton();
     184    add = new GLIButton();
    184185    add.addActionListener(this);
    185186    add.setEnabled(true);
     
    187188    Dictionary.registerBoth(add, "MSMPrompt.Add", "MSMPrompt.Add_Tooltip");
    188189
    189     replace = new JButton();
     190    replace = new GLIButton();
    190191    replace.addActionListener(this);
    191192    replace.setEnabled(false);
    192     replace.setMnemonic(KeyEvent.VK_R);
     193    replace.setMnemonic(KeyEvent.VK_P);
    193194    Dictionary.registerBoth(replace, "MSMPrompt.Replace", "MSMPrompt.Replace_Tooltip");
    194195
    195         skip = new JButton();
     196        skip = new GLIButton();
    196197    skip.addActionListener(this);
    197198    skip.setEnabled(true);
     
    308309    Dictionary.registerText(progress_label, "MSMPrompt.Progress");
    309310
    310     add = new JButton();
     311    add = new GLIButton();
    311312    add.addActionListener(this);
    312313    add.setEnabled(false);
     
    314315    Dictionary.registerBoth(add, "MSMPrompt.Add", "MSMPrompt.Add_Tooltip");
    315316
    316     merge = new JButton();
     317    merge = new GLIButton();
    317318    merge.addActionListener(this);
    318319    merge.setEnabled(true);
     
    320321    Dictionary.registerBoth(merge, "MSMPrompt.Merge", "MSMPrompt.Merge_Tooltip");
    321322
    322     rename = new JButton();
     323    rename = new GLIButton();
    323324    rename.addActionListener(this);
    324325    rename.setEnabled(false);
     
    326327    Dictionary.registerBoth(rename, "MSMPrompt.Rename", "MSMPrompt.Rename_Tooltip");
    327328
    328     replace = new JButton();
     329    replace = new GLIButton();
    329330    replace.addActionListener(this);
    330331    replace.setEnabled(false);
    331     replace.setMnemonic(KeyEvent.VK_R);
     332    replace.setMnemonic(KeyEvent.VK_P);
    332333    Dictionary.registerBoth(replace, "MSMPrompt.Replace", "MSMPrompt.Replace_Tooltip");
    333334
    334     skip = new JButton();
     335    skip = new GLIButton();
    335336    skip.addActionListener(this);
    336337    skip.setEnabled(true);
     
    494495    Dictionary.setTooltip(new_name, "MSMPrompt.New_Name_Tooltip");
    495496
    496     JButton ok = new JButton();
     497    JButton ok = new GLIButton();
    497498    ok.addActionListener(this);
    498499    ok.setMnemonic(KeyEvent.VK_O);
     
    596597    Dictionary.setText(dialog, "MSMPrompt.Select");
    597598
    598     JButton ok = new JButton();
     599    JButton ok = new GLIButton();
    599600    ok.addActionListener(this);
    600601    ok.setMnemonic(KeyEvent.VK_O);
     
    707708    Dictionary.setTooltip(element, "MSMPrompt.Select_Element_Element_Tooltip");
    708709
    709     JButton add_button = new JButton();
     710    JButton add_button = new GLIButton();
    710711    add_button.setEnabled(false);
    711712    add_button.setMnemonic(KeyEvent.VK_A);
    712713    Dictionary.setBoth(add_button, "MSMPrompt.Select_Element_Add", "MSMPrompt.Select_Element_Add_Tooltip");
    713714
    714     JButton cancel_button = new JButton();
     715    JButton cancel_button = new GLIButton();
    715716    cancel_button.setMnemonic(KeyEvent.VK_C);
    716717    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Cancel_Tooltip");
    717718
    718     JButton merge_button = new JButton();
     719    JButton merge_button = new GLIButton();
    719720    merge_button.setEnabled(false);
    720721    merge_button.setMnemonic(KeyEvent.VK_M);
    721722    Dictionary.setBoth(merge_button, "MSMPrompt.Select_Element_Merge", "MSMPrompt.Select_Element_Merge_Tooltip");
    722723
    723     JButton ignore_button = new JButton();
     724    JButton ignore_button = new GLIButton();
    724725    ignore_button.setMnemonic(KeyEvent.VK_I);
    725726    Dictionary.setBoth(ignore_button, "MSMPrompt.Select_Element_Ignore", "MSMPrompt.Select_Element_Ignore_Tooltip");
     
    857858    }
    858859
    859     /** Prompts the user to select a metadata set from the given list. Uses the name parameter to attempt to automatically select the correct collection (ie the only collection that has an element with the same name).
    860      * @param name The name of the metadata element whose set name is unknown.
    861      * @return The metadata set the user has selected or null if no set selected.
    862      */
    863     /* final private MetadataSet selectSet(String name) {
    864     String args[] = new String[1];
    865     args[0] = name;
    866 
    867     // Creation
    868     MSMDialog dialog = new MSMDialog();
    869     dialog.setModal(true);
    870     dialog.setSize(SELECT_SET_SIZE);
    871     dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata"));
    872     Dictionary.setText(dialog, "MSMPrompt.Select_Set_Title");
    873 
    874     JPanel content_pane = (JPanel) dialog.getContentPane();
    875     JPanel control_pane = new JPanel();
    876     JTextArea instructions = new JTextArea();
    877     instructions.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
    878     instructions.setEditable(false);
    879     instructions.setLineWrap(true);
    880     instructions.setRows(SELECT_LINE_COUNT);
    881     instructions.setWrapStyleWord(true);
    882     Dictionary.setText(instructions, "MSMPrompt.Select_Set_Instructions", args);
    883 
    884     JComboBox set = new JComboBox();
    885     set.setBackground(Color.white);
    886     set.addItem(Dictionary.get("MSMPrompt.Select_Set_None"));
    887     Vector sets = manager.getSets();
    888     for(int i = sets.size() - 1; i >= 0; i--) {
    889         set.addItem(sets.get(i));
    890     }
    891     Dictionary.setTooltip(set, "MSMPrompt.Select_Element_Set_Tooltip");
    892 
    893     JButton ok = new JButton();
    894     ActionListener ok_listener = new IgnoreListener(dialog);
    895     ok.addActionListener(ok_listener); // Doesn't really ignore. Just disposes()
    896     Dictionary.setBoth(ok, "General.OK", "General.OK_Tooltip");
    897 
    898     // Select most likely set
    899     if(name.indexOf(".") != -1) {
    900         String set_name = name.substring(0, name.indexOf("."));
    901         MetadataSet metadata_set = manager.getSet(set_name);
    902         if(metadata_set != null) {
    903         set.setSelectedItem(metadata_set);
    904         }
    905         metadata_set = null;
    906         set_name = null;
    907     }
    908     else {
    909         Vector matches = manager.setsThatContain(name);
    910         if(matches.size() == 1) {
    911         set.setSelectedItem(matches.get(0));
    912         }
    913         matches = null;
    914     }
    915 
    916     // Layout
    917     control_pane.setLayout(new GridLayout(2,1));
    918     control_pane.add(set);
    919     control_pane.add(ok);
    920     content_pane.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
    921     content_pane.setLayout(new BorderLayout());
    922     content_pane.add(new JScrollPane(instructions), BorderLayout.CENTER);
    923     content_pane.add(control_pane, BorderLayout.SOUTH);
    924 
    925     // Display
    926     dialog.setLocation((screen_size.width - SELECT_SET_SIZE.width) / 2, (screen_size.height - SELECT_SET_SIZE.height) / 2);
    927     dialog.setVisible(true);
    928     Object value = set.getSelectedItem();
    929     if(value instanceof MetadataSet) {
    930         return (MetadataSet) value;
    931     }
    932     value = null;
    933     ok.removeActionListener(ok_listener);
    934     ok_listener = null;
    935     ok = null;
    936     content_pane = null;
    937     control_pane = null;
    938     instructions = null;
    939     set = null;
    940     dialog.destroy();
    941     dialog = null;
    942     return null;
    943     } */
    944 
    945860    private class AddListener
    946861    implements ActionListener {
  • trunk/gli/src/org/greenstone/gatherer/util/AppendLineOnlyFileDocument.java

    r6181 r6318  
    88import javax.swing.event.*;
    99import javax.swing.text.*;
    10 
    1110import org.greenstone.gatherer.Gatherer;
     11import org.greenstone.gatherer.gui.GLIButton;
    1212import org.greenstone.gatherer.util.StaticStrings;
    1313
     
    614614    final JTextArea text_area = new JTextArea(document);
    615615
    616     JButton read_button = new JButton("Read Huge File");
     616    JButton read_button = new GLIButton("Read Huge File");
     617    read_button.setMnemonic(KeyEvent.VK_R);
    617618    read_button.addActionListener(new ActionListener() {
    618619        public void actionPerformed(ActionEvent event) {
  • trunk/gli/src/org/greenstone/gatherer/util/TreeModelTest.java

    r5581 r6318  
     1/**
     2 *#########################################################################
     3 *
     4 * A component of the Gatherer application, part of the Greenstone digital
     5 * library suite from the New Zealand Digital Library Project at the
     6 * University of Waikato, New Zealand.
     7 *
     8 * <BR><BR>
     9 *
     10 * Author: John Thompson, Greenstone Digital Library, University of Waikato
     11 *
     12 * <BR><BR>
     13 *
     14 * Copyright (C) 1999 New Zealand Digital Library Project
     15 *
     16 * <BR><BR>
     17 *
     18 * This program is free software; you can redistribute it and/or modify
     19 * it under the terms of the GNU General Public License as published by
     20 * the Free Software Foundation; either version 2 of the License, or
     21 * (at your option) any later version.
     22 *
     23 * <BR><BR>
     24 *
     25 * This program is distributed in the hope that it will be useful,
     26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     28 * GNU General Public License for more details.
     29 *
     30 * <BR><BR>
     31 *
     32 * You should have received a copy of the GNU General Public License
     33 * along with this program; if not, write to the Free Software
     34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     35 *########################################################################
     36 */
    137package org.greenstone.gatherer.util;
    238
     
    743import javax.swing.*;
    844import javax.swing.tree.*;
     45import org.greenstone.gatherer.gui.GLIButton;
    946import org.greenstone.gatherer.util.DefaultSynchronizedTreeNode;
    1047import org.greenstone.gatherer.util.SynchronizedTreeModel;
     
    109146
    110147    JPanel button_panel = new JPanel();
    111     JButton add_button = new JButton("Add Node");
     148    JButton add_button = new GLIButton("Add Node");
     149    add_button.setMnemonic(KeyEvent.VK_A);
    112150    dangerous_button = new JToggleButton("Dangerous!");
    113151    dangerous_button.setSelected(false);
    114     JButton remove_button = new JButton("Remove Node");
    115     JButton preset_button = new JButton("Preset Structure");
     152    JButton remove_button = new GLIButton("Remove Node");
     153    remove_button.setMnemonic(KeyEvent.VK_R);
     154    JButton preset_button = new GLIButton("Preset Structure");
     155    preset_button.setMnemonic(KeyEvent.VK_P);
    116156
    117157    // Connection
Note: See TracChangeset for help on using the changeset viewer.