-
Notifications
You must be signed in to change notification settings - Fork 5
/
GSCheckBoxWithValue.java
30 lines (23 loc) · 956 Bytes
/
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
package org.genericsystem.reactor.gs;
import org.genericsystem.reactor.ReactorStatics;
import org.genericsystem.reactor.gstag.GSCheckBox;
public class GSCheckBoxWithValue extends GSCheckBox {
public GSCheckBoxWithValue(GSTag parent) {
super(parent);
createNewProperty(ReactorStatics.VALUE);
bindOptionalBiDirectionalAttribute(ReactorStatics.VALUE, ReactorStatics.CHECKED, ReactorStatics.CHECKED);
}
public static class GSCheckBoxEditor extends GSCheckBoxWithValue {
public GSCheckBoxEditor(GSTag parent) {
super(parent);
initProperty(ReactorStatics.VALUE, model -> (Boolean) model.getGeneric().getValue());
bindActionToValueChangeListener(ReactorStatics.VALUE, (model, nva) -> model.getGeneric().updateValue(nva));
}
}
public static class GSCheckBoxDisplayer extends GSCheckBoxEditor {
public GSCheckBoxDisplayer(GSTag parent) {
super(parent);
addAttribute(ReactorStatics.DISABLED, ReactorStatics.DISABLED);
}
}
}