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