/*
 * Copyright 2008-2010 by Emeric Vernat
 *
 *     This file is part of Java Melody.
 *
 * Java Melody is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Java Melody 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Java Melody.  If not, see <http://www.gnu.org/licenses/>.
 */
package net.bull.javamelody;

import java.awt.event.ActionEvent;

import javax.swing.Icon;
import javax.swing.JMenuItem;

import net.bull.javamelody.util.MSwingUtilities;
import net.bull.javamelody.util.MWaitCursor;

/**
 * MenuItem.
 * 
 * @author Emeric Vernat
 */
public class MMenuItem extends JMenuItem {
	private static final long serialVersionUID = 1L;

	/**
	 * Constructeur.
	 */
	public MMenuItem() {
		this(null);
	}

	/**
	 * Constructeur.
	 * 
	 * @param text
	 *           String
	 */
	public MMenuItem(final String text) {
		super(text);
	}

	/**
	 * Constructeur.
	 * 
	 * @param text
	 *           String
	 * @param icon
	 *           Icon
	 */
	public MMenuItem(final String text, final Icon icon) {
		super(text, icon);
	}

	/**
	 * Méthode interne pour notifier tous les listeners qui ont enregistré leur intérêt par menuItem.addActionListener pour les évènements d'action sur cet item.
	 * 
	 * Dans la surcharge de cette méthode, le curseur sablier est ici automatiquement affiché.
	 * 
	 * @param event
	 *           ActionEvent
	 */
	@Override
	protected void fireActionPerformed(final ActionEvent event) {
		try {
			final MWaitCursor waitCursor = new MWaitCursor(this);
			try {
				super.fireActionPerformed(event);
			} finally {
				waitCursor.restore();
			}
		} catch (final Throwable t) { // NOPMD
			MSwingUtilities.showException(t);
		}
	}
}

@@ -1017,19 +1017,18 @@
 tem.%0D%0A *
- 
 %0D%0A
+
  * @auth
@@ -1242,33 +1242,32 @@
 nstructeur.%0D%0A%09 *
- 
 %0D%0A%09 * @param tex
@@ -1383,25 +1383,24 @@
 ucteur.%0D%0A%09 *
- 
 %0D%0A%09 * @param
@@ -1721,25 +1721,24 @@
 t item.%0D%0A%09 *
- 
 %0D%0A%09 * Dans l
@@ -1820,20 +1820,19 @@
 fich%C3%A9.%0D%0A
+
 %09 *
- 
 %0D%0A%09 * @p

remove trailing spaces