-
Notifications
You must be signed in to change notification settings - Fork 5
/
GSEditor.java
91 lines (82 loc) · 2.12 KB
/
GSEditor.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package org.genericsystem.reactor.gs;
import org.genericsystem.reactor.gs.GSSubcellDisplayer.GSSubcellEditor;
import org.genericsystem.reactor.gs.GSSubcellDisplayer.InstanceLinkTitleDisplayer;
import org.genericsystem.reactor.gs.GSSubcellDisplayer.InstanceTitleDisplayer;
import org.genericsystem.reactor.gstag.GSH2;
import org.genericsystem.reactor.model.ObservableListExtractor;
import org.genericsystem.reactor.model.StringExtractor;
/**
* @author Nicolas Feybesse
*
* @param <M>
*/
public class GSEditor extends GSComposite {
public GSEditor(GSTag parent) {
this(parent, FlexDirection.COLUMN);
}
public GSEditor(GSTag parent, FlexDirection flexDirection) {
super(parent, flexDirection);
addStyle("flex", "1");
}
@Override
protected void header() {
new GSSection(this, GSEditor.this.getReverseDirection()) {
{
addStyle("flex", "0.3");
addStyle("background-color", "#ffa500");
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
addStyle("color", "red");
addStyle("justify-content", "center");
addStyle("align-items", "center");
new GSH2(this) {
{
setStringExtractor(StringExtractor.TYPE_INSTANCE_EXTRACTOR);
bindText();
}
};
}
};
}
@Override
protected void sections() {
new GSComposite(this, GSEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
}
@Override
protected void header() {
new GSSection(this, GSEditor.this.getDirection()) {
{
addStyle("flex", "0.3");
new InstanceTitleDisplayer(this);
new InstanceLinkTitleDisplayer(this) {
{
forEach_(ObservableListExtractor.ATTRIBUTES_OF_INSTANCES);
}
};
}
};
}
@Override
protected void sections() {
new GSSection(this, GSEditor.this.getDirection()) {
{
addStyle("flex", "1");
new GSSection(this, FlexDirection.COLUMN) {
{
addStyle("flex", "1");
new GSSubcellEditor(this);
}
};
new GSAttributeOfInstanceEditor(this) {
{
forEach_(ObservableListExtractor.ATTRIBUTES_OF_INSTANCES);
}
};
}
};
};
};
}
}