use of org.olat.modules.portfolio.ui.editor.event.ChangePartEvent in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
the class HTMLRawEditorController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (htmlItem == source) {
String content = htmlItem.getValue();
htmlPart.setContent(content);
htmlPart = portfolioService.updatePart(htmlPart);
String formattedContent = Formatter.formatLatexFormulas(contentOrExample(content));
staticItem.setValue(formattedContent);
fireEvent(ureq, new ChangePartEvent(htmlPart));
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.portfolio.ui.editor.event.ChangePartEvent in project openolat by klemens.
the class HTMLRawEditorController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (htmlItem == source) {
String content = htmlItem.getValue();
htmlPart.setContent(content);
htmlPart = portfolioService.updatePart(htmlPart);
String formattedContent = Formatter.formatLatexFormulas(contentOrExample(content));
staticItem.setValue(formattedContent);
fireEvent(ureq, new ChangePartEvent(htmlPart));
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.portfolio.ui.editor.event.ChangePartEvent in project openolat by klemens.
the class HTMLRawEditorController method formOK.
@Override
protected void formOK(UserRequest ureq) {
String content = htmlItem.getValue();
htmlPart.setContent(content);
htmlPart = portfolioService.updatePart(htmlPart);
String formattedContent = Formatter.formatLatexFormulas(contentOrExample(content));
staticItem.setValue(formattedContent);
fireEvent(ureq, new ChangePartEvent(htmlPart));
}
use of org.olat.modules.portfolio.ui.editor.event.ChangePartEvent in project openolat by klemens.
the class TitleEditorController method doSave.
private void doSave(UserRequest ureq) {
String content = titleItem.getValue();
titlePart.setContent(content);
titlePart = portfolioService.updatePart(titlePart);
staticItem.setValue(contentOrExample(content));
fireEvent(ureq, new ChangePartEvent(titlePart));
}
Aggregations