use of com.liferay.faces.bridge.renderkit.primefaces.internal.FormRendererPrimeFacesImpl in project liferay-faces-bridge-impl by liferay.
the class RenderKitBridgeImpl method getRenderer.
@Override
public Renderer getRenderer(String family, String rendererType) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
ProductFactory productFactory = (ProductFactory) FactoryExtensionFinder.getFactory(externalContext, ProductFactory.class);
final Product PRIMEFACES = productFactory.getProductInfo(Product.Name.PRIMEFACES);
final boolean PRIMEFACES_DETECTED = PRIMEFACES.isDetected();
Renderer renderer = super.getRenderer(family, rendererType);
if (UIOutput.COMPONENT_FAMILY.equals(family)) {
if (JAVAX_FACES_HEAD.equals(rendererType)) {
final Product ICEFACES = productFactory.getProductInfo(Product.Name.ICEFACES);
final boolean ICEFACES_DETECTED = ICEFACES.isDetected();
if (ICEFACES_DETECTED) {
renderer = new HeadRendererICEfacesImpl();
} else if (PRIMEFACES_DETECTED) {
renderer = new HeadRendererPrimeFacesImpl();
} else {
renderer = new HeadRendererBridgeImpl();
}
} else if (JAVAX_FACES_BODY.equals(rendererType)) {
renderer = new BodyRendererBridgeImpl(renderer);
} else if (RenderKitUtil.SCRIPT_RENDERER_TYPE.equals(rendererType) || RenderKitUtil.STYLESHEET_RENDERER_TYPE.equals(rendererType)) {
renderer = new ResourceRendererBridgeImpl(renderer);
}
} else if (UIForm.COMPONENT_FAMILY.equals(family) && JAVAX_FACES_FORM.equals(rendererType) && PRIMEFACES_DETECTED) {
renderer = new FormRendererPrimeFacesImpl(PRIMEFACES.getMajorVersion(), PRIMEFACES.getMinorVersion(), renderer);
} else if (PRIMEFACES_FAMILY.equals(family) && PRIMEFACES_FILE_UPLOAD_RENDERER_TYPE.equals(rendererType)) {
renderer = new FileUploadRendererPortletImpl(renderer);
} else if (RICHFACES_FILE_UPLOAD_FAMILY.equals(family) && RICHFACES_FILE_UPLOAD_RENDERER_TYPE.equals(rendererType)) {
renderer = new FileUploadRendererPortletImpl(new FileUploadRendererRichFacesImpl(renderer));
}
return renderer;
}
Aggregations