-
Notifications
You must be signed in to change notification settings - Fork 5
/
GSStepEditor.java
60 lines (52 loc) · 1.56 KB
/
GSStepEditor.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
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.HtmlHyperLink;
public class GSStepEditor extends GSEditor implements SwitchDefaults {
protected GSTag switchedTag;
protected GSTag instanceNameTag;
public GSStepEditor(GSTag parent) {
this(parent, FlexDirection.COLUMN);
}
public GSStepEditor(GSTag parent, FlexDirection direction) {
super(parent, direction);
}
@Override
protected void sections() {
instanceNameTag = new GSSection(this, getDirection()) {
{
addStyle("flex", "1");
new InstanceTitleDisplayer(this).addStyle("flex", "0.3");
new GSSubcellEditor(this);
new StepNavigator(this, getReverseDirection());
}
};
switchedTag = new GSSection(this, getDirection()) {
{
addStyle("flex", "1");
new InstanceLinkTitleDisplayer(this).addStyle("flex", "0.3");
new GSAttributeOfInstanceEditor(this);
new StepNavigator(this, getReverseDirection());
}
};
}
public static class StepNavigator extends GSSection {
public StepNavigator(GSTag parent, FlexDirection direction) {
super(parent, direction);
addStyle("justify-content", "space-between");
new HtmlHyperLink(this) {
{
setText("<");
bindAction(model -> prev(model));
}
};
new HtmlHyperLink(this) {
{
setText(">");
bindAction(model -> next(model));
}
};
}
}
}