Coverage Report - org.jtheque.films.view.impl.actions.file.AcValidateImportView
 
Classes in this File Line Coverage Branch Coverage Complexity
AcValidateImportView
0 %
0/10
N/A
1.5
 
 1  
 package org.jtheque.films.view.impl.actions.file;
 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.error.IErrorManager;
 22  
 import org.jtheque.core.managers.error.InternationalizedError;
 23  
 import org.jtheque.core.managers.log.ILoggingManager;
 24  
 import org.jtheque.core.managers.view.impl.actions.JThequeAction;
 25  
 import org.jtheque.films.controllers.able.IImportController;
 26  
 import org.jtheque.utils.io.FileException;
 27  
 
 28  
 import java.awt.event.ActionEvent;
 29  
 
 30  
 /**
 31  
  * An action to validate the import view.
 32  
  *
 33  
  * @author Baptiste Wicht
 34  
  */
 35  
 public final class AcValidateImportView extends JThequeAction {
 36  
     /**
 37  
      * Construct a new AcValidateImportView.
 38  
      */
 39  
     public AcValidateImportView() {
 40  0
         super("generic.view.actions.validate");
 41  0
     }
 42  
 
 43  
     @Override
 44  
     public void actionPerformed(ActionEvent e) {
 45  0
         IImportController importController = Managers.getManager(IBeansManager.class).getBean("importController");
 46  
         
 47  
         try {
 48  0
             importController.importData(importController.getView().getFilePath());
 49  0
         } catch (FileException e1) {
 50  0
             Managers.getManager(ILoggingManager.class).getLogger(getClass()).error(e1);
 51  0
             Managers.getManager(IErrorManager.class).addError(new InternationalizedError(
 52  
                     "export.errors.file.filenotfound.title",
 53  
                     "export.errors.file.filenotfound" + importController.getView().getFilePath()));
 54  0
         }
 55  
 
 56  0
         importController.closeView();
 57  0
     }
 58  
 }