Coverage Report - org.kuali.student.common.ui.client.widgets.KSButton
 
Classes in this File Line Coverage Branch Coverage Complexity
KSButton
0%
0/45
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 org.kuali.student.common.ui.client.widgets.impl.KSButtonImpl;
 19  
 
 20  
 import com.google.gwt.core.client.GWT;
 21  
 import com.google.gwt.event.dom.client.ClickHandler;
 22  
 import com.google.gwt.event.dom.client.MouseOutHandler;
 23  
 import com.google.gwt.event.dom.client.MouseOverHandler;
 24  
 import com.google.gwt.event.shared.HandlerRegistration;
 25  
 
 26  
 /**
 27  
  * KSButton wraps gwt Button.  This class provides most of the same functionality, but sets KS css styles
 28  
  * for its default look and a variety of button events (for improved browser compatibility and customizability).
 29  
  * An image can be also be added to a KSButton (an improvement over gwt Button).
 30  
  * 
 31  
  * @author Kuali Student Team
 32  
  *
 33  
  */
 34  
 public class KSButton extends KSButtonAbstract{
 35  
         
 36  0
         KSButtonAbstract button = GWT.create(KSButtonImpl.class);
 37  
         
 38  
         public boolean isEnabled() {
 39  0
                 return button.isEnabled();
 40  
         }
 41  
 
 42  
         public void setEnabled(boolean enabled) {
 43  0
                 button.setEnabled(enabled);
 44  0
         }
 45  
         
 46  0
         public KSButton(){
 47  0
                 this.init();
 48  0
                 this.initWidget(button);
 49  0
         }
 50  
         
 51  0
         public KSButton(String text, ClickHandler handler){
 52  0
                 this.init(text, handler);
 53  0
                 this.initWidget(button);
 54  0
         }        
 55  
         
 56  0
         public KSButton(String text){
 57  0
                 this.init(text);
 58  0
                 this.initWidget(button);
 59  0
         }
 60  
         
 61  0
         public KSButton(String text, ButtonStyle style){
 62  0
                 this.init(text, style);
 63  0
                 this.initWidget(button);
 64  0
         }
 65  
 
 66  0
     public KSButton(String text, ButtonStyle style, ClickHandler handler){
 67  0
         this.init(text, style, handler);
 68  0
         this.initWidget(button);
 69  0
     }   
 70  
     
 71  
     public void setText(String text){
 72  0
         button.setText(text);
 73  0
     }
 74  
     
 75  
         @Override
 76  
         public HandlerRegistration addClickHandler(ClickHandler handler) {
 77  0
                 return button.addClickHandler(handler);
 78  
         }
 79  
 
 80  
         @Override
 81  
         public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
 82  0
                 return button.addMouseOverHandler(handler);
 83  
         }
 84  
 
 85  
         @Override
 86  
         public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
 87  0
                 return button.addMouseOutHandler(handler);
 88  
         }
 89  
 
 90  
     @Override
 91  
     public void init() {
 92  0
         button.init();
 93  0
     }        
 94  
         
 95  
         @Override
 96  
         public void init(String text) {
 97  0
                 button.init(text);
 98  0
         }
 99  
 
 100  
         @Override
 101  
         public void init(String text, ButtonStyle style) {
 102  0
                 button.init(text, style);                
 103  0
         }
 104  
 
 105  
     public void init(String text, ButtonStyle style, ClickHandler handler) {
 106  0
         button.init(text, style, handler);       
 107  0
     }        
 108  
         
 109  
         @Override
 110  
         public void init(String text, ClickHandler handler) {
 111  0
                 button.init(text, handler);
 112  0
         }
 113  
         
 114  
     @Override
 115  
     public void addStyleName(String style) {
 116  0
         button.addStyleName(style);
 117  0
     }
 118  
 
 119  
     @Override
 120  
     public void removeStyleName(String style) {
 121  0
         button.removeStyleName(style);
 122  0
     }
 123  
 
 124  
     @Override
 125  
     public void setStyleName(String style) {
 126  0
         button.setStyleName(style);
 127  0
     }        
 128  
 }