Coverage Report - org.jtheque.films.view.impl.menus.JMenuBarLendings
 
Classes in this File Line Coverage Branch Coverage Complexity
JMenuBarLendings
0 %
0/10
N/A
1
 
 1  
 package org.jtheque.films.view.impl.menus;
 2  
 
 3  
 /*
 4  
  * This file is part of JTheque.
 5  
  *
 6  
  * JTheque is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License.
 9  
  *
 10  
  * JTheque is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
  * GNU General Public License for more details.
 14  
  *
 15  
  * You should have received a copy of the GNU General Public License
 16  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 17  
  */
 18  
 
 19  
 import org.jtheque.core.managers.view.impl.components.menu.JThequeMenu;
 20  
 import org.jtheque.core.managers.view.impl.components.menu.JThequeMenuItem;
 21  
 import org.jtheque.films.view.impl.actions.CloseBeanViewAction;
 22  
 import org.jtheque.films.view.impl.actions.DisplayBeanViewAction;
 23  
 import org.jtheque.films.view.impl.actions.lendings.AcReturnCurrentFilm;
 24  
 
 25  
 import javax.swing.Action;
 26  
 import javax.swing.JMenu;
 27  
 import javax.swing.JMenuBar;
 28  
 
 29  
 /**
 30  
  * The menu bar for the lendings frame.
 31  
  *
 32  
  * @author Baptiste Wicht
 33  
  */
 34  
 public final class JMenuBarLendings extends JMenuBar {
 35  
     private static final long serialVersionUID = -6264940478535994283L;
 36  
 
 37  
     /**
 38  
      * Construct a new <code>JMenuBarLendings</code>.
 39  
      */
 40  
     public JMenuBarLendings() {
 41  0
         super();
 42  
 
 43  0
         JMenu menu = new JThequeMenu("menu.lendings");
 44  
 
 45  0
         addAction(menu, new DisplayBeanViewAction("lendings.view.actions.lend", "lendFilmView"));
 46  0
         addAction(menu, new AcReturnCurrentFilm());
 47  
 
 48  0
         menu.addSeparator();
 49  
 
 50  0
         addAction(menu, new CloseBeanViewAction("generic.view.actions.close", "lendingsView"));
 51  
 
 52  0
         add(menu);
 53  0
     }
 54  
 
 55  
     /**
 56  
      * Add an action menu item to a menu.
 57  
      *
 58  
      * @param menu   The menu.
 59  
      * @param action The name of the action bean.
 60  
      */
 61  
     private static void addAction(JMenu menu, Action action) {
 62  0
         menu.add(new JThequeMenuItem(action));
 63  0
     }
 64  
 }