Search in sources :

Example 1 with HTMLRaw

use of org.olat.modules.forms.model.xml.HTMLRaw in project OpenOLAT by OpenOLAT.

the class HTMLRawHandler method createPageElement.

@Override
public PageElement createPageElement(Locale locale) {
    Translator translator = Util.createPackageTranslator(HTMLRawEditorController.class, locale);
    String content = translator.translate("raw.example");
    HTMLRaw part = new HTMLRaw();
    part.setId(UUID.randomUUID().toString());
    part.setContent(content);
    return part;
}
Also used : Translator(org.olat.core.gui.translator.Translator) HTMLRaw(org.olat.modules.forms.model.xml.HTMLRaw)

Example 2 with HTMLRaw

use of org.olat.modules.forms.model.xml.HTMLRaw in project OpenOLAT by OpenOLAT.

the class HTMLRawHandler method getContent.

@Override
public PageRunElement getContent(UserRequest ureq, WindowControl wControl, PageElement element, PageElementRenderingHints hints) {
    String content = "";
    if (element instanceof HTMLRaw) {
        content = ((HTMLRaw) element).getContent();
    }
    Component cmp = TextFactory.createTextComponentFromString("htmlraw_" + CodeHelper.getRAMUniqueID(), content, null, false, null);
    return new PageRunComponent(cmp);
}
Also used : PageRunComponent(org.olat.modules.portfolio.ui.editor.PageRunComponent) HTMLRaw(org.olat.modules.forms.model.xml.HTMLRaw) Component(org.olat.core.gui.components.Component) PageRunComponent(org.olat.modules.portfolio.ui.editor.PageRunComponent)

Example 3 with HTMLRaw

use of org.olat.modules.forms.model.xml.HTMLRaw in project openolat by klemens.

the class HTMLRawHandler method createPageElement.

@Override
public PageElement createPageElement(Locale locale) {
    Translator translator = Util.createPackageTranslator(HTMLRawEditorController.class, locale);
    String content = translator.translate("raw.example");
    HTMLRaw part = new HTMLRaw();
    part.setId(UUID.randomUUID().toString());
    part.setContent(content);
    return part;
}
Also used : Translator(org.olat.core.gui.translator.Translator) HTMLRaw(org.olat.modules.forms.model.xml.HTMLRaw)

Example 4 with HTMLRaw

use of org.olat.modules.forms.model.xml.HTMLRaw in project openolat by klemens.

the class HTMLRawHandler method getContent.

@Override
public PageRunElement getContent(UserRequest ureq, WindowControl wControl, PageElement element, PageElementRenderingHints hints) {
    String content = "";
    if (element instanceof HTMLRaw) {
        content = ((HTMLRaw) element).getContent();
    }
    Component cmp = TextFactory.createTextComponentFromString("htmlraw_" + CodeHelper.getRAMUniqueID(), content, null, false, null);
    return new PageRunComponent(cmp);
}
Also used : PageRunComponent(org.olat.modules.portfolio.ui.editor.PageRunComponent) HTMLRaw(org.olat.modules.forms.model.xml.HTMLRaw) Component(org.olat.core.gui.components.Component) PageRunComponent(org.olat.modules.portfolio.ui.editor.PageRunComponent)

Aggregations

HTMLRaw (org.olat.modules.forms.model.xml.HTMLRaw)4 Component (org.olat.core.gui.components.Component)2 Translator (org.olat.core.gui.translator.Translator)2 PageRunComponent (org.olat.modules.portfolio.ui.editor.PageRunComponent)2