Coverage Report - org.jtheque.films.view.impl.actions.auto.choice.AcValidateChoiceFieldsView
 
Classes in this File Line Coverage Branch Coverage Complexity
AcValidateChoiceFieldsView
0 %
0/15
N/A
1
 
 1  
 package org.jtheque.films.view.impl.actions.auto.choice;
 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.Managers;
 20  
 import org.jtheque.core.managers.beans.IBeansManager;
 21  
 import org.jtheque.core.managers.view.impl.actions.JThequeAction;
 22  
 import org.jtheque.films.controllers.able.IAutoAddController;
 23  
 import org.jtheque.films.services.impl.utils.EditArguments;
 24  
 import org.jtheque.films.view.able.IChoiceFieldsView;
 25  
 
 26  
 import javax.annotation.Resource;
 27  
 import java.awt.event.ActionEvent;
 28  
 
 29  
 /**
 30  
  * Action to validate the choice fields view.
 31  
  *
 32  
  * @author Baptiste Wicht
 33  
  */
 34  
 public final class AcValidateChoiceFieldsView extends JThequeAction {
 35  
     @Resource
 36  
     private IAutoAddController autoAddController;
 37  
 
 38  
     @Resource
 39  
     private IChoiceFieldsView choiceFieldsView;
 40  
 
 41  
     /**
 42  
      * Construct a new AcValidateChoiceFieldsView.
 43  
      */
 44  
     public AcValidateChoiceFieldsView() {
 45  0
         super("generic.view.actions.validate");
 46  
         
 47  0
         Managers.getManager(IBeansManager.class).inject(this);
 48  0
     }
 49  
 
 50  
     @Override
 51  
     public void actionPerformed(ActionEvent event) {
 52  0
         EditArguments args = new EditArguments();
 53  
 
 54  0
         args.setEditActors(choiceFieldsView.isBoxActorsSelected());
 55  0
         args.setEditDuration(choiceFieldsView.isBoxDurationSelected());
 56  0
         args.setEditImage(choiceFieldsView.isBoxImageSelected());
 57  0
         args.setEditKind(choiceFieldsView.isBoxKindSelected());
 58  0
         args.setEditRealizer(choiceFieldsView.isBoxRealizerSelected());
 59  0
         args.setEditYear(choiceFieldsView.isBoxYearSelected());
 60  0
         args.isEditResume(choiceFieldsView.isBoxResumeSelected());
 61  
 
 62  0
         autoAddController.setFields(args);
 63  0
         autoAddController.displayView();
 64  
 
 65  0
         choiceFieldsView.closeDown();
 66  0
     }
 67  
 }