Coverage Report - org.kuali.student.common.ui.client.widgets.KSLandingPage
 
Classes in this File Line Coverage Branch Coverage Complexity
KSLandingPage
0%
0/63
N/A
1
 
 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.widgets;
 17  
 
 18  
 import com.google.gwt.user.client.ui.Composite;
 19  
 import com.google.gwt.user.client.ui.HTML;
 20  
 import com.google.gwt.user.client.ui.HasHorizontalAlignment;
 21  
 import com.google.gwt.user.client.ui.HasVerticalAlignment;
 22  
 import com.google.gwt.user.client.ui.HorizontalPanel;
 23  
 import com.google.gwt.user.client.ui.Image;
 24  
 import com.google.gwt.user.client.ui.SimplePanel;
 25  
 import com.google.gwt.user.client.ui.VerticalPanel;
 26  
 import com.google.gwt.user.client.ui.Widget;
 27  
 
 28  
 public class KSLandingPage extends Composite{
 29  0
         private VerticalPanel layout = new VerticalPanel();
 30  0
         private SimplePanel wrapper = new SimplePanel();
 31  0
         private HorizontalPanel titlePanel = new HorizontalPanel();
 32  0
         private HorizontalPanel titleWidgetsPanel = new HorizontalPanel();
 33  0
         private HorizontalPanel innerLayout = new HorizontalPanel();
 34  0
         private VerticalPanel contentLayout = new VerticalPanel();
 35  0
         private VerticalPanel descLayout = new VerticalPanel();
 36  0
         private SimplePanel content = new SimplePanel();
 37  0
         private KSLabel titleLabel = new KSLabel();
 38  0
         private HTML largeDescription = new HTML();
 39  
 
 40  0
         public KSLandingPage(String title, String largeDescription){
 41  0
                 this.titleLabel.setText(title);
 42  0
                 this.largeDescription.setHTML(largeDescription);
 43  0
                 titlePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
 44  0
                 titlePanel.add(titleLabel);
 45  0
                 titlePanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
 46  0
                 titlePanel.add(titleWidgetsPanel);
 47  0
                 descLayout.add(this.largeDescription);
 48  0
                 contentLayout.add(descLayout);
 49  0
                 contentLayout.add(content);
 50  0
                 innerLayout.add(contentLayout);
 51  0
                 layout.add(titlePanel);
 52  0
                 layout.add(innerLayout);
 53  0
                 wrapper.setWidget(layout);
 54  0
                 this.largeDescription.addStyleName("KS-LandingPage-Description");
 55  0
                 this.titleLabel.addStyleName("KS-LandingPage-Title");
 56  0
                 this.layout.addStyleName("KS-LandingPage-Panel");
 57  0
                 this.innerLayout.addStyleName("KS-LandingPage-ContentPanel");
 58  0
                 this.titlePanel.addStyleName("KS-LandingPage-TitlePanel");
 59  0
                 this.wrapper.addStyleName("KS-LandingPage");
 60  
 
 61  0
                 this.initWidget(wrapper);
 62  
 
 63  0
         }
 64  
 
 65  0
         public KSLandingPage(String title, Image mainImage, String largeDescription){
 66  0
                 this.titleLabel.setText(title);
 67  0
                 this.largeDescription.setHTML(largeDescription);
 68  0
                 innerLayout.add(mainImage);
 69  
 
 70  0
                 titlePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
 71  0
                 titlePanel.add(titleLabel);
 72  0
                 titlePanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
 73  0
                 titlePanel.add(titleWidgetsPanel);
 74  0
                 descLayout.add(this.largeDescription);
 75  0
                 contentLayout.add(descLayout);
 76  0
                 contentLayout.add(content);
 77  0
                 innerLayout.add(contentLayout);
 78  
 
 79  0
                 layout.add(titlePanel);
 80  0
                 layout.add(innerLayout);
 81  0
                 wrapper.setWidget(layout);
 82  0
                 this.largeDescription.addStyleName("KS-LandingPage-Description");
 83  0
                 this.titleLabel.addStyleName("KS-LandingPage-Title");
 84  0
                 this.layout.addStyleName("KS-LandingPage-Panel");
 85  0
                 this.innerLayout.addStyleName("KS-LandingPage-ContentPanel");
 86  0
                 this.titlePanel.addStyleName("KS-LandingPage-TitlePanel");
 87  0
                 this.wrapper.addStyleName("KS-LandingPage");
 88  0
                 this.titleWidgetsPanel.addStyleName("KS-LandingPage-TitleWidgetsPanel");
 89  
 
 90  0
                 this.initWidget(wrapper);
 91  0
         }
 92  
 
 93  
         public void setContent(Widget content){
 94  0
                 this.content.setWidget(content);
 95  0
         }
 96  
 
 97  
         public void setSubDescWidget(Widget sub){
 98  0
                 descLayout.add(sub);
 99  0
         }
 100  
 
 101  
         public void addTitlePanelWidget(Widget widget){
 102  0
                 titleWidgetsPanel.setSpacing(5);
 103  0
                 titleWidgetsPanel.add(widget);
 104  0
         }
 105  
 }