org.crosswire.common.swing.desktop
Class TabPopupListener

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by org.crosswire.common.swing.desktop.TabPopupListener
All Implemented Interfaces:
MouseListener, EventListener

public class TabPopupListener
extends MouseAdapter

A mouse listener for a tabbed pane that can display a popup menu.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: TabPopupListener.java,v 1.1 2004/09/08 19:53:37 dmsmith Exp $
Author:
DM Smith [ dmsmith555 at yahoo dot com]
See Also:
Licence

Field Summary
private  JPopupMenu popup
          The popup for the tabs
private  JTabbedPane tabs
          The tabs for which the popup applies
 
Constructor Summary
TabPopupListener(JTabbedPane tabbedPane, JPopupMenu popupMenu)
          Create a listener to mouse events on a JTabbedPane and show a popup if requested.
 
Method Summary
private  void doPopup(MouseEvent e)
          Popup if the mouse event indicates it should be shown
 void mouseClicked(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 
Methods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tabs

private JTabbedPane tabs
The tabs for which the popup applies


popup

private JPopupMenu popup
The popup for the tabs

Constructor Detail

TabPopupListener

public TabPopupListener(JTabbedPane tabbedPane,
                        JPopupMenu popupMenu)
Create a listener to mouse events on a JTabbedPane and show a popup if requested.

Parameters:
tabbedPane - The tab pane on which to listen for popup events
popupMenu - the popup to display
Method Detail

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener
Overrides:
mouseClicked in class MouseAdapter

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class MouseAdapter

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class MouseAdapter

doPopup

private void doPopup(MouseEvent e)
Popup if the mouse event indicates it should be shown

Parameters:
e -

Copyright ? 2003-2004