facesdoc.HTML_BASIC.javax.faces.Outputjavax.faces.resource.Stylesheet.html Maven / Gradle / Ivy
Show all versions of javax.faces-api Show documentation
component-family: javax.faces.Output renderer-type: javax.faces.resource.Stylesheet
HTML_BASIC render-kit
component-family: javax.faces.Output renderer-type: javax.faces.resource.Stylesheet
Render the markup for a
<link>
element that renders the style
Resource
specified by the optional name
and
library
attributes.
Decode Behavior
No action is required during decode for this renderer.
Encode Behavior
Use the algorithm Common Encode Behavior for
encodeBegin()
, encodeChildren()
and
getRendersChildren()
.
For encodeEnd()
, use the algorithm Common
Algorithm for Obtaining A Resource to Render to obtain a
reference to the Resource
to be encoded.
Output a <link>
element. Use the result from
calling resource.getRequestPath()
as the value of the
"href" attribute, the result from calling
resource.getContentType()
as the value of the "type"
attribute, the literal string "stylesheet" as the value of the "rel"
attribute, and the literal string "screen" as the value of the "media"
attribute, and the value of the
"media" attribute set to the value of the "media" attribute of this
tag.
The implementation of this renderer must have a @ListenerFor
annotation attached to it, at the class level, declaring PostAddToViewEvent.class
as the value of the systemEventClass
attribute. The presence of
this annotation on a renderer implies the renderer implements ComponentSystemEventListener
,
which this renderer must do. The implementation of
processEvent()
must extract the UIComponent
from the argument event pass it to UIViewRoot.addComponentResource()
, specifying
the literal string "head
" as the last argument.
The stylsheet renderer must ensure that any stylesheets are included in the <head> of the document.
This renderer is responsible for rendering its children.
Note:
Attributes with a pass-through
value of
true
are not interpreted by the renderer and are passed
straight through to the rendered markup, without checking for validity. Attributes with a
pass-through
value of false
are interpreted
by the renderer, and may or may not be checked for validity by the renderer.
Attributes
attribute-name
pass-through
attribute-class
description
default-value
library
false
java.lang.String
The libraryName for this resource.
undefined
media
false
java.lang.String
The
media type for this stylesheet. For
example, media="screen" would cause the
resource to be rendered with the media
attribute of the link set to
screen.
undefined
name
false
java.lang.String
The
resourceName for this resource.
This attribute is required
undefined
Copyright (c) 2003-2010 Oracle America, Inc. All Rights Reserved.