Changeset 14232


Ignore:
Timestamp:
2007-07-09T11:52:40+12:00 (17 years ago)
Author:
xiao
Message:

add c ClickListener to listen for double click upon the index list and react as if the EditIndex button was clicked.

File:
1 edited

Legend:

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

    r13468 r14232  
    443443        index_list.setVisibleRowCount(6);
    444444        index_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    445 
     445      index_list.addMouseListener(new ClickListener());
     446     
    446447        JPanel movement_pane = new JPanel();
    447448        move_up_button = new GLIButton(Dictionary.get("CDM.Move.Move_Up"), JarTools.getImage("arrow-up.gif"), Dictionary.get("CDM.Move.Move_Up_Tooltip"));
     
    505506    public void gainFocus() {}
    506507    public void destroy() {}
    507    
     508 
     509    /** Listens for double clicks apon the list and react as if the configure button was pushed. */
     510    private class ClickListener
     511        extends MouseAdapter {
     512        /** Called whenever the mouse is clicked over a registered component, we use this to chain through to the configure prompt.
     513         * @param event A <strong>MouseEvent</strong> containing information about the mouse click.
     514        */
     515    public void mouseClicked(MouseEvent event) {
     516      if(event.getClickCount() == 2 ) {
     517        if(!index_list.isSelectionEmpty()) {
     518          Index index = (Index) index_list.getSelectedValue();
     519          NewIndexPrompt nip = new NewIndexPrompt(build_type, index);
     520          nip.destroy();         
     521        }
     522      }
     523    }
     524  }
     525
     526 
    508527    private class IndexListListener
    509528        implements ListSelectionListener {
Note: See TracChangeset for help on using the changeset viewer.