org.apache.myfaces.custom.stylesheet
Class Stylesheet

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.apache.myfaces.custom.stylesheet.AbstractStylesheet
              extended by org.apache.myfaces.custom.stylesheet.Stylesheet
All Implemented Interfaces:
javax.faces.component.StateHolder, UserRoleAware

public class Stylesheet
extends AbstractStylesheet


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String DEFAULT_RENDERER_TYPE
           
 
Fields inherited from interface org.apache.myfaces.component.UserRoleAware
ENABLED_ON_USER_ROLE_ATTR, VISIBLE_ON_USER_ROLE_ATTR
 
Constructor Summary
Stylesheet()
           
 
Method Summary
 java.lang.String getEnabledOnUserRole()
          If user is in given role, this component will be rendered normally.
 java.lang.String getFamily()
           
 java.lang.String getMedia()
          Define the target media of the styles: screen Intended for non-paged computer screens. tty Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities. tv Intended for television-type devices (low resolution, color, limited scrollability). projection Intended for projectors. handheld Intended for handheld devices (small screen, monochrome, bitmapped graphics, limited bandwidth). print Intended for paged, opaque material and for documents viewed on screen in print preview mode. braille Intended for braille tactile feedback devices. aural Intended for speech synthesizers. all Suitable for all devices. Could be a comma separated list.
 java.lang.String getPath()
          URL for CSS-file.
 java.lang.String getVisibleOnUserRole()
          If user is in given role, this component will be rendered normally.
 boolean isFiltered()
          Cause EL expressions in the stylesheet to be evaluated.
 boolean isInline()
          Inline the stylesheet file content as in contrast to referencing it as a link.
 void restoreState(javax.faces.context.FacesContext facesContext, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
           
 void setEnabledOnUserRole(java.lang.String enabledOnUserRole)
           
 void setFiltered(boolean filtered)
           
 void setInline(boolean inline)
           
 void setMedia(java.lang.String media)
           
 void setPath(java.lang.String path)
           
 void setVisibleOnUserRole(java.lang.String visibleOnUserRole)
           
 
Methods inherited from class org.apache.myfaces.custom.stylesheet.AbstractStylesheet
isRendered
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

DEFAULT_RENDERER_TYPE

public static final java.lang.String DEFAULT_RENDERER_TYPE
See Also:
Constant Field Values
Constructor Detail

Stylesheet

public Stylesheet()
Method Detail

getFamily

public java.lang.String getFamily()
Specified by:
getFamily in class javax.faces.component.UIComponent

getPath

public java.lang.String getPath()
Description copied from class: AbstractStylesheet
URL for CSS-file.

If this path starts with a slash, then the webapp context path will be prepended to it. This makes it simple to reference stylesheets at an absolute path within the webapp. A value like "/styles/style.css" becomes "/webappname/styles/style.css".

If this path does not start with a slash, then it is output unaltered. This supports absolute urls ("http://host/path/style.css"). It also supports having css files relative to the current page ("style.css" or "styles/style.css") but this needs to be used with care as the standard JSF postback/internal-forward navigation style can cause browsers to use an inappropriate base url when resolving relative references.

Specified by:
getPath in class AbstractStylesheet

setPath

public void setPath(java.lang.String path)

isInline

public boolean isInline()
Description copied from class: AbstractStylesheet
Inline the stylesheet file content as in contrast to referencing it as a link.

The file referenced by the path attribute is loaded, and its content is written to the page wrapped in an <script> tag.

When this option is enabled, the path property must contain an absolute path within the current webapp. External urls ("http://*") and paths relative to the current page are not supported.

Specified by:
isInline in class AbstractStylesheet

setInline

public void setInline(boolean inline)

isFiltered

public boolean isFiltered()
Description copied from class: AbstractStylesheet
Cause EL expressions in the stylesheet to be evaluated.

When true, any EL expression in the stylesheet will be evaluated and replaced by its string representation on the first access. The stylesheet will be processed only once. Every subsequent request will get a cached view.

Specified by:
isFiltered in class AbstractStylesheet

setFiltered

public void setFiltered(boolean filtered)

getMedia

public java.lang.String getMedia()
Description copied from class: AbstractStylesheet
Define the target media of the styles:
screen
Intended for non-paged computer screens.
tty
Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities.
tv
Intended for television-type devices (low resolution, color, limited scrollability).
projection
Intended for projectors.
handheld
Intended for handheld devices (small screen, monochrome, bitmapped graphics, limited bandwidth).
print
Intended for paged, opaque material and for documents viewed on screen in print preview mode.
braille
Intended for braille tactile feedback devices.
aural
Intended for speech synthesizers.
all
Suitable for all devices.
Could be a comma separated list. See also http://www.w3.org/TR/REC-html40/types.html#type-media-descriptors

Specified by:
getMedia in class AbstractStylesheet

setMedia

public void setMedia(java.lang.String media)

getEnabledOnUserRole

public java.lang.String getEnabledOnUserRole()
Description copied from interface: UserRoleAware
If user is in given role, this component will be rendered normally. If not, no hyperlink is rendered but all nested tags (=body) are rendered.

Returns:

setEnabledOnUserRole

public void setEnabledOnUserRole(java.lang.String enabledOnUserRole)

getVisibleOnUserRole

public java.lang.String getVisibleOnUserRole()
Description copied from interface: UserRoleAware
If user is in given role, this component will be rendered normally. If not, nothing is rendered and the body of this tag will be skipped.

Returns:

setVisibleOnUserRole

public void setVisibleOnUserRole(java.lang.String visibleOnUserRole)

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIComponentBase

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIComponentBase


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.