Coverage Report - org.jtheque.films.controllers.impl.SitesController
 
Classes in this File Line Coverage Branch Coverage Complexity
SitesController
0 %
0/8
N/A
1.5
 
 1  
 package org.jtheque.films.controllers.impl;
 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.log.IJThequeLogger;
 20  
 import org.jtheque.core.managers.log.Logger;
 21  
 import org.jtheque.core.managers.view.able.controller.AbstractController;
 22  
 import org.jtheque.films.controllers.able.ISitesController;
 23  
 import org.jtheque.films.utils.FileUtils;
 24  
 import org.jtheque.films.view.able.ISitesView;
 25  
 
 26  
 import javax.annotation.Resource;
 27  
 import javax.swing.event.ListSelectionEvent;
 28  
 import java.io.IOException;
 29  
 
 30  
 /**
 31  
  * A sites controller implementation.
 32  
  *
 33  
  * @author Baptiste Wicht
 34  
  */
 35  0
 public final class SitesController extends AbstractController implements ISitesController {
 36  
     @Resource
 37  
     private ISitesView sitesView;
 38  
 
 39  
     @Logger
 40  
     private IJThequeLogger logger;
 41  
 
 42  
     @Override
 43  
     public ISitesView getView() {
 44  0
         return sitesView;
 45  
     }
 46  
 
 47  
     @Override
 48  
     public void valueChanged(ListSelectionEvent event) {
 49  
         try {
 50  0
             sitesView.getSitesTextComponent().setPage(FileUtils.getLocalisedPage(
 51  
                     sitesView.getSelectedSite()));
 52  0
         } catch (IOException e1) {
 53  0
             sitesView.getSitesTextComponent().setText("");
 54  0
             logger.error(e1);
 55  0
         }
 56  0
     }
 57  
 }