Coverage Report - org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView
 
Classes in this File Line Coverage Branch Coverage Complexity
VerticalSectionView
0%
0/24
0%
0/10
1.833
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.common.ui.client.configurable.mvc.views;
 17  
 
 18  
 import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle;
 19  
 import org.kuali.student.common.ui.client.widgets.field.layout.layouts.VerticalFieldLayout;
 20  
 
 21  
 import com.google.gwt.user.client.ui.Widget;
 22  
 
 23  
 public class VerticalSectionView extends SectionView {
 24  
 
 25  
 
 26  
     public VerticalSectionView(Enum<?> viewEnum, String name, String modelId) {
 27  0
         this(viewEnum, name, modelId, true);
 28  0
     }
 29  
 
 30  
     public VerticalSectionView(Enum<?> viewEnum, String name, String modelId, boolean showTitle) {
 31  0
         super(viewEnum, name);
 32  0
         this.modelId = modelId;
 33  0
         if (name != null && !name.isEmpty()) {
 34  0
             SectionTitle sectionTitle = SectionTitle.generateH2Title(getName());
 35  0
             if (showTitle) {
 36  0
                 layout = new VerticalFieldLayout(sectionTitle);
 37  
             } else {
 38  0
                 layout = new VerticalFieldLayout();
 39  
             }
 40  0
         } else {
 41  0
             layout = new VerticalFieldLayout();
 42  
         }
 43  0
         this.add(layout);
 44  0
     }
 45  
 
 46  
     public VerticalSectionView(Enum<?> viewEnum, String name, String programModelId, Widget titleWidget) {
 47  0
         super(viewEnum, name);
 48  0
         this.modelId = programModelId;
 49  0
         layout = new VerticalFieldLayout(titleWidget);
 50  0
         this.add(layout);
 51  0
     }
 52  
 
 53  
     /**
 54  
      * This updates the model
 55  
      *
 56  
      * @see org.kuali.student.common.ui.client.mvc.View#updateModel()
 57  
      */
 58  
     @Override
 59  
     @SuppressWarnings("unchecked")
 60  
     public void updateModel() {
 61  0
         if (model != null && isValidationEnabled()) {
 62  0
             super.updateModel(model);
 63  
         }
 64  0
     }
 65  
 
 66  
     @Override
 67  
     public void clear() {
 68  
         // TODO Auto-generated method stub
 69  0
     }
 70  
 
 71  
     public void setSectionTitle(String title) {
 72  0
         layout.setLayoutTitle(SectionTitle.generateH2Title(title));
 73  0
     }
 74  
 }