|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.rave.web.ui.util.RenderingUtilities
public class RenderingUtilities
Nested Class Summary | |
---|---|
protected static class |
RenderingUtilities.Param
|
Field Summary | |
---|---|
static java.lang.String |
COLON
|
static char |
COLON_CHAR
|
static java.lang.String |
MEDIA
|
static java.lang.String |
NL
|
static java.lang.String |
SCRIPT
|
static java.lang.String |
SJWUIC_JSFILE
|
static java.lang.String |
SRC
|
static java.lang.String |
TYPE
|
static java.lang.String |
USCORE
|
static char |
USCORE_CHAR
|
Constructor Summary | |
---|---|
RenderingUtilities()
Creates a new instance of RenderingUtilities. |
Method Summary | |
---|---|
static java.lang.String |
getJavascriptId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
|
static java.lang.String |
getJsObjectName(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String objectPrefix)
|
static java.lang.String |
getJsObjectName(java.lang.String clientId,
java.lang.String objectPrefix)
|
static java.lang.String |
getLastClientID(javax.faces.context.FacesContext context)
Get the client ID of the last component to have focus. |
protected static RenderingUtilities.Param[] |
getParamList(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent command)
|
static java.lang.String |
getStyleClasses(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String styles)
Return a space-separated list of CSS style classes to render for this component, or null for none. |
static void |
includeJsp(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
java.lang.String jspURI)
Perform a RequestDispatcher.include of the specified URI
jspURI . |
static boolean |
isPortlet(javax.faces.context.FacesContext context)
|
static boolean |
isVisible(javax.faces.component.UIComponent component)
Return whether the given UIComponent is "visible". |
static void |
renderAnchor(java.lang.String anchorName,
javax.faces.component.UIComponent component,
javax.faces.context.FacesContext context)
|
static void |
renderComponent(javax.faces.component.UIComponent component,
javax.faces.context.FacesContext context)
Render a component. |
static void |
renderExtraHtmlAttributes(javax.faces.context.ResponseWriter writer,
java.lang.String extraHtml)
Helper method to render extra attributes. |
static void |
renderHiddenField(javax.faces.component.UIComponent component,
javax.faces.context.ResponseWriter writer,
java.lang.String id,
java.lang.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. |
static void |
renderJavaScript(javax.faces.component.UIComponent component,
Theme theme,
javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer)
Helper function to render theme scripts |
static boolean |
renderJsInclude(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Theme theme,
javax.faces.context.ResponseWriter writer,
java.lang.String includeFile)
Return true if the javascript file identified by includeFile is included. |
static boolean |
renderJsObject(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
javax.faces.context.ResponseWriter writer,
java.lang.String objectName,
java.lang.String jsObjectClass,
java.lang.String arguments)
|
static void |
renderSkipLink(java.lang.String anchorName,
java.lang.String styleClass,
java.lang.String style,
java.lang.String toolTip,
java.lang.Integer tabIndex,
javax.faces.component.UIComponent component,
javax.faces.context.FacesContext context)
|
static void |
renderSpacer(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
int height,
int width)
Helper function to render a transparent spacer image. |
static void |
renderSpacer(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String dotSrc,
int height,
int width)
Helper function to render a transparent spacer image. |
static void |
renderStyleClass(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String extraStyles)
|
static java.lang.String |
renderStyleClass(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String styleClass,
java.lang.String extraHtml)
Helper method to render style classes when name/value pairs are given via an extraHtml String. |
static void |
renderStyleSheetInline(javax.faces.component.UIComponent component,
Theme theme,
javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer)
Helper function to render theme stylesheet definitions inline |
static void |
renderStyleSheetLink(javax.faces.component.UIComponent component,
Theme theme,
javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer)
Helper function to render theme stylesheet link(s) |
static void |
renderURLAttribute(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String name,
java.lang.String url,
java.lang.String compPropName)
Helper function to render a typical URL |
static void |
setLastClientID(javax.faces.context.FacesContext context,
java.lang.String clientId)
Set the client ID of the last component to have focus. |
static void |
writeStringAttributes(javax.faces.component.UIComponent component,
javax.faces.context.ResponseWriter writer,
java.lang.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. |
static void |
writeStringAttributes(javax.faces.component.UIComponent component,
javax.faces.context.ResponseWriter writer,
java.lang.String[] names,
java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NL
public static final java.lang.String SCRIPT
public static final java.lang.String TYPE
public static final java.lang.String SRC
public static final java.lang.String MEDIA
public static final java.lang.String SJWUIC_JSFILE
public static final java.lang.String USCORE
public static final java.lang.String COLON
public static final char USCORE_CHAR
public static final char COLON_CHAR
Constructor Detail |
---|
public RenderingUtilities()
Method Detail |
---|
public static void renderComponent(javax.faces.component.UIComponent component, javax.faces.context.FacesContext context) throws java.io.IOException
component
- The component to rendercontext
- The FacesContext of the request
java.io.IOException
public static void writeStringAttributes(javax.faces.component.UIComponent component, javax.faces.context.ResponseWriter writer, java.lang.String[] possibleAttributes) throws java.io.IOException
component
- The component being renderedwriter
- The writer to use to write the attributespossibleAttributes
- String attributes that are treated as
passthrough for this component
java.io.IOException
public static void writeStringAttributes(javax.faces.component.UIComponent component, javax.faces.context.ResponseWriter writer, java.lang.String[] names, java.lang.String extraHtml) throws java.io.IOException
context
- FacesContext for the current request.component
- EditableValueHolder component whose submitted value is
to be stored.writer
- ResponseWriter to which the element start should be rendered.names
- List of attribute names to be passed through.extraHtml
- Extra name/value pairs to be rendered.
java.io.IOException
- if an input/output error occurspublic static void renderHiddenField(javax.faces.component.UIComponent component, javax.faces.context.ResponseWriter writer, java.lang.String id, java.lang.String value) throws java.io.IOException
writer
- The writer to use to write the attributesid
- The identifier of the hidden field.
passthrough for this component
java.io.IOException
public static java.lang.String getStyleClasses(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String styles)
Return a space-separated list of CSS style classes to render for
this component, or null
for none.
component
- UIComponent
for which to calculate classesstyles
- Additional styles specified by the rendererpublic static void renderStyleClass(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String extraStyles) throws java.io.IOException
java.io.IOException
public static java.lang.String renderStyleClass(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String styleClass, java.lang.String extraHtml) throws java.io.IOException
context
- FacesContext for the current request.component
- The UIComponent component to be rendered.writer
- ResponseWriter to which the element start should be rendered.style
- The style to append to the component's styleClass property.extraHtml
- Extra name/value pairs to be rendered.
java.io.IOException
public static java.lang.String getJavascriptId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
public static boolean isPortlet(javax.faces.context.FacesContext context)
public static java.lang.String getLastClientID(javax.faces.context.FacesContext context)
public static void setLastClientID(javax.faces.context.FacesContext context, java.lang.String clientId)
public static void renderSpacer(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String dotSrc, int height, int width) throws java.io.IOException
writer
- The current ResponseWritercomponent
- The uicomponentheight
- The value to use for the image height attributewidth
- The value to use for the image width attribute
java.io.IOException
public static void renderSpacer(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, int height, int width) throws java.io.IOException
writer
- The current ResponseWritercomponent
- The uicomponentheight
- The value to use for the image height attributewidth
- The value to use for the image width attribute
java.io.IOException
public static void renderJavaScript(javax.faces.component.UIComponent component, Theme theme, javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer) throws java.io.IOException
context
- containing themewriter
- The current ResponseWritercomponent
- The uicomponent
java.io.IOException
public static void renderStyleSheetLink(javax.faces.component.UIComponent component, Theme theme, javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer) throws java.io.IOException
context
- containing themewriter
- The current ResponseWritercomponent
- The uicomponent
java.io.IOException
public static void renderStyleSheetInline(javax.faces.component.UIComponent component, Theme theme, javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer) throws java.io.IOException
context
- containing themewriter
- The current ResponseWritercomponent
- The uicomponent
java.io.IOException
public static void includeJsp(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, java.lang.String jspURI) throws java.io.IOException
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.
context
- the FacesContext
for this requestwriter
- the ResponseWrite
destination for the
rendered outputjspURI
- the URI identifying a JSP page to be included.
java.io.IOException
- if response can't be written or jspURI
cannot be included. Real cause is chained.public static boolean renderJsInclude(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Theme theme, javax.faces.context.ResponseWriter writer, java.lang.String includeFile) throws java.io.IOException
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.
context
- The current FacesContextcomponent
- The current component being renderedtheme
- The Theme to use to locate the Js filewriter
- The current ResponseWriterincludeFile
- The Js file to include
java.io.IOException
public static boolean renderJsObject(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.context.ResponseWriter writer, java.lang.String objectName, java.lang.String jsObjectClass, java.lang.String arguments) throws java.io.IOException
java.io.IOException
public static java.lang.String getJsObjectName(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String objectPrefix)
public static java.lang.String getJsObjectName(java.lang.String clientId, java.lang.String objectPrefix)
public static void renderExtraHtmlAttributes(javax.faces.context.ResponseWriter writer, java.lang.String extraHtml) throws java.io.IOException
writer
- ResponseWriter
to which the element
end should be renderedextraHtml
- Extra HTML appended to the tag enclosing the header
java.io.IOException
- if an input/output error occurspublic static void renderURLAttribute(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String name, java.lang.String url, java.lang.String compPropName) throws java.io.IOException
writer
- The current ResponseWritercomponent
- The uicomponentname
- The attribute name of the url to write outurl
- The value passed in by the developer for the urlcompPropName
- The property name of the component's property that
specifies this property. Should be null if same as name.
java.io.IOException
protected static RenderingUtilities.Param[] getParamList(javax.faces.context.FacesContext context, javax.faces.component.UIComponent command)
public static void renderSkipLink(java.lang.String anchorName, java.lang.String styleClass, java.lang.String style, java.lang.String toolTip, java.lang.Integer tabIndex, javax.faces.component.UIComponent component, javax.faces.context.FacesContext context) throws java.io.IOException
java.io.IOException
public static void renderAnchor(java.lang.String anchorName, javax.faces.component.UIComponent component, javax.faces.context.FacesContext context) throws java.io.IOException
java.io.IOException
public static boolean isVisible(javax.faces.component.UIComponent component)
Return whether the given UIComponent
is "visible".
If the property is null, it will return true. Otherwise the value
of the property is returned.
component
- The UIComponent
to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |