Clover Coverage Report - Kuali Student 1.3.0-SNAPSHOT (Aggregated)
Coverage timestamp: Thu Apr 28 2011 05:03:32 EDT
../../../../../../../img/srcFileCovDistChart0.png 2% of files have more coverage
14   58   5   2.8
0   44   0.36   5
5     1  
1    
 
  EditableHeader       Line # 17 14 0% 5 19 0% 0.0
 
No Tests
 
1    package org.kuali.student.lum.program.client.widgets;
2   
3    import com.google.gwt.event.dom.client.ClickEvent;
4    import com.google.gwt.event.dom.client.ClickHandler;
5    import com.google.gwt.event.shared.HandlerManager;
6    import com.google.gwt.user.client.ui.Composite;
7    import com.google.gwt.user.client.ui.FlowPanel;
8    import org.kuali.student.common.ui.client.widgets.KSButton;
9    import org.kuali.student.common.ui.client.widgets.KSButtonAbstract;
10    import org.kuali.student.common.ui.client.widgets.KSLabel;
11    import org.kuali.student.lum.program.client.events.ChangeViewEvent;
12    import org.kuali.student.lum.program.client.properties.ProgramProperties;
13   
14    /**
15    * @author Igor
16    */
 
17    public class EditableHeader extends Composite {
18   
19    private FlowPanel content = new FlowPanel();
20   
21    private KSLabel sectionTitle;
22   
23    private KSButton editButton = new KSButton(ProgramProperties.get().common_edit(), KSButtonAbstract.ButtonStyle.DEFAULT_ANCHOR);
24   
25    private Enum<?> viewToken;
26   
27    private HandlerManager eventBus;
28   
 
29  0 toggle public EditableHeader(String title, Enum<?> viewToken, HandlerManager eventBus) {
30  0 initWidget(content);
31  0 this.eventBus = eventBus;
32  0 this.viewToken = viewToken;
33  0 sectionTitle = new KSLabel(title);
34  0 buildLayout();
35  0 setStyles();
36  0 bind();
37    }
38   
 
39  0 toggle private void bind() {
40  0 editButton.addClickHandler(new ClickHandler() {
 
41  0 toggle @Override
42    public void onClick(ClickEvent event) {
43  0 eventBus.fireEvent(new ChangeViewEvent(viewToken));
44    }
45    });
46    }
47   
 
48  0 toggle private void setStyles() {
49  0 sectionTitle.addStyleName("sectionTitle");
50  0 content.addStyleName("editableHeader");
51  0 editButton.addStyleName("sectionEditLink");
52    }
53   
 
54  0 toggle private void buildLayout() {
55  0 content.add(sectionTitle);
56  0 content.add(editButton);
57    }
58    }