Coverage Report - org.jtheque.core.managers.view.impl.actions.utils.DisplayBeanViewAction
 
Classes in this File Line Coverage Branch Coverage Complexity
DisplayBeanViewAction
0 %
0/5
N/A
1
 
 1  
 package org.jtheque.core.managers.view.impl.actions.utils;
 2  
 
 3  
 import org.jtheque.core.managers.Managers;
 4  
 import org.jtheque.core.managers.beans.IBeansManager;
 5  
 import org.jtheque.core.managers.view.able.IView;
 6  
 import org.jtheque.core.managers.view.impl.actions.JThequeAction;
 7  
 
 8  
 import java.awt.event.ActionEvent;
 9  
 
 10  
 /*
 11  
  * This file is part of JTheque.
 12  
  *            
 13  
  * JTheque is free software: you can redistribute it and/or modify
 14  
  * it under the terms of the GNU General Public License as published by
 15  
  * the Free Software Foundation, either version 3 of the License. 
 16  
  *
 17  
  * JTheque is distributed in the hope that it will be useful,
 18  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 19  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 20  
  * GNU General Public License for more details.
 21  
  *
 22  
  * You should have received a copy of the GNU General Public License
 23  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 24  
  */
 25  
 
 26  
 /**
 27  
  * An action to display a view.
 28  
  *
 29  
  * @author Baptiste Wicht
 30  
  */
 31  
 public final class DisplayBeanViewAction extends JThequeAction {
 32  
     private final String view;
 33  
 
 34  
     /**
 35  
      * Construct a new DisplayViewAction with a specific internationalization key.
 36  
      *
 37  
      * @param key The i18n key.
 38  
      * @param view The name of the view to display. The view will be searched in the Spring context.
 39  
      */
 40  
     public DisplayBeanViewAction(String key, String view) {
 41  0
         super(key);
 42  
 
 43  0
         this.view = view;
 44  0
     }
 45  
 
 46  
     @Override
 47  
     public void actionPerformed(ActionEvent e) {
 48  0
         Managers.getManager(IBeansManager.class).<IView>getBean(view).display();
 49  0
     }
 50  
 }