Search in sources :

Example 1 with ContextPair

use of org.olat.core.util.mail.ui.MailDataModel.ContextPair in project OpenOLAT by OpenOLAT.

the class MailContextCellRenderer method render.

@Override
public void render(StringOutput sb, Renderer renderer, Object val, Locale locale, int alignment, String action) {
    if (val instanceof ContextPair) {
        ContextPair context = (ContextPair) val;
        if (renderer == null) {
            StringHelper.escapeHtml(sb, context.getName());
        } else {
            String contextName = StringHelper.escapeHtml(context.getName());
            Link link = LinkFactory.createLink("bp_" + UUID.randomUUID().toString(), container, listeningController);
            link.setCustomDisplayText(contextName);
            link.setUserObject(context.getBusinessPath());
            URLBuilder ubu = renderer.getUrlBuilder().createCopyFor(link);
            RenderResult renderResult = new RenderResult();
            link.getHTMLRendererSingleton().render(renderer, sb, link, ubu, translator, renderResult, null);
        }
    }
}
Also used : RenderResult(org.olat.core.gui.render.RenderResult) Link(org.olat.core.gui.components.link.Link) ContextPair(org.olat.core.util.mail.ui.MailDataModel.ContextPair) URLBuilder(org.olat.core.gui.render.URLBuilder)

Example 2 with ContextPair

use of org.olat.core.util.mail.ui.MailDataModel.ContextPair in project openolat by klemens.

the class MailContextCellRenderer method render.

@Override
public void render(StringOutput sb, Renderer renderer, Object val, Locale locale, int alignment, String action) {
    if (val instanceof ContextPair) {
        ContextPair context = (ContextPair) val;
        if (renderer == null) {
            StringHelper.escapeHtml(sb, context.getName());
        } else {
            String contextName = StringHelper.escapeHtml(context.getName());
            Link link = LinkFactory.createLink("bp_" + UUID.randomUUID().toString(), container, listeningController);
            link.setCustomDisplayText(contextName);
            link.setUserObject(context.getBusinessPath());
            URLBuilder ubu = renderer.getUrlBuilder().createCopyFor(link);
            RenderResult renderResult = new RenderResult();
            link.getHTMLRendererSingleton().render(renderer, sb, link, ubu, translator, renderResult, null);
        }
    }
}
Also used : RenderResult(org.olat.core.gui.render.RenderResult) Link(org.olat.core.gui.components.link.Link) ContextPair(org.olat.core.util.mail.ui.MailDataModel.ContextPair) URLBuilder(org.olat.core.gui.render.URLBuilder)

Aggregations

Link (org.olat.core.gui.components.link.Link)2 RenderResult (org.olat.core.gui.render.RenderResult)2 URLBuilder (org.olat.core.gui.render.URLBuilder)2 ContextPair (org.olat.core.util.mail.ui.MailDataModel.ContextPair)2