Clover Coverage Report - KS Common 1.3.0-SNAPSHOT (Aggregated)
Coverage timestamp: Thu Apr 28 2011 06:00:36 EDT
../../../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
7   30   5   3.5
4   24   0.71   2
2     2.5  
1    
 
  TextLinkageHelper       Line # 12 7 0% 5 13 0% 0.0
 
No Tests
 
1    package org.kuali.student.common.ui.client.widgets;
2   
3    import com.google.gwt.event.dom.client.HasKeyUpHandlers;
4    import com.google.gwt.event.dom.client.KeyUpEvent;
5    import com.google.gwt.event.dom.client.KeyUpHandler;
6    import com.google.gwt.user.client.ui.HasText;
7    /**
8    * TextLinkageHelper is used to link two text fields. As you type in one field the text
9    * appears on the linked field.
10    *
11    * */
 
12    public class TextLinkageHelper {
13    static String masterString;
 
14  0 toggle public static void link(final HasText master, final HasText slave) {
15  0 masterString = master.getText();
16  0 if (master instanceof HasKeyUpHandlers) {
17  0 HasKeyUpHandlers masterTextBox = (HasKeyUpHandlers) master;
18  0 masterTextBox.addKeyUpHandler(new KeyUpHandler() {
 
19  0 toggle @Override
20    public void onKeyUp(KeyUpEvent event) {
21  0 if(masterString.equals(slave.getText())
22    ||"".equals(slave.getText()) ){
23  0 masterString = master.getText();
24  0 slave.setText(masterString);
25    }
26    }
27    });
28    }
29    }
30    }