| 1 |  |   | 
  | 2 |  |   | 
  | 3 |  |   | 
  | 4 |  |   | 
  | 5 |  |   | 
  | 6 |  |   | 
  | 7 |  |   | 
  | 8 |  |   | 
  | 9 |  |   | 
  | 10 |  |   | 
  | 11 |  |   | 
  | 12 |  |   | 
  | 13 |  |   | 
  | 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 |  |   | 
  | 24 |  |   | 
  | 25 |  |   | 
  | 26 |  |   | 
  | 27 |  |   | 
  | 28 |  |   | 
  | 29 |  |   | 
  | 30 |  |   | 
  | 31 |  |   | 
  | 32 |  |  public class VerticalSectionView extends SectionView { | 
  | 33 |  |   | 
  | 34 |  |      public VerticalSectionView() { | 
  | 35 | 0 |          super(); | 
  | 36 | 0 |      } | 
  | 37 |  |   | 
  | 38 |  |       | 
  | 39 |  |   | 
  | 40 |  |   | 
  | 41 | 0 |      public VerticalSectionView(Enum<?> viewEnum, String name, String modelId) { | 
  | 42 | 0 |          init(viewEnum, name, modelId, true); | 
  | 43 | 0 |      } | 
  | 44 |  |   | 
  | 45 |  |       | 
  | 46 |  |   | 
  | 47 |  |   | 
  | 48 |  |   | 
  | 49 |  |   | 
  | 50 |  |   | 
  | 51 |  |      public VerticalSectionView(Enum<?> viewEnum, String name, String modelId, boolean showTitle) { | 
  | 52 | 0 |          super(viewEnum, name); | 
  | 53 | 0 |          this.modelId = modelId; | 
  | 54 | 0 |          if (name != null && !name.isEmpty()) { | 
  | 55 | 0 |              SectionTitle sectionTitle = SectionTitle.generateH2Title(getName()); | 
  | 56 | 0 |              if (showTitle) { | 
  | 57 | 0 |                  layout = new VerticalFieldLayout(sectionTitle); | 
  | 58 |  |              } else { | 
  | 59 | 0 |                  layout = new VerticalFieldLayout(); | 
  | 60 |  |              } | 
  | 61 | 0 |          } else { | 
  | 62 | 0 |              layout = new VerticalFieldLayout(); | 
  | 63 |  |          } | 
  | 64 | 0 |          this.add(layout); | 
  | 65 | 0 |      } | 
  | 66 |  |   | 
  | 67 |  |       | 
  | 68 |  |   | 
  | 69 |  |   | 
  | 70 |  |   | 
  | 71 |  |   | 
  | 72 |  |   | 
  | 73 |  |   | 
  | 74 |  |      public VerticalSectionView(Enum<?> viewEnum, String name, String modelId, Widget titleWidget) { | 
  | 75 | 0 |          super(viewEnum, name); | 
  | 76 | 0 |          this.modelId = modelId; | 
  | 77 | 0 |          layout = new VerticalFieldLayout(titleWidget); | 
  | 78 | 0 |          this.add(layout); | 
  | 79 | 0 |      } | 
  | 80 |  |   | 
  | 81 |  |      public void init(Enum<?> viewEnum, String name, String modelId, boolean showTitle) { | 
  | 82 | 0 |          super.init(viewEnum, name); | 
  | 83 | 0 |          this.modelId = modelId; | 
  | 84 | 0 |          if (name != null && !name.isEmpty()) { | 
  | 85 | 0 |              SectionTitle sectionTitle = SectionTitle.generateH2Title(getName()); | 
  | 86 | 0 |              if (showTitle) { | 
  | 87 | 0 |                  layout = new VerticalFieldLayout(sectionTitle); | 
  | 88 |  |              } else { | 
  | 89 | 0 |                  layout = new VerticalFieldLayout(); | 
  | 90 |  |              } | 
  | 91 | 0 |          } else { | 
  | 92 | 0 |              layout = new VerticalFieldLayout(); | 
  | 93 |  |          } | 
  | 94 | 0 |          this.add(layout); | 
  | 95 | 0 |      } | 
  | 96 |  |   | 
  | 97 |  |       | 
  | 98 |  |   | 
  | 99 |  |   | 
  | 100 |  |   | 
  | 101 |  |   | 
  | 102 |  |      @Override | 
  | 103 |  |      @SuppressWarnings("unchecked") | 
  | 104 |  |      public void updateModel() { | 
  | 105 | 0 |          if (model != null && isValidationEnabled()) { | 
  | 106 | 0 |              super.updateModel(model); | 
  | 107 |  |          } | 
  | 108 | 0 |      } | 
  | 109 |  |   | 
  | 110 |  |      @Override | 
  | 111 |  |      public void clear() { | 
  | 112 |  |           | 
  | 113 | 0 |      } | 
  | 114 |  |   | 
  | 115 |  |      public void setSectionTitle(String title) { | 
  | 116 | 0 |          layout.setLayoutTitle(SectionTitle.generateH2Title(title)); | 
  | 117 | 0 |      } | 
  | 118 |  |  } |