Coverage Report - org.jtheque.films.controllers.impl.SearchController
 
Classes in this File Line Coverage Branch Coverage Complexity
SearchController
0 %
0/9
N/A
1
 
 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.view.able.controller.AbstractController;
 20  
 import org.jtheque.films.controllers.able.ISearchController;
 21  
 import org.jtheque.films.services.impl.utils.search.Searcher;
 22  
 import org.jtheque.films.view.able.ISearchView;
 23  
 import org.jtheque.primary.controller.able.IPrincipalController;
 24  
 import org.jtheque.primary.od.able.Data;
 25  
 
 26  
 import javax.annotation.Resource;
 27  
 
 28  
 /**
 29  
  * A search controller implementation.
 30  
  *
 31  
  * @author Baptiste Wicht
 32  
  */
 33  0
 public final class SearchController extends AbstractController implements ISearchController {
 34  
     private IPrincipalController<? extends Data> actualController;
 35  
 
 36  
     @Resource
 37  
     private ISearchView searchView;
 38  
 
 39  
     @Override
 40  
     @SuppressWarnings("unchecked")
 41  
     public void search(Searcher searcher) {
 42  0
         actualController.getViewModel().updateDisplayList(searcher.search(actualController.getDisplayList()));
 43  
 
 44  0
         actualController.displayView();
 45  
 
 46  0
         closeView();
 47  0
     }
 48  
 
 49  
     @Override
 50  
     public void setResearchController(IPrincipalController<? extends Data> controller) {
 51  0
         actualController = controller;
 52  0
         searchView.setContentController(controller);
 53  0
     }
 54  
 
 55  
     @Override
 56  
     public ISearchView getView() {
 57  0
         return searchView;
 58  
     }
 59  
 }