now remembering last clicked tabs
This commit is contained in:
@@ -440,13 +440,12 @@ public abstract class BaseClass implements Constants{
|
||||
formInputs.add(new AbstractMap.SimpleEntry<String, Tag>(t("Notes"),new TextArea(NOTES,notes)));
|
||||
|
||||
form(getClass().getSimpleName()+"-prop-form",formInputs)
|
||||
.addTo(new Fieldset(t("Basic properties")))
|
||||
.addTo(new Fieldset(t("Basic properties")).id("props-basic"))
|
||||
.addTo(win);
|
||||
|
||||
postForm.forEach(fieldset -> fieldset.addTo(win));
|
||||
|
||||
Fieldset customFields = new Fieldset(t("custom fields"));
|
||||
customFields.attr("id", "custom");
|
||||
Fieldset customFields = new Fieldset(t("custom fields")).id("props-custom");
|
||||
|
||||
Form customForm = new Form(CUSTOM_FIELDS);
|
||||
new Input(ACTION, ACTION_UPDATE).hideIn(customForm);
|
||||
|
||||
@@ -126,7 +126,7 @@ public class Locomotive extends Car implements Constants,Device{
|
||||
|
||||
HashMap<String,Object> params = new HashMap<String, Object>(Map.of(REALM,realm,ID,id));
|
||||
|
||||
Fieldset fieldset = new Fieldset(t("Control"));
|
||||
Fieldset fieldset = new Fieldset(t("Control")).id("props-cockpit");
|
||||
fieldset.clazz("cockpit");
|
||||
|
||||
new Tag("span").content(t("Current velocity: {} {}",speed,speedUnit)).addTo(fieldset);
|
||||
@@ -316,7 +316,7 @@ public class Locomotive extends Car implements Constants,Device{
|
||||
}
|
||||
|
||||
private Fieldset programming() {
|
||||
Fieldset fieldset = new Fieldset(t("Programming"));
|
||||
Fieldset fieldset = new Fieldset(t("Programming")).id("props-cv");
|
||||
|
||||
Form form = new Form("cv-form");
|
||||
new Input(REALM,REALM_LOCO).hideIn(form);
|
||||
|
||||
@@ -217,7 +217,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
||||
}
|
||||
|
||||
private Fieldset blockHistory() {
|
||||
Fieldset fieldset = new Fieldset(t("Last blocks"));
|
||||
Fieldset fieldset = new Fieldset(t("Last blocks")).id("props-history");
|
||||
Tag list = new Tag("ol");
|
||||
for (int i=lastBlocks.size(); i>0; i--) {
|
||||
lastBlocks.get(i-1).link().addTo(new Tag("li")).addTo(list);
|
||||
@@ -239,7 +239,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
||||
}
|
||||
|
||||
private Fieldset brakeTimes() {
|
||||
Fieldset fieldset = new Fieldset(t("Brake time table"));
|
||||
Fieldset fieldset = new Fieldset(t("Brake time table")).id("props-times");
|
||||
Table timeTable = new Table();
|
||||
timeTable.addRow(t("forward"),t("backward"),t("Route"));
|
||||
List<Route> routes = BaseClass.listElements(Route.class);
|
||||
@@ -698,7 +698,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
||||
formInputs.add(t("Tags"), new Input(TAGS,String.join(", ", tags)));
|
||||
|
||||
if (this.hasLoco()) preForm.add(Locomotive.cockpit(this));
|
||||
postForm.add(propList.addTo(new Fieldset(t("other train properties")).attr("id", "train-props")));
|
||||
postForm.add(propList.addTo(new Fieldset(t("other train properties")).id("props-other")));
|
||||
postForm.add(brakeTimes());
|
||||
postForm.add(blockHistory());
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ public abstract class Block extends StretchableTile{
|
||||
}
|
||||
|
||||
private Fieldset contactForm() {
|
||||
Fieldset fieldset = new Fieldset(t("internal contacts"));
|
||||
Fieldset fieldset = new Fieldset(t("internal contacts")).id("props-contacts");
|
||||
this.button(t("new contact"), Map.of(ACTION,ACTION_ADD_CONTACT)).addTo(fieldset);
|
||||
if (!internalContacts.isEmpty()) {
|
||||
Tag ul = new Tag("ul");
|
||||
@@ -455,7 +455,7 @@ public abstract class Block extends StretchableTile{
|
||||
}
|
||||
|
||||
public Fieldset waitTimeForm() {
|
||||
Fieldset win = new Fieldset(t("Wait times"));
|
||||
Fieldset win = new Fieldset(t("Wait times")).id("props-times");
|
||||
Form form = new Form("train-wait-form");
|
||||
new Tag("h4").content(t("Stop settings")).addTo(win);
|
||||
new Input(REALM,REALM_PLAN).hideIn(form);
|
||||
|
||||
@@ -197,8 +197,7 @@ public class Contact extends Tile{
|
||||
button(t("learn"),Map.of(ACTION,ACTION_ANALYZE)).addTo(span);
|
||||
formInputs.add(t("Address"),span);
|
||||
|
||||
Fieldset fieldset = new Fieldset(t("Actions"));
|
||||
fieldset.id("actions");
|
||||
Fieldset fieldset = new Fieldset(t("Actions")).id("props-actions");
|
||||
actions.list().addTo(fieldset);
|
||||
postForm.add(fieldset);
|
||||
return super.properties(preForm, formInputs, postForm);
|
||||
|
||||
@@ -128,8 +128,7 @@ public abstract class Signal extends Tile {
|
||||
|
||||
@Override
|
||||
protected Window properties(List<Fieldset> preForm, FormInput formInputs, List<Fieldset> postForm) {
|
||||
Fieldset aspectEditor = new Fieldset(t("Aspects"));
|
||||
aspectEditor.attr(ID, "aspect-editor");
|
||||
Fieldset aspectEditor = new Fieldset(t("Aspects")).id("props-aspects");
|
||||
Form form = new Form("aspect-form");
|
||||
new Input(REALM,REALM_PLAN).hideIn(form);
|
||||
new Input(ACTION,ACTION_UPDATE).hideIn(form);
|
||||
|
||||
@@ -270,7 +270,7 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
|
||||
if (isSet(train.route())) {
|
||||
train.button(t("stop"), Map.of(ACTION,ACTION_STOP)).addTo(fieldset);
|
||||
} else {
|
||||
train.button(t("start"), Map.of(ACTION,ACTION_START)).addTo(fieldset);
|
||||
train.button(t("depart"), Map.of(ACTION,ACTION_START)).addTo(fieldset);
|
||||
}
|
||||
if (train.usesAutopilot()) {
|
||||
train.button(t("quit autopilot"), Map.of(ACTION,ACTION_QUIT)).addTo(fieldset);
|
||||
@@ -300,7 +300,7 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
|
||||
|
||||
|
||||
if (!routes.isEmpty()) {
|
||||
fieldset = new Fieldset(t("Routes"));
|
||||
fieldset = new Fieldset(t("Routes")).id("props-routes");
|
||||
Tag routeList = new Tag("ol");
|
||||
boolean empty = true;
|
||||
for (Route route : routes) {
|
||||
|
||||
Reference in New Issue
Block a user