use of it.vige.rubia.format.render.bbcodehtml.ToHTMLRenderer in project rubia-forums by flashboss.
the class ForumUtil method getToHTMLRenderer.
/**
* @param req
* the request that maybe contains the format object
* @return the renderer for the requested request
*/
private static ToHTMLRenderer getToHTMLRenderer(Object req) {
ToHTMLRenderer renderer = null;
// TODO: GETTING RENDERER FROM APPLICATION SCOPE ATTRIBUTE
if (renderer == null) {
// Getting ResourceBundle with current Locale
FacesContext ctx = getCurrentInstance();
UIViewRoot uiRoot = ctx.getViewRoot();
Locale locale = uiRoot.getLocale();
ClassLoader ldr = currentThread().getContextClassLoader();
ResourceBundle bundle = getBundle("ResourceJSF", locale, ldr);
// Create the HTMLRenderer for BBCode
ToHTMLConfig config = new ToHTMLConfig();
renderer = new ToHTMLRenderer(config, bundle);
}
return renderer;
}
Aggregations