Java Doc for RbCbRendererBase.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » renderer » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.renderer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.rave.web.ui.renderer.AbstractRenderer
   com.sun.rave.web.ui.renderer.RbCbRendererBase

All known Subclasses:   com.sun.rave.web.ui.renderer.CheckboxRenderer,  com.sun.rave.web.ui.renderer.RadioButtonRenderer,
RbCbRendererBase
abstract class RbCbRendererBase extends AbstractRenderer (Code)

The RbCbRendererBase class is the abstract base class for com.sun.rave.web.ui.renderer.RadioButtonRenderer and com.sun.rave.web.ui.renderer.CheckboxRenderer .

RbCbRendererBase provides encoding functionality for the RadioButtonRenderer and CheckboxRenderer. This includes an implementation of getConvertedValue, and a method called renderSelection which a subclass calls to render either a Checkbox or a RadioButton component at the appropriate time.
The renderer subclass must implement

  • isSelected in order for this class to generically render either component
  • getStyle so the specific subclass can specify the appropriate ThemeStyle constants.

Decoding

See com.sun.rave.web.ui.renderer.RadioButtonRenderer and com.sun.rave.web.ui.renderer.CheckboxRenderer for details on decoding requests.

Encoding

The renderer emits the following HTML elements.

The ID attributes for HTML elements are constructed as follows, where <cid> is the clientId of the component being rendered.

  • <cid> for the INPUT element
  • <cid>_image for the image component
  • <cid>_label for the label component
  • Encoding the INPUT element

    If the name property of the component is null the name attribute of the INPUT element will be set to the value of the component's clientId and the control will not be part of a group, and behave as an individual control.
    If the name property is not null then its value is used as the value of the name attribute of the HTML INPUT element and the control will behave as part of a group.

    The ConversionUtilities.getValueAsString method is called with the value of the component's selectedValue property and the result is used as the value of the HTML INPUT element's value attribute. The String value that is returned may be the actual value of the selectedValue property or the result of a conversion of a developer defined object value to a String or "true" if the selectedValue property was null or never assigned a value.The components com.sun.rave.web.ui.component.RadioButton and com.sun.rave.web.ui.component.Checkbox implement the behavior of returning "true" when selectedValue is null. Therefore if the component parameter is not one of these classes then this behavior may vary.

    If isSelected returns true the the value of the HTML INPUT element's checked attribute is set to "checked", otherwise the checked attribute is not rendered.

    The following component properties are obtained and rendered in turn and equivalent to the HTML INPUT element's attributes of the same name, but rendered in all lowercase.

    • disabled
    • readOnly
    • tabIndex
    • style
    • The component's toolTip property if not null is rendered as the value of the HTML INPUT element's title attribute.
      The HTML INPUT element's class attribute is set to the component's styleClass property appended with the value returned from a call to the getStyle method.

      Rendering the image component

      The renderer calls the component's getImageComponent method to obtain an instance of a com.sun.rave.web.ui.component.ImageComponent component. If null is returned, no image will appear with the control. If a non null instance is returned, the appropriate disabled or enabled style class returned by getStyle is appended to the image's styleClass property. RenderingUtilities.renderComponent is called to render the component.

      If an image is rendered it appears to the immediate left of the control.

      Encoding the label component

      The renderer calls the component's getLabelComponent method to obtain an instance of a com.sun.rave.web.ui.component.Label component. If null is returned, no label will appear with the control. If a non null instance is returned, the appropriate disabled or enabled style class returned by getStyle is appended to the label's styleClass property. RenderingUtilities.renderComponent is called to render the component.



    Field Summary
    final protected static  intIMAGE
         The define constant indicating the style class for the IMG element.
    final protected static  intIMAGE_DIS
         The define constant indicating the style class for a disabled IMG element.
    final protected static  intINPUT
         The define constant indicating the style class for an INPUT element.
    final protected static  intINPUT_DIS
         The define constant indicating the style class for a disabled INPUT element.
    final protected static  intLABEL
         The define constant indicating the style class for the LABEL element.
    final protected static  intLABEL_DIS
         The define constant indicating the style class for a disabled LABEL element.
    final public static  StringRBCB_EVENTS_ATTRIBUTES
        
    final protected static  intSPAN
        
    final protected static  intSPAN_DIS
         The define constant indicating the style class for for the containing span element, when disabled.

    Constructor Summary
    public  RbCbRendererBase()
        

    Method Summary
    public  voidencodeChildren(FacesContext context, UIComponent component)
         Render the child components of this UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.
    public  ObjectgetConvertedValue(FacesContext context, UIComponent component, Object submittedValue)
        

    Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered javax.faces.convert.Converter for this component, if there is one).

    abstract protected  StringgetStyle(Theme theme, int styleCode)
         The getStlye method is implemented by subclasses to return the actual CSS style class name for the given structural element of the rendered component.
    abstract protected  booleanisSelected(FacesContext context, UIComponent component)
         Implemented in the subclass to determine if the item is the currently selected control.
    protected  voidrenderImage(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer)
         Called from renderSelection to render an IMG element for the specified itemcontrol.
    protected  voidrenderInput(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer, String type)
         Called from renderSelection to render an INPUT element of type type for the specified component.
    protected  voidrenderLabel(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer)
         Called from renderSelection to render a LABEL.
    protected  voidrenderSelection(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer, String type)
         Render a radio button or a checkbox.

    Field Detail
    IMAGE
    final protected static int IMAGE(Code)
    The define constant indicating the style class for the IMG element.



    IMAGE_DIS
    final protected static int IMAGE_DIS(Code)
    The define constant indicating the style class for a disabled IMG element.



    INPUT
    final protected static int INPUT(Code)
    The define constant indicating the style class for an INPUT element.



    INPUT_DIS
    final protected static int INPUT_DIS(Code)
    The define constant indicating the style class for a disabled INPUT element.



    LABEL
    final protected static int LABEL(Code)
    The define constant indicating the style class for the LABEL element.



    LABEL_DIS
    final protected static int LABEL_DIS(Code)
    The define constant indicating the style class for a disabled LABEL element.



    RBCB_EVENTS_ATTRIBUTES
    final public static String RBCB_EVENTS_ATTRIBUTES(Code)

    The list of attribute names for Rb and Cb




    SPAN
    final protected static int SPAN(Code)
    The define constant indicating the style class for for the containing span element



    SPAN_DIS
    final protected static int SPAN_DIS(Code)
    The define constant indicating the style class for for the containing span element, when disabled.




    Constructor Detail
    RbCbRendererBase
    public RbCbRendererBase()(Code)
    Creates a new instance of RbCbRendererBase




    Method Detail
    encodeChildren
    public void encodeChildren(FacesContext context, UIComponent component) throws IOException(Code)
    Render the child components of this UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered. This method will only be called if the rendersChildren property of this component is true.
    Parameters:
      context - FacesContext for the request we are processing.
    Parameters:
      component - UIComponent to be decoded.



    getConvertedValue
    public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException(Code)

    Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered javax.faces.convert.Converter for this component, if there is one). If conversion is successful, the new value is returned and if not, a javax.faces.convert.ConverterException is thrown.


    Parameters:
      context - FacesContext for the request we are processing
    Parameters:
      component - component being renderer.
    Parameters:
      submittedValue - a value stored on the component duringdecode.
    exception:
      ConverterException - if the submitted valuecannot be converted successfully.
    exception:
      NullPointerException - if contextor component is null



    getStyle
    abstract protected String getStyle(Theme theme, int styleCode)(Code)
    The getStlye method is implemented by subclasses to return the actual CSS style class name for the given structural element of the rendered component.
    Parameters:
      theme - Theme for the request we are processing.
    Parameters:
      styleCode - one of the previously defined constants.



    isSelected
    abstract protected boolean isSelected(FacesContext context, UIComponent component)(Code)
    Implemented in the subclass to determine if the item is the currently selected control.
    Parameters:
      Object - selectedValue contol value.
    Parameters:
      currentValue - the value of the currently selected control.



    renderImage
    protected void renderImage(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer) throws IOException(Code)
    Called from renderSelection to render an IMG element for the specified itemcontrol.
    Parameters:
      context - FacesContext for the request we are processing.
    Parameters:
      component - UIComponent to be decoded.
    Parameters:
      writer - ResponseWriter to which the HTML willbe output



    renderInput
    protected void renderInput(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer, String type) throws IOException(Code)
    Called from renderSelection to render an INPUT element of type type for the specified component.
    Parameters:
      context - FacesContext for the request we are processing.
    Parameters:
      component - UIComponent to be rendered.
    Parameters:
      writer - ResponseWriter to which the HTML willbe output
    Parameters:
      type - the INPUT element type attribute value.



    renderLabel
    protected void renderLabel(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer) throws IOException(Code)
    Called from renderSelection to render a LABEL.
    Parameters:
      context - FacesContext for the request we are processing.
    Parameters:
      component - UIComponent to be decoded.
    Parameters:
      writer - ResponseWriter to which the HTML willbe output



    renderSelection
    protected void renderSelection(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer, String type) throws IOException(Code)
    Render a radio button or a checkbox.
    Parameters:
      context - FacesContext for the request we are processing.
    Parameters:
      component - UIComponent to be decoded.
    Parameters:
      writer - ResponseWriter to which the HTML willbe output
    Parameters:
      type - the INPUT element type attribute value.



    Fields inherited from com.sun.rave.web.ui.renderer.AbstractRenderer
    final protected static String BUNDLE(Code)(Java Doc)
    final public static String EVENTS_ATTRIBUTES(Code)(Java Doc)
    final public static String I18N_ATTRIBUTES(Code)(Java Doc)

    Methods inherited from com.sun.rave.web.ui.renderer.AbstractRenderer
    protected void addBooleanAttributes(FacesContext context, UIComponent component, ResponseWriter writer, String names) throws IOException(Code)(Java Doc)
    protected void addCoreAttributes(FacesContext context, UIComponent component, ResponseWriter writer, String styles) throws IOException(Code)(Java Doc)
    protected void addIntegerAttributes(FacesContext context, UIComponent component, ResponseWriter writer, String names) throws IOException(Code)(Java Doc)
    protected static void addStringAttributes(FacesContext context, UIComponent component, ResponseWriter writer, String names) throws IOException(Code)(Java Doc)
    public void decode(FacesContext context, UIComponent component)(Code)(Java Doc)
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException(Code)(Java Doc)
    public void encodeChildren(FacesContext context, UIComponent component) throws IOException(Code)(Java Doc)
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException(Code)(Java Doc)
    protected Application getApplication()(Code)(Java Doc)
    protected Object getAsObject(FacesContext context, UIComponent component, String value)(Code)(Java Doc)
    protected String getAsString(FacesContext context, UIComponent component)(Code)(Java Doc)
    protected ExternalContext getExternalContext()(Code)(Java Doc)
    protected FacesContext getFacesContext()(Code)(Java Doc)
    protected Object getSubmittedValue(FacesContext context, UIComponent component)(Code)(Java Doc)
    protected boolean isDisabled(UIComponent component)(Code)(Java Doc)
    protected boolean isPortlet(FacesContext context)(Code)(Java Doc)
    protected boolean isReadOnly(UIComponent component)(Code)(Java Doc)
    protected void renderAttributes(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException(Code)(Java Doc)
    protected void renderEnd(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException(Code)(Java Doc)
    protected void renderMarkup(FacesContext context, UIComponent component, ResponseWriter writer, Markup markup) throws IOException(Code)(Java Doc)
    protected void renderStart(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException(Code)(Java Doc)
    protected void setSubmittedValue(FacesContext context, UIComponent component)(Code)(Java Doc)

    www.java2java.com | Contact Us
    Copyright 2009 - 12 Demo Source and Support. All rights reserved.
    All other trademarks are property of their respective owners.