src/main/java/de/ipb_halle/molecularfaces/component/openvectoreditor/OpenVectorEditorRenderer.java
/*
	 * This is a bit tricky: The JSF implementations optimize resource rendering by
	 * rendering a specific resource (library name + resource name) only once. Thus,
	 * we cannot render via the standard renderers for scripts or stylesheets.
	 * Instead, this implementation builds the HTML tag itself.
	 */
This is a bit tricky: The JSF implementations optimize resource rendering by
rendering a specific resource (library name + resource name) only once. Thus,
we cannot render via the standard renderers for scripts or stylesheets.
Instead, this implementation builds the HTML tag itself.
This is a bit tricky : The JSF implementations optimize resource rendering by rendering a specific resource ( library name + resource name ) only once . Thus we cannot render via the standard renderers for scripts or stylesheets . Instead this implementation builds the HTML tag itself .
private void encodeResourceFromJSFResourceLibrary(FacesContext context, ResponseWriter writer, UIComponent component) throws IOException {
		Map<String, Object> attributes = component.getAttributes();
		String resourceName = (String) attributes.get("name");
		String library = (String) attributes.get("library");
		if ((resourceName == null) || resourceName.isEmpty()) {
			return;
		}
		Resource resource = context.getApplication().getResourceHandler().createResource(resourceName, library);
		if (resource == null) {
			LOGGER.warning("Resource not found: resourceName=" + resourceName
					+ (library != null ? ", library=" + library : ""));
			return;
		}
		String path = resource.getRequestPath();
		String url = context.getExternalContext().encodeResourceURL(path);
		encodeResource(writer, component, url);
	}
private void encodeResourceFromJSFResourceLibrary ( FacesContext context , ResponseWriter writer , UIComponent component ) throws IOException { Map < String , Object > attributes = component . getAttributes ( ) ; String resourceName = ( String ) attributes . get ( "name" ) ; String library = ( String ) attributes . get ( "library" ) ; if ( ( resourceName == null ) || resourceName . isEmpty ( ) ) { return ; } Resource resource = context . getApplication ( ) . getResourceHandler ( ) . createResource ( resourceName , library ) ; if ( resource == null ) { LOGGER . warning ( "Resource not found: resourceName=" + resourceName + ( library != null ? ", library=" + library : "" ) ) ; return ; } String path = resource . getRequestPath ( ) ; String url = context . getExternalContext ( ) . encodeResourceURL ( path ) ; encodeResource ( writer , component , url ) ; }
This is a bit tricky: The JSF implementations optimize resource rendering by
 rendering a specific resource (library name + resource name) only once.
This is a bit tricky : The JSF implementations optimize resource rendering by rendering a specific resource ( library name + resource name ) only once .