001    /* JAPI - (Yet another (hopefully) useful) Java API
002     *
003     * Copyright (C) 2004-2006 Christian Hujer
004     *
005     * This program is free software; you can redistribute it and/or
006     * modify it under the terms of the GNU General Public License as
007     * published by the Free Software Foundation; either version 2 of the
008     * License, or (at your option) any later version.
009     *
010     * This program is distributed in the hope that it will be useful, but
011     * WITHOUT ANY WARRANTY; without even the implied warranty of
012     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013     * General Public License for more details.
014     *
015     * You should have received a copy of the GNU General Public License
016     * along with this program; if not, write to the Free Software
017     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
018     * 02111-1307, USA.
019     */
020    
021    package net.sf.japi.swing;
022    
023    import java.awt.event.ActionEvent;
024    import javax.swing.AbstractAction;
025    
026    /** Dummy Action implementation, an Action implementation which does nothing and only serves as an Action Property container.
027     * This is useful e.g. for JMenu, instances of which you can create using Action instances but where implementing the basic abstract method {@link
028     * ActionListener#actionPerformed(ActionEvent)} does not make any sense.
029     * This class is also an appropriate superclass for Action implementations that aren't interested in ActionEvents but other events.
030     * @author <a href="mailto:chris@riedquat.de">Christian Hujer</a>
031     */
032    public final class DummyAction extends AbstractAction {
033    
034        /** Serial Version. */
035        @SuppressWarnings({"AnalyzingVariableNaming"})
036        private static final long serialVersionUID = 1L;
037    
038        /** Create a Dummy Action. */
039        public DummyAction() {
040        }
041    
042        /** {@inheritDoc}
043         * The implementation of this method in DummyAction simply does nothing.
044         */
045        public void actionPerformed(final ActionEvent e) {
046            /* Do nothing, this is a Dummy Action. */
047        }
048    
049        /** {@inheritDoc} */
050        @Override protected Object clone() throws CloneNotSupportedException {
051            return super.clone();
052        }
053    
054    } // class DummyAction