-
Notifications
You must be signed in to change notification settings - Fork 5
/
GSLinkEditor.java
42 lines (33 loc) · 1.41 KB
/
GSLinkEditor.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
package org.genericsystem.reactor.ca_gscomponents;
import org.genericsystem.reactor.Tag;
import org.genericsystem.reactor.aa_modelproperties.ComponentsDefaults;
import org.genericsystem.reactor.aa_modelproperties.GSBuilderDefaults;
import org.genericsystem.reactor.ca_gscomponents.GSSingleLinkComponentEditor.GSLinkComponentBuilder;
import org.genericsystem.reactor.ca_gscomponents.GSSingleLinkComponentEditor.GSLinkComponentEditor;
public class GSLinkEditor extends GSDiv implements ComponentsDefaults {
protected GSSingleLinkComponentEditor components;
public GSLinkEditor(Tag parent) {
this(parent, GSLinkComponentEditor::new);
}
public GSLinkEditor(Tag parent, GSLinkComponentConstructor constructor) {
super(parent, FlexDirection.ROW);
createComponentsListProperty();
components = constructor.build(this);
}
@FunctionalInterface
public interface GSLinkComponentConstructor {
GSSingleLinkComponentEditor build(Tag parent);
}
public static class GSLinkBuilder extends GSLinkEditor implements GSBuilderDefaults {
public GSLinkBuilder(Tag parent) {
this(parent, GSLinkComponentBuilder::new);
}
public GSLinkBuilder(Tag parent, GSLinkComponentConstructor constructor) {
super(parent, constructor);
addPostfixBinding(model -> {
if (getComponentsMapProperty(model) != null)
getComponentsMapProperty(model).getValue().put(model.getGeneric(), getComponentsProperty(model).getValue());
});
}
}
}