Coverage Report - org.kuali.student.common.ui.client.widgets.buttongroups.SearchCancelGroup
 
Classes in this File Line Coverage Branch Coverage Complexity
SearchCancelGroup
0%
0/16
N/A
1
SearchCancelGroup$1
0%
0/3
N/A
1
SearchCancelGroup$2
0%
0/3
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.buttongroups;
 17  
 
 18  
 import org.kuali.student.common.ui.client.mvc.Callback;
 19  
 import org.kuali.student.common.ui.client.widgets.KSButton;
 20  
 import org.kuali.student.common.ui.client.widgets.KSButtonAbstract.ButtonStyle;
 21  
 import org.kuali.student.common.ui.client.widgets.buttongroups.ButtonEnumerations.SearchCancelEnum;
 22  
 import org.kuali.student.common.ui.client.widgets.buttonlayout.ButtonRow;
 23  
 
 24  
 import com.google.gwt.event.dom.client.ClickEvent;
 25  
 import com.google.gwt.event.dom.client.ClickHandler;
 26  
 
 27  
 public class SearchCancelGroup extends ButtonGroup<SearchCancelEnum>{
 28  
     
 29  0
     public SearchCancelGroup(Callback<SearchCancelEnum> callback){
 30  0
         layout = new ButtonRow();
 31  0
         this.addCallback(callback);
 32  
         
 33  0
         addButton(SearchCancelEnum.SEARCH);
 34  0
         addLinkToSecondaryGroup(SearchCancelEnum.CANCEL);
 35  
         
 36  0
         this.initWidget(layout);
 37  0
     }
 38  
     
 39  
     private void addButton(final SearchCancelEnum type){
 40  0
         KSButton button = new KSButton(type.getText(), new ClickHandler(){
 41  
             
 42  
             @Override
 43  
             public void onClick(ClickEvent event) {
 44  0
                 sendCallbacks(type);
 45  0
             }
 46  
         });
 47  0
         layout.addButton(button);
 48  0
         buttonMap.put(type, button);
 49  0
     }
 50  
     
 51  
     private void addLinkToSecondaryGroup(final SearchCancelEnum type){
 52  0
         KSButton button = new KSButton(type.getText(), ButtonStyle.DEFAULT_ANCHOR);
 53  0
         button.addClickHandler(new ClickHandler(){
 54  
             
 55  
             @Override
 56  
             public void onClick(ClickEvent event) {
 57  0
                 sendCallbacks(type);
 58  0
             }
 59  
         });
 60  0
         ((ButtonRow)layout).addButtonToSecondaryGroup(button);
 61  0
         buttonMap.put(type, button);
 62  0
     }
 63  
 }