use of com.github.bordertech.wcomponents.Renderer in project wcomponents by BorderTech.
the class UIManager method findTemplateRenderer.
/**
* Retrieves the template renderer for the given package.
*
* @param packageName the package to retrieve the template renderer for.
* @return the template renderer for the given package, or null if the package does not contain a template renderer.
* @deprecated Use {@link WTemplate} instead.
*/
@Deprecated
private synchronized Renderer findTemplateRenderer(final String packageName) {
RendererFactory factory = INSTANCE.findRendererFactory(packageName);
Renderer renderer = factory.getTemplateRenderer();
if (renderer == null) {
templateRenderers.put(packageName, NULL_RENDERER);
} else {
templateRenderers.put(packageName, renderer);
}
return renderer;
}
use of com.github.bordertech.wcomponents.Renderer in project wcomponents by BorderTech.
the class UIManager method getTemplateRenderer.
/**
* Retrieves a renderer which can renderer templates for the given context.
*
* @param context the render context.
* @return an appropriate renderer for the component and context, or null if a suitable renderer could not be found.
* @deprecated Use {@link WTemplate} instead.
*/
@Deprecated
public static Renderer getTemplateRenderer(final RenderContext context) {
String packageName = context.getRenderPackage();
Renderer renderer = INSTANCE.templateRenderers.get(packageName);
if (renderer == null) {
renderer = INSTANCE.findTemplateRenderer(packageName);
} else if (renderer == NULL_RENDERER) {
return null;
}
return renderer;
}
use of com.github.bordertech.wcomponents.Renderer in project wcomponents by BorderTech.
the class WPanelRenderer method renderChildren.
/**
* Paints the children contained within the panel. This defers rendering to a layout renderer (if available).
*
* @param panel the panel to paint.
* @param renderContext the RenderContext to paint to.
*/
private void renderChildren(final WPanel panel, final WebXmlRenderContext renderContext) {
LayoutManager layout = panel.getLayout();
Renderer layoutRenderer = null;
if (layout != null) {
layoutRenderer = new RendererFactoryImpl().getRenderer(layout.getClass());
}
if (layoutRenderer == null) {
renderContext.getWriter().appendTag("ui:content");
paintChildren(panel, renderContext);
renderContext.getWriter().appendEndTag("ui:content");
} else {
layoutRenderer.render(panel, renderContext);
}
}
Aggregations