Search in sources :

Example 6 with ChangePartEvent

use of org.olat.modules.portfolio.ui.editor.event.ChangePartEvent in project openolat by klemens.

the class PageEditorController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (addCtrl == source) {
        if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
            PageElement element = addCtrl.getPageElement();
            AddElementInfos uobject = addCtrl.getUserObject();
            EditorFragment fragment = doAddPageElement(ureq, element, uobject.getReferenceFragment(), uobject.getTarget());
            // close editor right away (file upload etc makes more sense)
            doSaveElement(ureq, fragment);
        }
        cmc.deactivate();
        cleanUp();
    } else if (addElementsCtrl == source) {
        addCalloutCtrl.deactivate();
        cleanUp();
        if (event instanceof AddElementEvent) {
            AddElementEvent aee = (AddElementEvent) event;
            doAddElement(ureq, aee.getReferenceFragment(), aee.getHandler(), aee.getTarget());
        }
    } else if (addCalloutCtrl == source) {
        cleanUp();
    } else if (cmc == source) {
        cleanUp();
    } else if (isEditorPartController(source)) {
        EditorFragment fragment = getEditorFragment(source);
        if (event instanceof ChangePartEvent) {
            ChangePartEvent changeEvent = (ChangePartEvent) event;
            PageElement element = changeEvent.getElement();
            fragment.setPageElement(element);
            fireEvent(ureq, Event.CHANGED_EVENT);
        } else if (event instanceof ClosePartEvent) {
            doSaveElement(ureq, fragment);
        }
    }
    super.event(ureq, source, event);
}
Also used : ClosePartEvent(org.olat.modules.portfolio.ui.editor.event.ClosePartEvent) AddElementEvent(org.olat.modules.portfolio.ui.editor.event.AddElementEvent) ChangePartEvent(org.olat.modules.portfolio.ui.editor.event.ChangePartEvent)

Example 7 with ChangePartEvent

use of org.olat.modules.portfolio.ui.editor.event.ChangePartEvent in project openolat by klemens.

the class ImageMediaEditorController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (alignmentEl == source) {
        String alignment = alignmentEl.getSelectedKey();
        mediaPart.setLayoutOptions(alignment);
        mediaPart = portfolioService.updatePart(mediaPart);
        fireEvent(ureq, new ChangePartEvent(mediaPart));
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : ChangePartEvent(org.olat.modules.portfolio.ui.editor.event.ChangePartEvent)

Example 8 with ChangePartEvent

use of org.olat.modules.portfolio.ui.editor.event.ChangePartEvent in project openolat by klemens.

the class FileUploadEditorController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == fileLimitEl) {
        doSetMaxUploadSize();
    } else if (source == mimeTypesEl) {
        doSetMimeTypes();
    }
    fileUploadCtrl.update();
    fireEvent(ureq, new ChangePartEvent(fileUpload));
    super.formInnerEvent(ureq, source, event);
}
Also used : ChangePartEvent(org.olat.modules.portfolio.ui.editor.event.ChangePartEvent)

Example 9 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();
    html.setContent(content);
    String formattedContent = Formatter.formatLatexFormulas(content);
    staticItem.setValue(formattedContent);
    fireEvent(ureq, new ChangePartEvent(html));
}
Also used : ChangePartEvent(org.olat.modules.portfolio.ui.editor.event.ChangePartEvent)

Example 10 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();
        html.setContent(content);
        staticItem.setValue(content);
        fireEvent(ureq, new ChangePartEvent(html));
    }
    super.formInnerEvent(ureq, source, event);
}
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