/* (non-Javadoc) * @see uk.ac.ed.epcc.webapp.model.far.handler.QuestionFormHandler#buildConfigForm(uk.ac.ed.epcc.webapp.forms.Form) */ @Override public void buildConfigForm(Form f) { f.addInput(SINGLE_CONF, "Force single line", new BooleanInput()); IntegerInput max_input = new IntegerInput(); max_input.setOptional(true); max_input.setMin(1); f.addInput(MAX_RESULT_CONF, "Maximum result length", max_input); IntegerInput max_box = new IntegerInput(); max_box.setOptional(true); max_box.setMin(1); f.addInput(BOX_LENGTH_CONF, "Box length", max_box); }
/* (non-Javadoc) * @see uk.ac.ed.epcc.webapp.model.far.handler.QuestionFormHandler#parseConfiguration(uk.ac.ed.epcc.webapp.forms.Form) */ @Override public Input<String> parseConfiguration(Form f) { EmailListInput input = new EmailListInput(); input.setSingle((Boolean) f.get(SINGLE_CONF)); Integer max_result = (Integer) f.get(MAX_RESULT_CONF); if (max_result != null) { input.setMaxResultLength(max_result); } Integer max_box = (Integer) f.get(BOX_LENGTH_CONF); if (max_box != null) { input.setMaxResultLength(max_box); } return input; }
/* (non-Javadoc) * @see uk.ac.ed.epcc.webapp.forms.action.FormAction#action(uk.ac.ed.epcc.webapp.forms.Form) */ @Override public FormResult action(Form f) throws ActionException { return new ChainedTransitionResult( TestTransitionProvider.this, target.intValue() + (Integer) f.get("Value"), null); }
public void buildForm(Form f, T target, AppContext c) throws TransitionException { f.addAction("Yes", new ChainAction<T>(target, c, yes_transition)); f.addAction("No", new ChainAction<T>(target, c, no_transition)); }