Java Code Examples for javax.faces.context.FacesContext.getRenderKit()

The following are Jave code examples for showing how to use getRenderKit() of the javax.faces.context.FacesContext class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: myfaces-trinidad   File: UIXComponentBase.java   View Source Code Vote up 6 votes
private Renderer _getRendererImpl(FacesContext context)
{
  String rendererType = getRendererType();
  if (rendererType != null)
  {
    RenderKit renderKit = context.getRenderKit();
    Renderer renderer = renderKit.getRenderer(getFamily(), rendererType);
    if (renderer == null)
    {
      _LOG.warning("CANNOT_FIND_RENDERER", new Object[]{this, rendererType});
    }

    return renderer;
  }

  return null;
}
 
Example 2
Project: myfaces-trinidad   File: DialogServiceImpl.java   View Source Code Vote up 5 votes
static private DialogRenderKitService _getDialogRenderKitService(
  FacesContext context)
{
  RenderKit rk = context.getRenderKit();
  DialogRenderKitService service = 
     Service.getService(rk, DialogRenderKitService.class);

  if (service == null)
  {
    _LOG.info("RENDERKIT_NOT_SUPPORT_DIALOGRENDERKITSERVICE", rk);
  }

  return service;
}
 
Example 3
Project: myfaces-trinidad   File: RenderKitPerfTestCase.java   View Source Code Vote up 5 votes
private ExtendedRenderKitService _getExtendedRenderKitService(
  FacesContext context)
{
  RenderKit rk = context.getRenderKit();
  if (rk == null)
    throw new NullPointerException("No renderkit");

  return Service.getService(rk, ExtendedRenderKitService.class);
}
 
Example 4
Project: myfaces-trinidad   File: Service.java   View Source Code Vote up 5 votes
/**
 * A convenience for retrieving a service from the current RenderKit.
 */
static public <T> T getRenderKitService(FacesContext context,
                                        Class<T> serviceClass)
{
  // Provide a better exception than an NPE from inside of
  // Service.getService().
  RenderKit rk = context.getRenderKit();
  if (rk == null)
    throw new NullPointerException(_LOG.getMessage(
      "OBTAIN_NULL_RENDERKIT_WHILE_GETTING_SERVICE", serviceClass.getName()));
 

  return getService(rk, serviceClass);
}