00001 /** 00002 * C-JDBC: Clustered JDBC. 00003 * Copyright (C) 2002-2004 French National Institute For Research In Computer 00004 * Science And Control (INRIA). 00005 * Contact: c-jdbc@objectweb.org 00006 * 00007 * This library is free software; you can redistribute it and/or modify it 00008 * under the terms of the GNU Lesser General Public License as published by the 00009 * Free Software Foundation; either version 2.1 of the License, or any later 00010 * version. 00011 * 00012 * This library is distributed in the hope that it will be useful, but WITHOUT 00013 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 00015 * for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public License 00018 * along with this library; if not, write to the Free Software Foundation, 00019 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00020 * 00021 * Initial developer(s): Nicolas Modrzyk 00022 * Contributor(s): ______________________. 00023 */ 00024 00025 package org.objectweb.cjdbc.console.gui.popups; 00026 00027 import java.awt.Component; 00028 import java.awt.event.ActionEvent; 00029 import java.awt.event.ActionListener; 00030 import java.awt.event.MouseEvent; 00031 import java.awt.event.MouseListener; 00032 00033 import javax.swing.JPopupMenu; 00034 00035 import org.objectweb.cjdbc.console.gui.CjdbcGui; 00036 00037 /** 00038 * This class defines a AbstractPopUpMenu 00039 * 00040 * @author <a href="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a> 00041 * @version 1.0 00042 */ 00043 public abstract class AbstractPopUpMenu extends JPopupMenu 00044 implements 00045 MouseListener, 00046 ActionListener 00047 { 00048 CjdbcGui gui; 00049 00050 /** 00051 * Creates a new <code>AbstractPopUpMenu.java</code> object 00052 * 00053 * @param gui the main gui 00054 */ 00055 public AbstractPopUpMenu(CjdbcGui gui) 00056 { 00057 this.gui = gui; 00058 } 00059 00060 /** 00061 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent) 00062 */ 00063 public void mouseClicked(MouseEvent e) 00064 { 00065 00066 } 00067 00068 /** 00069 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent) 00070 */ 00071 public void mouseEntered(MouseEvent e) 00072 { 00073 00074 } 00075 00076 /** 00077 * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent) 00078 */ 00079 public void mouseExited(MouseEvent e) 00080 { 00081 00082 } 00083 00084 /** 00085 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) 00086 */ 00087 public void mousePressed(MouseEvent e) 00088 { 00089 if (e.isPopupTrigger()) 00090 show((Component) e.getSource(), e.getX(), e.getY()); 00091 } 00092 00093 /** 00094 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent) 00095 */ 00096 public void mouseReleased(MouseEvent event) 00097 { 00098 if (event.isPopupTrigger()) 00099 show((Component) event.getSource(), event.getX(), event.getY()); 00100 } 00101 00102 /** 00103 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 00104 */ 00105 public abstract void actionPerformed(ActionEvent e); 00106 }