updating actions
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
package de.srsoftware.web4rail.actions;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import de.srsoftware.web4rail.Window;
|
||||
import de.srsoftware.web4rail.moving.Train;
|
||||
import de.srsoftware.web4rail.tags.Button;
|
||||
import de.srsoftware.web4rail.tags.Form;
|
||||
import de.srsoftware.web4rail.tags.Input;
|
||||
import de.srsoftware.web4rail.tags.Label;
|
||||
import de.srsoftware.web4rail.tags.Select;
|
||||
import de.srsoftware.web4rail.tags.Fieldset;
|
||||
|
||||
public class SetContextTrain extends Action {
|
||||
|
||||
public SetContextTrain(Context parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
private Train train = null;
|
||||
|
||||
@Override
|
||||
@@ -46,20 +47,11 @@ public class SetContextTrain extends Action {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Window properties(HashMap<String, String> params) {
|
||||
Window win = super.properties(params);
|
||||
Form form = new Form("action-prop-form-"+id);
|
||||
new Input(REALM,REALM_ACTIONS).hideIn(form);
|
||||
new Input(ID,params.get(ID)).hideIn(form);
|
||||
new Input(ACTION,ACTION_UPDATE).hideIn(form);
|
||||
new Input(CONTEXT,params.get(CONTEXT)).hideIn(form);
|
||||
|
||||
Select select = Train.selector(train, null);
|
||||
select.addTo(new Label(t("Select train:")+NBSP)).addTo(form);
|
||||
|
||||
new Button(t("Apply"),form).addTo(form).addTo(win);
|
||||
return win;
|
||||
protected Window properties(List<Fieldset> preForm, FormInput formInputs, List<Fieldset> postForm) {
|
||||
formInputs.add(t("Select train"),Train.selector(train, null));
|
||||
return super.properties(preForm, formInputs, postForm);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
@@ -71,7 +63,7 @@ public class SetContextTrain extends Action {
|
||||
LOG.debug("update: {}",params);
|
||||
Id trainId = Id.from(params,Train.class.getSimpleName());
|
||||
if (isSet(trainId)) train = Train.get(trainId);
|
||||
return properties(params);
|
||||
return properties();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user