Coverage Report - org.kuali.student.common.ui.client.widgets.list.KSCheckBoxList
 
Classes in this File Line Coverage Branch Coverage Complexity
KSCheckBoxList
0%
0/41
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.list;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import org.kuali.student.common.ui.client.mvc.Callback;
 21  
 import org.kuali.student.common.ui.client.widgets.list.impl.KSCheckBoxListImpl;
 22  
 
 23  
 import com.google.gwt.core.client.GWT;
 24  
 import com.google.gwt.event.dom.client.BlurHandler;
 25  
 import com.google.gwt.event.dom.client.FocusHandler;
 26  
 import com.google.gwt.event.dom.client.HasBlurHandlers;
 27  
 import com.google.gwt.event.dom.client.HasFocusHandlers;
 28  
 import com.google.gwt.event.shared.HandlerRegistration;
 29  
 import com.google.gwt.user.client.ui.Widget;
 30  
 
 31  
 
 32  
 /**
 33  
  * This is a description of what this class does - Will Gomes don't forget to fill this in. 
 34  
  * 
 35  
  * @author Kuali Student Team 
 36  
  *
 37  
  */
 38  
 public class KSCheckBoxList extends KSSelectItemWidgetAbstract implements HasBlurHandlers, HasFocusHandlers {
 39  0
     private KSCheckBoxListImpl selectItemWidget = GWT.create(KSCheckBoxListImpl.class);
 40  
 
 41  
     
 42  0
         public KSCheckBoxList(String name) {
 43  0
         initWidget(selectItemWidget);
 44  0
         selectItemWidget.setName(name);
 45  0
         }
 46  
         
 47  0
     public KSCheckBoxList() {
 48  0
         initWidget(selectItemWidget);
 49  0
     }
 50  
 
 51  
         /**
 52  
          * @see org.kuali.student.common.ui.client.widgets.list.KSSelectItemWidgetAbstract#deSelectItem(java.lang.String)
 53  
          */
 54  
         public void deSelectItem(String id) {
 55  0
             selectItemWidget.deSelectItem(id);        
 56  0
         }
 57  
 
 58  
         /**
 59  
          * @see org.kuali.student.common.ui.client.widgets.list.KSSelectItemWidgetAbstract#getSelectedItems()
 60  
          */
 61  
         public List<String> getSelectedItems() {
 62  0
             return selectItemWidget.getSelectedItems();
 63  
         }
 64  
 
 65  
         /**
 66  
          * @see org.kuali.student.common.ui.client.widgets.list.KSSelectItemWidgetAbstract#selectItem(java.lang.String)
 67  
          */
 68  
         public void selectItem(String id) {
 69  0
             selectItemWidget.selectItem(id);
 70  0
         }
 71  
 
 72  
     public void setListItems(ListItems listItems) {
 73  0
         selectItemWidget.setListItems(listItems);      
 74  0
     }
 75  
 
 76  
     /**
 77  
      * Use to set number of columns to use when displaying list
 78  
      * 
 79  
      */
 80  
     public void setColumnSize(int cols){
 81  0
         selectItemWidget.setColumnSize(cols);
 82  0
     }
 83  
         
 84  0
     public void setMultipleSelect(boolean isMultipleSelect) {}
 85  
 
 86  
     /**
 87  
      * This overridden method is not used
 88  
      * 
 89  
      * @see org.kuali.student.common.ui.client.widgets.list.KSSelectItemWidgetAbstract#onLoad()
 90  
      */
 91  
     @Override
 92  0
     public void onLoad() {}
 93  
    
 94  
     public HandlerRegistration addSelectionChangeHandler(SelectionChangeHandler handler) {
 95  0
         return selectItemWidget.addSelectionChangeHandler(handler);
 96  
     }
 97  
 
 98  
     public ListItems getListItems() {
 99  0
         return selectItemWidget.getListItems();
 100  
     }
 101  
 
 102  
     public String getName() {
 103  0
         return selectItemWidget.getName();
 104  
     }
 105  
 
 106  
     public void setName(String name) {
 107  0
         selectItemWidget.setName(name);
 108  0
     }
 109  
 
 110  
     @Override
 111  
     public void setEnabled(boolean b) {
 112  0
         selectItemWidget.setEnabled(b);
 113  0
     }
 114  
 
 115  
     @Override
 116  
     public boolean isEnabled() {
 117  0
         return selectItemWidget.isEnabled();
 118  
     }
 119  
 
 120  
     @Override
 121  
     public boolean isMultipleSelect() {
 122  0
         return selectItemWidget.isMultipleSelect();
 123  
     }
 124  
 
 125  
     @Override
 126  
     public void redraw() {
 127  0
         selectItemWidget.redraw();
 128  0
     }
 129  
 
 130  
     @Override
 131  
     public void clear() {
 132  0
         selectItemWidget.clear();
 133  0
     }
 134  
 
 135  
         @Override
 136  
         public HandlerRegistration addBlurHandler(BlurHandler handler) {
 137  0
                 return selectItemWidget.addBlurHandler(handler);
 138  
         }
 139  
 
 140  
         @Override
 141  
         public HandlerRegistration addFocusHandler(FocusHandler handler) {
 142  0
                 return selectItemWidget.addFocusHandler(handler);
 143  
         }
 144  
 
 145  
     public void addWidgetReadyCallback(Callback<Widget> callback) {
 146  0
         selectItemWidget.addWidgetReadyCallback(callback);
 147  0
     }
 148  
 
 149  
     public boolean isInitialized() {
 150  0
         return selectItemWidget.isInitialized();
 151  
     }
 152  
 
 153  
     public void setInitialized(boolean initialized) {
 154  0
         selectItemWidget.setInitialized(initialized);
 155  0
     }
 156  
     
 157  
     /**
 158  
      * By default if the list items used by the checkbox has multiple attributes, the checkbox
 159  
      * generated will display all attributes as columns. Set this property to true if this
 160  
      * behavior is not desired.
 161  
      * 
 162  
      * @param ignoreMultiple
 163  
      */
 164  
     public void setIgnoreMultipleAttributes(boolean ignoreMultiple){
 165  0
             selectItemWidget.setIgnoreMultipleAttributes(ignoreMultiple);
 166  0
     }
 167  
 }
 168  
 
 169