public static boolean isRenderedScript(FacesContext facesContext, String libraryName, String resourceName) { return facesContext.getApplication().getResourceHandler().isResourceRendered( facesContext, resourceName, libraryName); }
/** * <p class="changed_added_2_3">The default behavior of this method * is to call {@link ResourceHandler#isResourceRendered(FacesContext, String, String)} on the * wrapped {@link ResourceHandler} object.</p> * * @since 2.3 */ @Override public boolean isResourceRendered(FacesContext context, String resourceName, String libraryName) { return getWrapped().isResourceRendered(context, resourceName, libraryName); }
/** * <p class="changed_added_2_3">The default behavior of this method * is to call {@link ResourceHandler#isResourceRendered(FacesContext, String, String)} on the * wrapped {@link ResourceHandler} object.</p> * * @since 2.3 */ @Override public boolean isResourceRendered(FacesContext context, String resourceName, String libraryName) { return getWrapped().isResourceRendered(context, resourceName, libraryName); }
/** * <p class="changed_added_2_3"> * The default behavior of this method is to call * {@link ResourceHandler#isResourceRendered(FacesContext, String, String)} on the wrapped * {@link ResourceHandler} object. * </p> * * @since 2.3 */ @Override public boolean isResourceRendered(FacesContext context, String resourceName, String libraryName) { return getWrapped().isResourceRendered(context, resourceName, libraryName); }
public static boolean isRenderedStylesheet(FacesContext facesContext, String libraryName, String resourceName) { return facesContext.getApplication().getResourceHandler().isResourceRendered( facesContext, resourceName, libraryName); }
/** * @since 2.3 * @param facesContext * @param resourceName * @param libraryName * @return */ @Override public boolean isResourceRendered(FacesContext facesContext, String resourceName, String libraryName) { return getWrapped().isResourceRendered(facesContext, resourceName, libraryName); } }
/** * <p class="changed_added_2_3"> * The default behavior of this method is to call * {@link ResourceHandler#isResourceRendered(FacesContext, String, String)} on the wrapped * {@link ResourceHandler} object. * </p> * * @since 2.3 */ @Override public boolean isResourceRendered(FacesContext context, String resourceName, String libraryName) { return getWrapped().isResourceRendered(context, resourceName, libraryName); }
/** * <p class="changed_added_2_3">The default behavior of this method * is to call {@link ResourceHandler#isResourceRendered(FacesContext, String, String)} on the * wrapped {@link ResourceHandler} object.</p> * * @since 2.3 */ @Override public boolean isResourceRendered(FacesContext context, String resourceName, String libraryName) { return getWrapped().isResourceRendered(context, resourceName, libraryName); }
/** * <p class="changed_added_2_3"> * The default behavior of this method is to call * {@link ResourceHandler#isResourceRendered(FacesContext, String, String)} on the wrapped * {@link ResourceHandler} object. * </p> * * @since 2.3 */ @Override public boolean isResourceRendered(FacesContext context, String resourceName, String libraryName) { return getWrapped().isResourceRendered(context, resourceName, libraryName); }
/** * <p class="changed_added_2_3"> * The default behavior of this method is to call * {@link ResourceHandler#isResourceRendered(FacesContext, String, String)} on the wrapped * {@link ResourceHandler} object. * </p> * * @since 2.3 */ @Override public boolean isResourceRendered(FacesContext context, String resourceName, String libraryName) { return getWrapped().isResourceRendered(context, resourceName, libraryName); }
/** * <p>Only install the JSF script resource if it doesn't exist. * The resource component will be installed with the target "head". * @param context the <code>FacesContext</code> for the current request */ public static void installJsfJsIfNecessary(FacesContext context) { if (isJsfJsInstalled(context)) { return; } ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); if (resourceHandler.isResourceRendered(context, JSF_SCRIPT_RESOURCE_NAME, JSF_SCRIPT_LIBRARY_NAME)) { return; } context.getViewRoot().addComponentResource(context, createJsfJs(), "head"); }
private void addScript(FacesContext context, UIComponent component, ResourceIdentifier id) { ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); if (resourceHandler.isResourceRendered(context, id.getName(), id.getLibrary())) { // This is true when o:deferredScript is used. componentResourcesToRemove.add(component); } else if (scripts.add(component, id)) { resourceHandler.markResourceRendered(context, id.getName(), id.getLibrary()); // Prevents future forced additions by libs. } }
/** * <p>Only install the JSF script resource if it doesn't exist. * The resource component will be installed with the target "head". * @param context the <code>FacesContext</code> for the current request */ public static void installJsfJsIfNecessary(FacesContext context) { if (isJsfJsInstalled(context)) { return; } ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); if (resourceHandler.isResourceRendered(context, JSF_SCRIPT_RESOURCE_NAME, JSF_SCRIPT_LIBRARY_NAME)) { return; } context.getViewRoot().addComponentResource(context, createJsfJs(), "head"); }
private void addScript(FacesContext context, UIComponent component, ResourceIdentifier id) { ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); if (resourceHandler.isResourceRendered(context, id.getName(), id.getLibrary())) { // This is true when o:deferredScript is used. componentResourcesToRemove.add(component); } else if (scripts.add(component, id)) { resourceHandler.markResourceRendered(context, id.getName(), id.getLibrary()); // Prevents future forced additions by libs. } }
/** * <p>Only install the JSF script resource if it doesn't exist. * The resource component will be installed with the target "head". * @param context the <code>FacesContext</code> for the current request */ public static void installJsfJsIfNecessary(FacesContext context) { if (isJsfJsInstalled(context)) { return; } ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); if (resourceHandler.isResourceRendered(context, JSF_SCRIPT_RESOURCE_NAME, JSF_SCRIPT_LIBRARY_NAME)) { return; } context.getViewRoot().addComponentResource(context, createJsfJs(), "head"); }
/** * <p>Renders the Javascript necessary to add and remove request * parameters to the current form.</p> * @param context the <code>FacesContext</code> for the current request * @throws java.io.IOException if an error occurs writing to the response */ public static void renderJsfJsIfNecessary(FacesContext context) throws IOException { if (isJsfJsInstalled(context)) { return; } ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); if (resourceHandler.isResourceRendered(context, JSF_SCRIPT_RESOURCE_NAME, JSF_SCRIPT_LIBRARY_NAME)) { return; } // Since we've now determined that it's not in the page, we need to manually render it. createJsfJs().encodeAll(context); resourceHandler.markResourceRendered(context, JSF_SCRIPT_RESOURCE_NAME, JSF_SCRIPT_LIBRARY_NAME); }
/** * <p>Renders the Javascript necessary to add and remove request * parameters to the current form.</p> * @param context the <code>FacesContext</code> for the current request * @throws java.io.IOException if an error occurs writing to the response */ public static void renderJsfJsIfNecessary(FacesContext context) throws IOException { if (isJsfJsInstalled(context)) { return; } ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); if (resourceHandler.isResourceRendered(context, JSF_SCRIPT_RESOURCE_NAME, JSF_SCRIPT_LIBRARY_NAME)) { return; } // Since we've now determined that it's not in the page, we need to manually render it. createJsfJs().encodeAll(context); resourceHandler.markResourceRendered(context, JSF_SCRIPT_RESOURCE_NAME, JSF_SCRIPT_LIBRARY_NAME); }
/** * <p>Renders the Javascript necessary to add and remove request * parameters to the current form.</p> * @param context the <code>FacesContext</code> for the current request * @throws java.io.IOException if an error occurs writing to the response */ public static void renderJsfJsIfNecessary(FacesContext context) throws IOException { if (isJsfJsInstalled(context)) { return; } ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); if (resourceHandler.isResourceRendered(context, JSF_SCRIPT_RESOURCE_NAME, JSF_SCRIPT_LIBRARY_NAME)) { return; } // Since we've now determined that it's not in the page, we need to manually render it. createJsfJs().encodeAll(context); resourceHandler.markResourceRendered(context, JSF_SCRIPT_RESOURCE_NAME, JSF_SCRIPT_LIBRARY_NAME); }
private void renderComponentResources(FacesContext context, UIViewRoot viewRoot) throws IOException { ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter(); boolean updateStarted = false; for (UIComponent resource : viewRoot.getComponentResources(context)) { String name = (String) resource.getAttributes().get("name"); String library = (String) resource.getAttributes().get("library"); if (resource.getChildCount() == 0 && resourceHandler.getRendererTypeForResourceName(name) != null && !resourceHandler.isResourceRendered(context, name, library)) { if (!updateStarted) { writer.startUpdate("javax.faces.Resource"); updateStarted = true; } resource.encodeAll(context); } } if (updateStarted) { writer.endUpdate(); } }
private void renderComponentResources(FacesContext context, UIViewRoot viewRoot) throws IOException { ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter(); boolean updateStarted = false; for (UIComponent resource : viewRoot.getComponentResources(context)) { String name = (String) resource.getAttributes().get("name"); String library = (String) resource.getAttributes().get("library"); if (resource.getChildCount() == 0 && resourceHandler.getRendererTypeForResourceName(name) != null && !resourceHandler.isResourceRendered(context, name, library)) { if (!updateStarted) { writer.startUpdate("javax.faces.Resource"); updateStarted = true; } resource.encodeAll(context); } } if (updateStarted) { writer.endUpdate(); } }