| 1 |  | package org.kuali.student.common.ui.client.configurable.mvc.layouts; | 
            
  
    | 2 |  |  | 
            
  
    | 3 |  | import java.util.ArrayList; | 
            
  
    | 4 |  | import java.util.List; | 
            
  
    | 5 |  |  | 
            
  
    | 6 |  | import org.kuali.student.common.ui.client.configurable.mvc.LayoutController; | 
            
  
    | 7 |  | import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle; | 
            
  
    | 8 |  | import org.kuali.student.common.ui.client.mvc.Callback; | 
            
  
    | 9 |  | import org.kuali.student.common.ui.client.mvc.View; | 
            
  
    | 10 |  | import org.kuali.student.common.ui.client.mvc.history.HistoryManager; | 
            
  
    | 11 |  | import org.kuali.student.common.ui.client.util.ExportElement; | 
            
  
    | 12 |  | import org.kuali.student.common.ui.client.widgets.headers.KSDocumentHeader; | 
            
  
    | 13 |  | import org.kuali.student.common.ui.client.widgets.tabs.KSTabPanel; | 
            
  
    | 14 |  | import org.kuali.student.common.ui.client.widgets.tabs.KSTabPanel.TabPanelStyle; | 
            
  
    | 15 |  |  | 
            
  
    | 16 |  | import com.google.gwt.user.client.ui.FlowPanel; | 
            
  
    | 17 |  | import com.google.gwt.user.client.ui.Widget; | 
            
  
    | 18 |  |  | 
            
  
    | 19 |  |  | 
            
  
    | 20 |  |  | 
            
  
    | 21 |  |  | 
            
  
    | 22 |  |  | 
            
  
    | 23 |  | @author | 
            
  
    | 24 |  |  | 
            
  
    | 25 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 46 (46) | Complexity: 16 | Complexity Density: 0.55 |  | 
  
  
    | 26 |  | public class TabMenuController extends LayoutController{ | 
            
  
    | 27 |  |  | 
            
  
    | 28 |  | protected KSTabPanel tabPanel = new KSTabPanel(TabPanelStyle.SMALL); | 
            
  
    | 29 |  | protected FlowPanel layout = new FlowPanel(); | 
            
  
    | 30 |  | protected KSDocumentHeader header = new KSDocumentHeader(false); | 
            
  
    | 31 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 6 (6) | Complexity: 1 | Complexity Density: 0.17 |  | 
  
  
    | 32 | 0 |  public TabMenuController(String controllerId) {... | 
            
  
    | 33 | 0 | super(); | 
            
  
    | 34 | 0 | header.addStyleName("tabLayout-ContentHeader"); | 
            
  
    | 35 | 0 | layout.add(header); | 
            
  
    | 36 | 0 | header.setVisible(false); | 
            
  
    | 37 | 0 | layout.add(tabPanel); | 
            
  
    | 38 | 0 | this.initWidget(layout); | 
            
  
    | 39 |  | } | 
            
  
    | 40 |  |  | 
            
  
    | 41 |  |  | 
            
  
    | 42 |  |  | 
            
  
    | 43 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 44 | 0 |  public void setBasicTitle(String titleText){... | 
            
  
    | 45 | 0 | layout.insert(SectionTitle.generateH1Title(titleText), 0); | 
            
  
    | 46 |  | } | 
            
  
    | 47 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 2 (2) | Complexity: 1 | Complexity Density: 0.5 |  | 
  
  
    | 48 | 0 |  public void setContentTitle(String title){... | 
            
  
    | 49 | 0 | header.setTitle(title); | 
            
  
    | 50 | 0 | header.setVisible(true); | 
            
  
    | 51 |  | } | 
            
  
    | 52 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 2 (2) | Complexity: 1 | Complexity Density: 0.5 |  | 
  
  
    | 53 | 0 |  public void addContentWidget(Widget w){... | 
            
  
    | 54 | 0 | header.addWidget(w); | 
            
  
    | 55 | 0 | header.setVisible(true); | 
            
  
    | 56 |  | } | 
            
  
    | 57 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 3 (3) | Complexity: 1 | Complexity Density: 0.33 |  | 
  
  
    | 58 | 0 |  public void setContentInfo(String info){... | 
            
  
    | 59 | 0 | header.getInfoLabel().setHTML(info); | 
            
  
    | 60 | 0 | header.getInfoLabel().removeStyleName("content-warning"); | 
            
  
    | 61 | 0 | header.getInfoLabel().addStyleName("content-info"); | 
            
  
    | 62 |  | } | 
            
  
    | 63 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 3 (3) | Complexity: 1 | Complexity Density: 0.33 |  | 
  
  
    | 64 | 0 |  public void setContentWarning(String info){... | 
            
  
    | 65 | 0 | header.getInfoLabel().setHTML(info); | 
            
  
    | 66 | 0 | header.getInfoLabel().removeStyleName("content-info"); | 
            
  
    | 67 | 0 | header.getInfoLabel().addStyleName("content-warning"); | 
            
  
    | 68 |  |  | 
            
  
    | 69 |  | } | 
            
  
    | 70 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 71 | 0 |  public void showPrint(boolean show){... | 
            
  
    | 72 | 0 | header.showPrint(show); | 
            
  
    | 73 |  | } | 
            
  
    | 74 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 75 | 0 |  public void showExport(boolean show) {... | 
            
  
    | 76 | 0 | header.showExport(show); | 
            
  
    | 77 |  | } | 
            
  
    | 78 |  |  | 
            
  
    | 79 |  |  | 
            
  
    | 80 |  |  | 
            
  
    | 81 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 82 | 0 |  @Override... | 
            
  
    | 83 |  | public void updateModel() { | 
            
  
    | 84 | 0 | this.updateModelFromCurrentView(); | 
            
  
    | 85 |  | } | 
            
  
    | 86 |  |  | 
               
        |  |  | 
           
           |  | - | Uncovered Elements: 0 (0) | Complexity: 1 | Complexity Density: - |  | 
  
  
    | 87 | 0 |  @Override... | 
            
  
    | 88 |  | protected void hideView(View view) { | 
            
  
    | 89 |  |  | 
            
  
    | 90 |  | } | 
            
  
    | 91 |  |  | 
               
        |  |  | 
           
           |  | - | Uncovered Elements: 0 (0) | Complexity: 1 | Complexity Density: - |  | 
  
  
    | 92 | 0 |  @Override... | 
            
  
    | 93 |  | protected void renderView(View view) { | 
            
  
    | 94 |  |  | 
            
  
    | 95 |  | } | 
            
  
    | 96 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 5 (5) | Complexity: 2 | Complexity Density: 0.67 |  | 
  
  
    | 97 | 0 |  @Override... | 
            
  
    | 98 |  | public void showDefaultView(Callback<Boolean> onReadyCallback) { | 
            
  
    | 99 | 0 | super.showDefaultView(onReadyCallback); | 
            
  
    | 100 | 0 | if(this.defaultView != null){ | 
            
  
    | 101 | 0 | tabPanel.selectTab(this.defaultView.toString()); | 
            
  
    | 102 |  | } | 
            
  
    | 103 |  | } | 
            
  
    | 104 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 3 (3) | Complexity: 1 | Complexity Density: 0.33 |  | 
  
  
    | 105 | 0 |  public void addTab(final View view, String tabName){... | 
            
  
    | 106 | 0 | super.addView(view); | 
            
  
    | 107 | 0 | tabPanel.addTab(view.getViewEnum().toString(), tabName, view.asWidget()); | 
            
  
    | 108 | 0 | tabPanel.addTabCustomCallback(view.getViewEnum().toString(), new Callback<String>(){ | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 2 (2) | Complexity: 1 | Complexity Density: 0.5 |  | 
  
  
    | 109 | 0 |  @Override... | 
            
  
    | 110 |  | public void exec(String result) { | 
            
  
    | 111 | 0 | HistoryManager.setLogNavigationHistory(false); | 
            
  
    | 112 | 0 | showView(view.getViewEnum()); | 
            
  
    | 113 |  | } | 
            
  
    | 114 |  | }); | 
            
  
    | 115 |  | } | 
            
  
    | 116 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 117 | 0 |  @Override... | 
            
  
    | 118 |  | public List<ExportElement> getExportElementsFromView() { | 
            
  
    | 119 | 0 | return super.getExportElementsFromView(); | 
            
  
    | 120 |  |  | 
            
  
    | 121 |  | } | 
            
  
    | 122 |  | } |