Coverage Report - org.jtheque.primary.view.impl.actions.borrower.AcValidateBorrowerView
 
Classes in this File Line Coverage Branch Coverage Complexity
AcValidateBorrowerView
0 %
0/8
0 %
0/2
1.5
 
 1  
 package org.jtheque.primary.view.impl.actions.borrower;
 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.actions.JThequeAction;
 20  
 import org.jtheque.core.utils.CoreUtils;
 21  
 import org.jtheque.primary.controller.able.IBorrowerController;
 22  
 import org.jtheque.primary.view.able.IBorrowerView;
 23  
 
 24  
 import java.awt.event.ActionEvent;
 25  
 
 26  
 /**
 27  
  * An action to validate the borrower view.
 28  
  *
 29  
  * @author Baptiste Wicht
 30  
  */
 31  
 public final class AcValidateBorrowerView extends JThequeAction {
 32  
         /**
 33  
          * Construct a new AcValidateBorrowerView.
 34  
          */
 35  
         public AcValidateBorrowerView(){
 36  0
                 super("borrower.actions.ok");
 37  0
         }
 38  
 
 39  
         @Override
 40  
         public void actionPerformed(ActionEvent event){
 41  0
         IBorrowerController borrowerController = CoreUtils.getBean("borrowerController");
 42  0
         IBorrowerView borrowerView = (IBorrowerView)borrowerController.getView();
 43  
 
 44  0
                 if (borrowerView.validateContent()){
 45  0
                         borrowerController.save(
 46  
                                         borrowerView.getFieldFirstName().getText(),
 47  
                                         borrowerView.getFieldNom().getText(),
 48  
                                         borrowerView.getFieldEmail().getText());
 49  
 
 50  0
                         borrowerView.closeDown();
 51  
                 }
 52  0
         }
 53  
 }