use of org.apache.ofbiz.widget.renderer.TreeStringRenderer in project ofbiz-framework by apache.
the class MacroScreenViewHandler method loadRenderers.
private ScreenStringRenderer loadRenderers(HttpServletRequest request, HttpServletResponse response, Map<String, Object> context, Writer writer) throws TemplateException, IOException {
VisualTheme visualTheme = UtilHttp.getVisualTheme(request);
ModelTheme modelTheme = visualTheme.getModelTheme();
String screenMacroLibraryPath = modelTheme.getScreenRendererLocation(getName());
String formMacroLibraryPath = modelTheme.getFormRendererLocation(getName());
String treeMacroLibraryPath = modelTheme.getTreeRendererLocation(getName());
String menuMacroLibraryPath = modelTheme.getMenuRendererLocation(getName());
ScreenStringRenderer screenStringRenderer = new MacroScreenRenderer(modelTheme.getType(getName()), screenMacroLibraryPath);
if (UtilValidate.isNotEmpty(formMacroLibraryPath)) {
FormStringRenderer formStringRenderer = new MacroFormRenderer(formMacroLibraryPath, request, response);
context.put("formStringRenderer", formStringRenderer);
}
if (UtilValidate.isNotEmpty(treeMacroLibraryPath)) {
TreeStringRenderer treeStringRenderer = new MacroTreeRenderer(treeMacroLibraryPath, writer);
context.put("treeStringRenderer", treeStringRenderer);
}
if (UtilValidate.isNotEmpty(menuMacroLibraryPath)) {
MenuStringRenderer menuStringRenderer = new MacroMenuRenderer(menuMacroLibraryPath, request, response);
context.put("menuStringRenderer", menuStringRenderer);
}
return screenStringRenderer;
}
Aggregations