javax.faces.render.Renderer Java Examples
The following examples show how to use
javax.faces.render.Renderer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InputDateDetectRenderer.java From XPagesExtensionLibrary with Apache License 2.0 | 6 votes |
@Override public void encodeBegin(FacesContext context, UIComponent component) throws IOException { String newRendererType = detectNewRendererType(context, component); // modify the control, so that this renderer won't be used in future, // avoiding the overhead of delegation. Once this encode phase ends // the detected renderer will be used instead of this renderer. component.setRendererType(newRendererType); // save the value for use in encodeChildren and encodeEnd. HtmlUtil.storeEncodeParameter(context, component, "newRendererType", newRendererType); //$NON-NLS-1$ // the default implementation here and in the rest of the methods // is to delegate the rendering & decoding to the detected renderer Renderer delegate = findDelegate(context, component, newRendererType); delegate.encodeBegin(context, component); }
Example #2
Source File: RelaxedTagDecorator.java From BootsFaces-OSP with Apache License 2.0 | 5 votes |
private TagAttribute createElementName(Tag tag) { Location location = tag.getLocation(); String ns = Namespace.p.uri; String myLocalName = Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY; String qName = "p:" + myLocalName; String value = tag.getLocalName(); return TagAttributeUtilities.createTagAttribute(location, ns, myLocalName, qName, value); }
Example #3
Source File: TabRepeat.java From BootsFaces-OSP with Apache License 2.0 | 5 votes |
public boolean getRendersChildren() { if (getRendererType() != null) { Renderer renderer = getRenderer(getFacesContext()); if (renderer != null) { return renderer.getRendersChildren(); } } return true; }
Example #4
Source File: InputDateDetectRenderer.java From XPagesExtensionLibrary with Apache License 2.0 | 5 votes |
private Renderer findDelegate(FacesContext context, UIComponent component, String newRendererType) { String componentFamily = component.getFamily(); Renderer delegate = FacesUtil.getRenderer(context, componentFamily, newRendererType); if( null == delegate ){ // won't happen, the 2 renderer-types in the detect method both have registered renderers. throw new NullPointerException("Renderer is null for componentFamily="+componentFamily+" rendererType="+newRendererType); //$NON-NLS-1$ //$NON-NLS-2$ } return delegate; }
Example #5
Source File: InputDateDetectRenderer.java From XPagesExtensionLibrary with Apache License 2.0 | 5 votes |
@Override public void encodeChildren(FacesContext context, UIComponent component) throws IOException { String newRendererType = (String)HtmlUtil.readEncodeParameter(context, component, "newRendererType", /*remove*/false); //$NON-NLS-1$ Renderer delegate = findDelegate(context, component, newRendererType); if( delegate.getRendersChildren() ){ delegate.encodeChildren(context, component); }else{ // else implement here using the default implementation. FacesUtil.renderChildren(context, component); } }
Example #6
Source File: InputDateDetectRenderer.java From XPagesExtensionLibrary with Apache License 2.0 | 5 votes |
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { String newRendererType = (String)HtmlUtil.readEncodeParameter(context, component, "newRendererType", /*remove*/false); //$NON-NLS-1$ Renderer delegate = findDelegate(context, component, newRendererType); delegate.encodeEnd(context, component); HtmlUtil.removeEncodeParameter(context, component, "newRendererType"); //$NON-NLS-1$ }
Example #7
Source File: InputDateDetectRenderer.java From XPagesExtensionLibrary with Apache License 2.0 | 5 votes |
@Override public void decode(FacesContext context, UIComponent component) { // shouldn't usually happen, but default implementation provided in case of unusual use-cases, // like if some rendered property computation means that the control is not initially visible // during the encode phase but it then evaluates differently in the decode phase so that the control is decoded. String newRendererType = detectNewRendererType(context, component); Renderer delegate = findDelegate(context, component, newRendererType); delegate.decode(context, component); }
Example #8
Source File: InputDateDetectRenderer.java From XPagesExtensionLibrary with Apache License 2.0 | 5 votes |
@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { // shouldn't usually happen, can be invoked in some unusual use-cases (see comment in decode). // This occurs in the Process Validations phase, so the encode parameter won't be available // so re-compute the detectRendererType String newRendererType = detectNewRendererType(context, component); Renderer delegate = findDelegate(context, component, newRendererType); return delegate.getConvertedValue(context, component, submittedValue); }
Example #9
Source File: UIViewRootStub.java From development with Apache License 2.0 | 4 votes |
@Override protected Renderer getRenderer(FacesContext arg0) { throw new UnsupportedOperationException(); }
Example #10
Source File: UIInputStub.java From development with Apache License 2.0 | 4 votes |
@Override protected Renderer getRenderer(FacesContext arg0) { throw new UnsupportedOperationException(); }
Example #11
Source File: UIComponentStub.java From development with Apache License 2.0 | 4 votes |
@Override protected Renderer getRenderer(FacesContext arg0) { throw new UnsupportedOperationException(); }
Example #12
Source File: AbstractDataView.java From XPagesExtensionLibrary with Apache License 2.0 | 4 votes |
@Override public Renderer getRenderer(FacesContext context) { return getParent().getRenderer(context); }
Example #13
Source File: InputReadOnlyRendererTest.java From XPagesExtensionLibrary with Apache License 2.0 | 4 votes |
private String detail(String componentFamily, String readOnlyRendererType, Renderer readOnlyRenderer) { String className = (null == readOnlyRenderer)? null : readOnlyRenderer.getClass().getName(); return " family="+componentFamily+" readOnlyRendererType="+readOnlyRendererType+" readOnlyRendererClass="+className; }