| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.student.lum.common.client.lo; |
| 17 |
|
|
| 18 |
|
import java.util.List; |
| 19 |
|
|
| 20 |
|
import org.kuali.student.common.assembly.data.Data; |
| 21 |
|
import org.kuali.student.common.ui.client.widgets.KSLabel; |
| 22 |
|
import org.kuali.student.common.ui.client.widgets.KSTextArea; |
| 23 |
|
import org.kuali.student.common.ui.client.widgets.layout.VerticalFlowPanel; |
| 24 |
|
import org.kuali.student.common.ui.client.widgets.list.HasSelectionChangeHandlers; |
| 25 |
|
import org.kuali.student.common.ui.client.widgets.list.SelectionChangeEvent; |
| 26 |
|
import org.kuali.student.common.ui.client.widgets.list.SelectionChangeHandler; |
| 27 |
|
import org.kuali.student.lum.lo.dto.LoCategoryInfo; |
| 28 |
|
|
| 29 |
|
import com.google.gwt.event.dom.client.KeyUpEvent; |
| 30 |
|
import com.google.gwt.event.dom.client.KeyUpHandler; |
| 31 |
|
import com.google.gwt.event.logical.shared.ValueChangeEvent; |
| 32 |
|
import com.google.gwt.event.logical.shared.ValueChangeHandler; |
| 33 |
|
import com.google.gwt.event.shared.HandlerRegistration; |
| 34 |
|
import com.google.gwt.user.client.Window; |
| 35 |
|
import com.google.gwt.user.client.ui.HorizontalPanel; |
| 36 |
|
import com.google.gwt.user.client.ui.TextArea; |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
@author |
| 42 |
|
|
| 43 |
|
|
|
|
|
| 0% |
Uncovered Elements: 35 (35) |
Complexity: 12 |
Complexity Density: 0.52 |
|
| 44 |
|
public class LOPicker extends HorizontalPanel implements HasSelectionChangeHandlers{ |
| 45 |
|
KSLabel countLabel = new KSLabel(); |
| 46 |
|
KSTextArea loTextArea = new KSTextArea(countLabel, 250); |
| 47 |
|
VerticalFlowPanel vp = new VerticalFlowPanel(); |
| 48 |
|
LOCategoryBuilder loCategoryBuilder; |
| 49 |
|
Data metaInfoData; |
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 1 |
Complexity Density: 0.08 |
|
| 50 |
0
|
public LOPicker(String messageGroup, String type, String state, String loRepoKey) {... |
| 51 |
0
|
super(); |
| 52 |
0
|
loCategoryBuilder = new LOCategoryBuilder(messageGroup, type, state, loRepoKey); |
| 53 |
0
|
loTextArea.removeStyleName("ks-form-module-elements"); |
| 54 |
0
|
loTextArea.addStyleName("KS-LOTextArea"); |
| 55 |
0
|
countLabel.addStyleName("ks-form-module-elements-help-text"); |
| 56 |
0
|
countLabel.addStyleName("loText-count-label"); |
| 57 |
0
|
vp.add(loTextArea); |
| 58 |
0
|
vp.add(countLabel); |
| 59 |
0
|
super.add(vp); |
| 60 |
0
|
super.add(loCategoryBuilder); |
| 61 |
|
|
| 62 |
0
|
loTextArea.addValueChangeHandler(new ValueChangeHandler<String>(){ |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 63 |
0
|
public void onValueChange(ValueChangeEvent<String> event) {... |
| 64 |
0
|
fireChangeEvent(); |
| 65 |
|
} |
| 66 |
|
}); |
| 67 |
|
|
| 68 |
0
|
loCategoryBuilder.addValueChangeHandler(new ValueChangeHandler<List<LoCategoryInfo>>(){ |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 69 |
0
|
public void onValueChange(... |
| 70 |
|
ValueChangeEvent<List<LoCategoryInfo>> event) { |
| 71 |
0
|
fireChangeEvent(); |
| 72 |
|
} |
| 73 |
|
}); |
| 74 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 75 |
0
|
public void setLOCategories(List<LoCategoryInfo> categories){... |
| 76 |
0
|
loCategoryBuilder.setValue(categories); |
| 77 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 78 |
0
|
public List<LoCategoryInfo> getLoCategories(){... |
| 79 |
0
|
return loCategoryBuilder.getValue(); |
| 80 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 81 |
0
|
public String getLOText(){... |
| 82 |
0
|
return loTextArea.getText(); |
| 83 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 84 |
0
|
public void setLOText(String value){... |
| 85 |
0
|
loTextArea.setText(value); |
| 86 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 87 |
0
|
public Data getMetaInfoData() {... |
| 88 |
0
|
return metaInfoData; |
| 89 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 90 |
0
|
public void setMetaInfoData(Data metaInfoData) {... |
| 91 |
0
|
this.metaInfoData = metaInfoData; |
| 92 |
|
} |
| 93 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 94 |
0
|
@Override... |
| 95 |
|
public HandlerRegistration addSelectionChangeHandler(SelectionChangeHandler handler) { |
| 96 |
0
|
return addHandler(handler, SelectionChangeEvent.getType()); |
| 97 |
|
} |
| 98 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 99 |
0
|
public boolean hasChangeHandler(){... |
| 100 |
0
|
return this.getHandlerCount(SelectionChangeEvent.getType()) > 0; |
| 101 |
|
} |
| 102 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 103 |
0
|
private void fireChangeEvent(){... |
| 104 |
0
|
SelectionChangeEvent.fire(this); |
| 105 |
|
} |
| 106 |
|
} |