org.apache.myfaces.custom.stylesheet
Class AbstractStylesheet

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

public abstract class AbstractStylesheet
extends javax.faces.component.UIComponentBase
implements UserRoleAware

Renders the path to a common CSS-file

Since:
1.1.7
Version:
$Revision: 691856 $ $Date: 2008-09-03 21:40:30 -0500 (Wed, 03 Sep 2008) $
Author:
mwessendorf (latest modification by $Author: lu4242 $)

Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Fields inherited from interface org.apache.myfaces.component.UserRoleAware
ENABLED_ON_USER_ROLE_ATTR, VISIBLE_ON_USER_ROLE_ATTR
 
Constructor Summary
AbstractStylesheet()
           
 
Method Summary
abstract  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.
abstract  java.lang.String getPath()
          URL for CSS-file.
abstract  boolean isFiltered()
          Cause EL expressions in the stylesheet to be evaluated.
abstract  boolean isInline()
          Inline the stylesheet file content as in contrast to referencing it as a link.
 boolean isRendered()
           
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getFamily, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.component.UserRoleAware
getEnabledOnUserRole, getVisibleOnUserRole, setEnabledOnUserRole, setVisibleOnUserRole
 

Field Detail

COMPONENT_TYPE

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

COMPONENT_FAMILY

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

AbstractStylesheet

public AbstractStylesheet()
Method Detail

getPath

public abstract java.lang.String getPath()
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.


isInline

public abstract boolean isInline()
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.


isFiltered

public abstract boolean isFiltered()
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.


getMedia

public abstract 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. See also http://www.w3.org/TR/REC-html40/types.html#type-media-descriptors


isRendered

public boolean isRendered()
Overrides:
isRendered in class javax.faces.component.UIComponentBase


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