Search in sources :

Example 1 with TreeStringRenderer

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;
}
Also used : TreeStringRenderer(org.apache.ofbiz.widget.renderer.TreeStringRenderer) FormStringRenderer(org.apache.ofbiz.widget.renderer.FormStringRenderer) ModelTheme(org.apache.ofbiz.widget.model.ModelTheme) VisualTheme(org.apache.ofbiz.widget.renderer.VisualTheme) ScreenStringRenderer(org.apache.ofbiz.widget.renderer.ScreenStringRenderer) MenuStringRenderer(org.apache.ofbiz.widget.renderer.MenuStringRenderer)

Aggregations

ModelTheme (org.apache.ofbiz.widget.model.ModelTheme)1 FormStringRenderer (org.apache.ofbiz.widget.renderer.FormStringRenderer)1 MenuStringRenderer (org.apache.ofbiz.widget.renderer.MenuStringRenderer)1 ScreenStringRenderer (org.apache.ofbiz.widget.renderer.ScreenStringRenderer)1 TreeStringRenderer (org.apache.ofbiz.widget.renderer.TreeStringRenderer)1 VisualTheme (org.apache.ofbiz.widget.renderer.VisualTheme)1