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 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 5 |
Complexity Density: 0.71 |
|
12 |
|
public class TextLinkageHelper { |
13 |
|
static String masterString; |
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
14 |
0
|
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() { |
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
19 |
0
|
@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 |
|
} |