use of org.olat.modules.portfolio.ui.editor.event.ChangePartEvent in project openolat by klemens.
the class RubricEditorController method formOK.
@Override
protected void formOK(UserRequest ureq) {
commitFields();
commitStepLabels();
String selectedType = typeEl.getSelectedKey();
SliderType type = SliderType.valueOf(selectedType);
rubric.setSliderType(type);
if (type == SliderType.continuous) {
rubric.setStart(1);
rubric.setEnd(100);
rubric.setSteps(100);
} else {
int steps = Integer.parseInt(stepsEl.getSelectedKey());
rubric.setStart(1);
rubric.setEnd(steps);
rubric.setSteps(steps);
}
for (Iterator<Slider> sliderIt = rubric.getSliders().iterator(); sliderIt.hasNext(); ) {
Slider slider = sliderIt.next();
if (!StringHelper.containsNonWhitespace(slider.getStartLabel()) && !StringHelper.containsNonWhitespace(slider.getEndLabel())) {
sliderIt.remove();
}
}
rubricCtrl.updateForm();
fireEvent(ureq, new ChangePartEvent(rubric));
fireEvent(ureq, new ClosePartEvent(rubric));
}
use of org.olat.modules.portfolio.ui.editor.event.ChangePartEvent in project openolat by klemens.
the class TextInputEditorController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (StringHelper.containsNonWhitespace(rowsEl.getValue())) {
try {
int rows = Integer.parseInt(rowsEl.getValue());
textInput.setRows(rows);
} catch (NumberFormatException e) {
logError("Cannot parse integer: " + rowsEl.getValue(), null);
}
}
textInputCtrl.update();
fireEvent(ureq, new ChangePartEvent(textInput));
fireEvent(ureq, new ClosePartEvent(textInput));
}
Aggregations