Coverage Report - org.kuali.student.lum.lu.ui.dependency.client.controllers.DependencyAnalysisController
 
Classes in this File Line Coverage Branch Coverage Complexity
DependencyAnalysisController
0%
0/20
0%
0/6
1.429
DependencyAnalysisController$DependencyViews
0%
0/2
N/A
1.429
 
 1  
 package org.kuali.student.lum.lu.ui.dependency.client.controllers;
 2  
 
 3  
 import java.util.List;
 4  
 
 5  
 import org.kuali.student.common.ui.client.configurable.mvc.layouts.BasicLayout;
 6  
 import org.kuali.student.common.ui.client.mvc.DataModel;
 7  
 import org.kuali.student.common.ui.client.util.ExportElement;
 8  
 import org.kuali.student.lum.lu.ui.dependency.client.views.DependencyAnalysisView;
 9  
 
 10  
 public class DependencyAnalysisController extends BasicLayout {
 11  
 
 12  0
     public enum DependencyViews {
 13  0
         MAIN
 14  
     };
 15  
 
 16  
     public DependencyAnalysisController(String controllerId) {
 17  0
         super(controllerId);
 18  0
         addView(new DependencyAnalysisView(this));
 19  0
         setDefaultView(DependencyViews.MAIN);
 20  0
     }
 21  
 
 22  
     public void showExport(boolean show) {
 23  0
         DependencyAnalysisView dependancyView = (DependencyAnalysisView) viewMap.get(DependencyViews.MAIN);
 24  0
         if (dependancyView.getHeader() != null) {
 25  0
             dependancyView.getHeader().showExport(isExportButtonActive());
 26  
 
 27  
         }
 28  0
     }
 29  
 
 30  
     @Override
 31  
     public boolean isExportButtonActive() {
 32  0
         return true;
 33  
     }
 34  
 
 35  
     @Override
 36  
     public DataModel getExportDataModel() {
 37  
         // TODO Auto-generated method stub
 38  0
         return super.getExportDataModel();
 39  
     }
 40  
 
 41  
     @Override
 42  
     public List<ExportElement> getExportElementsFromView() {
 43  0
         DependencyAnalysisView view = (DependencyAnalysisView) this.getCurrentView();
 44  0
         ExportElement element = new ExportElement();
 45  0
         element.setViewName(view.getName());
 46  0
         element.setSectionName("");
 47  0
         return view.getDepResultPanel().getExportElementSubset(element);
 48  
     }
 49  
 
 50  
     /**
 51  
      * @see org.kuali.student.common.ui.client.reporting.ReportExport#getExportTemplateName()
 52  
      */
 53  
     @Override
 54  
     public String getExportTemplateName() {
 55  0
         return "analysis.template";
 56  
     }
 57  
 
 58  
     /**
 59  
      * This overridden method return the view name when the controller name is null.
 60  
      * 
 61  
      * @see org.kuali.student.common.ui.client.configurable.mvc.LayoutController#getName()
 62  
      */
 63  
     @Override
 64  
     public String getName() {
 65  0
         String name = super.getName();
 66  0
         if ((name == null) && (this.getCurrentView() != null)) {
 67  0
             name = this.getCurrentView().getName();
 68  
         }
 69  0
         return name;
 70  
     }
 71  
 
 72  
 }