Changeset 5939


Ignore:
Timestamp:
2003-11-24T11:46:43+13:00 (20 years ago)
Author:
jmt12
Message:

Double clicking now opens collections

File:
1 edited

Legend:

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

    r5675 r5939  
    103103    cancel_button.addActionListener(new CancelListener());
    104104    open_button.addActionListener(new OpenListener());
    105     collection_list.addListSelectionListener(new CollectionListSelectionListener());
     105    CollectionListSelectionListener clsl = new CollectionListSelectionListener();
     106    collection_list.addListSelectionListener(clsl);
     107    collection_list.addMouseListener(clsl);
     108    clsl = null;
    106109
    107110    // Layout
     
    169172
    170173    private class CollectionListSelectionListener
     174    extends MouseAdapter
    171175    implements ListSelectionListener {
     176
     177    public void mouseClicked(MouseEvent event) {
     178        ///ystem.err.println("Mouse clicked");
     179        if(event.getClickCount() >= 2) {
     180        Point location = event.getPoint();
     181        int index = collection_list.locationToIndex(location);
     182        collection_list.setSelectedIndex(index);
     183        location = null;
     184        open_button.doClick();
     185        }
     186    }
    172187
    173188    public void valueChanged(ListSelectionEvent event) {
Note: See TracChangeset for help on using the changeset viewer.