Search in sources :

Example 16 with ChangePartEvent

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));
}
Also used : ClosePartEvent(org.olat.modules.portfolio.ui.editor.event.ClosePartEvent) Slider(org.olat.modules.forms.model.xml.Slider) ChangePartEvent(org.olat.modules.portfolio.ui.editor.event.ChangePartEvent) SliderType(org.olat.modules.forms.model.xml.Rubric.SliderType)

Example 17 with ChangePartEvent

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);
}
Also used : ChangePartEvent(org.olat.modules.portfolio.ui.editor.event.ChangePartEvent)

Example 18 with ChangePartEvent

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);
}
Also used : ChangePartEvent(org.olat.modules.portfolio.ui.editor.event.ChangePartEvent)

Example 19 with ChangePartEvent

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));
}
Also used : ChangePartEvent(org.olat.modules.portfolio.ui.editor.event.ChangePartEvent)

Example 20 with ChangePartEvent

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));
}
Also used : ChangePartEvent(org.olat.modules.portfolio.ui.editor.event.ChangePartEvent)

Aggregations

ChangePartEvent (org.olat.modules.portfolio.ui.editor.event.ChangePartEvent)22 ClosePartEvent (org.olat.modules.portfolio.ui.editor.event.ClosePartEvent)6 SliderType (org.olat.modules.forms.model.xml.Rubric.SliderType)2 Slider (org.olat.modules.forms.model.xml.Slider)2 AddElementEvent (org.olat.modules.portfolio.ui.editor.event.AddElementEvent)2