-
Notifications
You must be signed in to change notification settings - Fork 5
/
GSCheckBoxWithValue.java
46 lines (36 loc) · 1.46 KB
/
GSCheckBoxWithValue.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package org.genericsystem.reactor.az;
import org.genericsystem.reactor.ReactorStatics;
import org.genericsystem.reactor.Tag;
import org.genericsystem.reactor.gstag.HtmlCheckBox;
import org.genericsystem.reactor.modelproperties.ConvertedValueDefaults;
public class GSCheckBoxWithValue extends HtmlCheckBox implements ConvertedValueDefaults {
public GSCheckBoxWithValue() {
createConvertedValueProperty();
bindOptionalBiDirectionalAttribute(VALUE, ReactorStatics.CHECKED, ReactorStatics.CHECKED);
}
public GSCheckBoxWithValue(Tag parent) {
super(parent);
createConvertedValueProperty();
bindOptionalBiDirectionalAttribute(VALUE, ReactorStatics.CHECKED, ReactorStatics.CHECKED);
}
public static class GSCheckBoxEditor extends GSCheckBoxWithValue {
public GSCheckBoxEditor() {
initValueProperty(model -> (Boolean) model.getGeneric().getValue());
addConvertedValueChangeListener((model, nva) -> model.getGeneric().updateValue(nva));
}
public GSCheckBoxEditor(Tag parent) {
super(parent);
initValueProperty(model -> (Boolean) model.getGeneric().getValue());
addConvertedValueChangeListener((model, nva) -> model.getGeneric().updateValue(nva));
}
}
public static class GSCheckBoxDisplayer extends GSCheckBoxEditor {
public GSCheckBoxDisplayer() {
addAttribute(ReactorStatics.DISABLED, ReactorStatics.DISABLED);
}
public GSCheckBoxDisplayer(Tag parent) {
super(parent);
addAttribute(ReactorStatics.DISABLED, ReactorStatics.DISABLED);
}
}
}