| java.lang.Object com.sun.rave.web.ui.util.RenderingUtilities
RenderingUtilities | public class RenderingUtilities (Code) | | author: avk |
Inner Class :protected static class Param | |
Constructor Summary | |
public | RenderingUtilities() Creates a new instance of RenderingUtilities. |
Method Summary | |
public static String | getJavascriptId(FacesContext context, UIComponent component) | public static String | getJsObjectName(FacesContext context, UIComponent component, String objectPrefix) | public static String | getJsObjectName(String clientId, String objectPrefix) | public static String | getLastClientID(FacesContext context) Get the client ID of the last component to have focus. | protected static Param[] | getParamList(FacesContext context, UIComponent command) | public static String | getStyleClasses(FacesContext context, UIComponent component, String styles) | public static void | includeJsp(FacesContext context, ResponseWriter writer, String jspURI) Perform a RequestDispatcher.include of the specified URI
jspURI .
The path identifed by jspURI must begin with
a <f:subview> tag. | public static boolean | isPortlet(FacesContext context) | public static boolean | isVisible(UIComponent component) Return whether the given UIComponent is "visible".
If the property is null, it will return true. | public static void | renderAnchor(String anchorName, UIComponent component, FacesContext context) | public static void | renderComponent(UIComponent component, FacesContext context) Render a component. | public static void | renderExtraHtmlAttributes(ResponseWriter writer, String extraHtml) Helper method to render extra attributes. | public static void | renderHiddenField(UIComponent component, ResponseWriter writer, String id, String value) This method will output a hidden field for use with Params and components
that need to submit a value through a hidden field.
Note: The name of the hidden field will be written as is. | public static void | renderJavaScript(UIComponent component, Theme theme, FacesContext context, ResponseWriter writer) | public static boolean | renderJsInclude(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer, String includeFile) Return true if the javascript file identified by
includeFile is included. | public static boolean | renderJsObject(FacesContext context, UIComponent component, ResponseWriter writer, String objectName, String jsObjectClass, String arguments) | public static void | renderSkipLink(String anchorName, String styleClass, String style, String toolTip, Integer tabIndex, UIComponent component, FacesContext context) | public static void | renderSpacer(ResponseWriter writer, UIComponent component, String dotSrc, int height, int width) Helper function to render a transparent spacer image. | public static void | renderSpacer(FacesContext context, ResponseWriter writer, UIComponent component, int height, int width) Helper function to render a transparent spacer image. | public static void | renderStyleClass(FacesContext context, ResponseWriter writer, UIComponent component, String extraStyles) | public static String | renderStyleClass(FacesContext context, ResponseWriter writer, UIComponent component, String styleClass, String extraHtml) Helper method to render style classes when name/value pairs are given
via an extraHtml String. | public static void | renderStyleSheetInline(UIComponent component, Theme theme, FacesContext context, ResponseWriter writer) | public static void | renderStyleSheetLink(UIComponent component, Theme theme, FacesContext context, ResponseWriter writer) | public static void | renderURLAttribute(FacesContext context, ResponseWriter writer, UIComponent component, String name, String url, String compPropName) Helper function to render a typical URL
Parameters: writer - The current ResponseWriter Parameters: component - The uicomponent Parameters: name - The attribute name of the url to write out Parameters: url - The value passed in by the developer for the url Parameters: compPropName - The property name of the component's property that specifies this property. | public static void | setLastClientID(FacesContext context, String clientId) Set the client ID of the last component to have focus. | public static void | writeStringAttributes(UIComponent component, ResponseWriter writer, String[] possibleAttributes) This method goes through an array of possible attribute names,
evaluates if they have been set on the component, and writes
them out using the specified writer. | public static void | writeStringAttributes(UIComponent component, ResponseWriter writer, String names, String extraHtml) Add any attributes on the specified list directly to the specified
ResponseWriter for which the specified UIComponent has a non-null String
value. |
COLON_CHAR | final public static char COLON_CHAR(Code) | | |
USCORE_CHAR | final public static char USCORE_CHAR(Code) | | |
RenderingUtilities | public RenderingUtilities()(Code) | | Creates a new instance of RenderingUtilities.
|
getJavascriptId | public static String getJavascriptId(FacesContext context, UIComponent component)(Code) | | |
getJsObjectName | public static String getJsObjectName(FacesContext context, UIComponent component, String objectPrefix)(Code) | | |
getLastClientID | public static String getLastClientID(FacesContext context)(Code) | | Get the client ID of the last component to have focus.
|
getParamList | protected static Param[] getParamList(FacesContext context, UIComponent command)(Code) | | |
getStyleClasses | public static String getStyleClasses(FacesContext context, UIComponent component, String styles)(Code) | | Return a space-separated list of CSS style classes to render for
this component, or null for none.
Parameters: component - UIComponent for which to calculate classes Parameters: styles - Additional styles specified by the renderer |
includeJsp | public static void includeJsp(FacesContext context, ResponseWriter writer, String jspURI) throws IOException(Code) | | Perform a RequestDispatcher.include of the specified URI
jspURI .
The path identifed by jspURI must begin with
a <f:subview> tag. The URI must not have
as part of its path the FacesServlet mapping. For example if the
FacesServlet mapping maps to /faces/* then
jspURI must not have /faces/ as part of
its path.
If jspUIR is a relative path then the
request context path is prepended to it.
Parameters: context - the FacesContext for this request Parameters: writer - the ResponseWrite destination for therendered output Parameters: jspURI - the URI identifying a JSP page to be included. throws: IOException - if response can't be written or jspURI cannot be included. Real cause is chained. |
isPortlet | public static boolean isPortlet(FacesContext context)(Code) | | |
isVisible | public static boolean isVisible(UIComponent component)(Code) | | Return whether the given UIComponent is "visible".
If the property is null, it will return true. Otherwise the value
of the property is returned.
Parameters: component - The UIComponent to check True if the property is null or true, false otherwise. |
renderAnchor | public static void renderAnchor(String anchorName, UIComponent component, FacesContext context) throws IOException(Code) | | |
renderComponent | public static void renderComponent(UIComponent component, FacesContext context) throws IOException(Code) | | Render a component.
Parameters: component - The component to render Parameters: context - The FacesContext of the request |
renderExtraHtmlAttributes | public static void renderExtraHtmlAttributes(ResponseWriter writer, String extraHtml) throws IOException(Code) | | Helper method to render extra attributes.
Parameters: writer - ResponseWriter to which the elementend should be rendered Parameters: extraHtml - Extra HTML appended to the tag enclosing the header exception: IOException - if an input/output error occurs |
renderHiddenField | public static void renderHiddenField(UIComponent component, ResponseWriter writer, String id, String value) throws IOException(Code) | | This method will output a hidden field for use with Params and components
that need to submit a value through a hidden field.
Note: The name of the hidden field will be written as is. For Params
no encoding inside the form is done. This is intentional.
Parameters: writer - The writer to use to write the attributes Parameters: id - The identifier of the hidden field.passthrough for this component |
renderJavaScript | public static void renderJavaScript(UIComponent component, Theme theme, FacesContext context, ResponseWriter writer) throws IOException(Code) | | Helper function to render theme scripts
Parameters: context - containing theme Parameters: writer - The current ResponseWriter Parameters: component - The uicomponent |
renderJsInclude | public static boolean renderJsInclude(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer, String includeFile) throws IOException(Code) | | Return true if the javascript file identified by
includeFile is included.
Return false if includeFile is null
or there is no javascript file identified by
includeFile .
renderJsInclude maintains a RequestMap attribute
"sjwuic_jsfile" that resolves to a Map containing
files that have previously been included.
Parameters: context - The current FacesContext Parameters: component - The current component being rendered Parameters: theme - The Theme to use to locate the Js file Parameters: writer - The current ResponseWriter Parameters: includeFile - The Js file to include |
renderJsObject | public static boolean renderJsObject(FacesContext context, UIComponent component, ResponseWriter writer, String objectName, String jsObjectClass, String arguments) throws IOException(Code) | | |
renderSpacer | public static void renderSpacer(ResponseWriter writer, UIComponent component, String dotSrc, int height, int width) throws IOException(Code) | | Helper function to render a transparent spacer image.
Parameters: writer - The current ResponseWriter Parameters: component - The uicomponent Parameters: height - The value to use for the image height attribute Parameters: width - The value to use for the image width attribute |
renderSpacer | public static void renderSpacer(FacesContext context, ResponseWriter writer, UIComponent component, int height, int width) throws IOException(Code) | | Helper function to render a transparent spacer image.
Parameters: writer - The current ResponseWriter Parameters: component - The uicomponent Parameters: height - The value to use for the image height attribute Parameters: width - The value to use for the image width attribute |
renderStyleClass | public static void renderStyleClass(FacesContext context, ResponseWriter writer, UIComponent component, String extraStyles) throws IOException(Code) | | |
renderStyleClass | public static String renderStyleClass(FacesContext context, ResponseWriter writer, UIComponent component, String styleClass, String extraHtml) throws IOException(Code) | | Helper method to render style classes when name/value pairs are given
via an extraHtml String. This method will append the given style to the
class name/value pair found in the extraHtml String. The class name/value
is removed from the returned extraHtml String so that developers may
invoke the writeStringAttributes method without rendering the style
class, again.
Parameters: context - FacesContext for the current request. Parameters: component - The UIComponent component to be rendered. Parameters: writer - ResponseWriter to which the element start should be rendered. Parameters: style - The style to append to the component's styleClass property. Parameters: extraHtml - Extra name/value pairs to be rendered. |
renderStyleSheetInline | public static void renderStyleSheetInline(UIComponent component, Theme theme, FacesContext context, ResponseWriter writer) throws IOException(Code) | | Helper function to render theme stylesheet definitions inline
Parameters: context - containing theme Parameters: writer - The current ResponseWriter Parameters: component - The uicomponent |
renderStyleSheetLink | public static void renderStyleSheetLink(UIComponent component, Theme theme, FacesContext context, ResponseWriter writer) throws IOException(Code) | | Helper function to render theme stylesheet link(s)
Parameters: context - containing theme Parameters: writer - The current ResponseWriter Parameters: component - The uicomponent |
renderURLAttribute | public static void renderURLAttribute(FacesContext context, ResponseWriter writer, UIComponent component, String name, String url, String compPropName) throws IOException(Code) | | Helper function to render a typical URL
Parameters: writer - The current ResponseWriter Parameters: component - The uicomponent Parameters: name - The attribute name of the url to write out Parameters: url - The value passed in by the developer for the url Parameters: compPropName - The property name of the component's property that specifies this property. Should be null if same as name. |
setLastClientID | public static void setLastClientID(FacesContext context, String clientId)(Code) | | Set the client ID of the last component to have focus.
|
writeStringAttributes | public static void writeStringAttributes(UIComponent component, ResponseWriter writer, String[] possibleAttributes) throws IOException(Code) | | This method goes through an array of possible attribute names,
evaluates if they have been set on the component, and writes
them out using the specified writer.
Parameters: component - The component being rendered Parameters: writer - The writer to use to write the attributes Parameters: possibleAttributes - String attributes that are treated aspassthrough for this component |
writeStringAttributes | public static void writeStringAttributes(UIComponent component, ResponseWriter writer, String names, String extraHtml) throws IOException(Code) | | Add any attributes on the specified list directly to the specified
ResponseWriter for which the specified UIComponent has a non-null String
value. This method may be used to "pass through" commonly used attribute
name/value pairs with a minimum of code. Attribute names are converted to
lower case in the rendered output. Any name/value pairs in the extraHtml
String shall take precedence over attribute values.
Parameters: context - FacesContext for the current request. Parameters: component - EditableValueHolder component whose submitted value is to be stored. Parameters: writer - ResponseWriter to which the element start should be rendered. Parameters: names - List of attribute names to be passed through. Parameters: extraHtml - Extra name/value pairs to be rendered. exception: IOException - if an input/output error occurs |
|
|