com.ibm.xsp.resource
Class StyleSheetResource

java.lang.Object
  extended by com.ibm.xsp.complex.ValueBindingObjectImpl
      extended by com.ibm.xsp.resource.AbstractResource
          extended by com.ibm.xsp.resource.StyleSheetResource
All Implemented Interfaces:
ComponentBindingObject, EncodableObject, ValueBindingObject, FacesAttrsObject, Resource, javax.faces.component.StateHolder

public class StyleSheetResource
extends AbstractResource
implements EncodableObject, FacesAttrsObject

Corresponds to the xp:styleSheet tag which is used to load stylesheets at runtime


Field Summary
static java.lang.String RENDERER_TYPE
           
 
Fields inherited from class com.ibm.xsp.resource.AbstractResource
FAMILY
 
Constructor Summary
StyleSheetResource()
          Default Constructor
StyleSheetResource(java.lang.String href)
          Constructor for StyleSheetResources
StyleSheetResource(java.lang.String href, boolean dojoTheme, java.lang.String media)
          Constructor for StyleSheetResources
 
Method Summary
 void addAttr(Attr attr)
          Add an Attr, to appear as an attribute in the HTML output of this control or object tag.
 java.util.List<Attr> getAttrs()
          The extra attributes to be output on the base element at the root of this control or object tag.
 java.lang.String getCharset()
          Indicates the character encoding of the linked style sheet file.
 java.lang.String getContents()
          For style sheets, the "contents" property can be set in the XPage source.
 java.lang.String getHref()
          Returns the location of the style sheets resources
 java.lang.String getMedia()
          Returns the device for this stylesheet.
 boolean isDojoTheme()
          Returns whether the style sheet resource is using the dojoTheme
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setAttrs(java.util.List<Attr> attrs)
          This method is not used by the XPage generated .java file - instead the addAttr(Attr) method is used to add attributes to the list.
 void setCharset(java.lang.String charset)
          Sets the charset which is the character encoding
 void setContents(java.lang.String contents)
          Sets the contents of the CSS resource
 void setDojoTheme(boolean dojoTheme)
          Sets whether the style sheet resource is using the dojoTheme
 void setHref(java.lang.String href)
          Sets the href location of style sheet resources
 void setMedia(java.lang.String media)
          Sets the media device for this stylesheet
 java.lang.String toString()
           
 
Methods inherited from class com.ibm.xsp.resource.AbstractResource
encodeObject, equals, getFamily, getRendererType, getServerResourceContents, getUniqueId, isRendered, loadContents, setRendered, setRendererType
 
Methods inherited from class com.ibm.xsp.complex.ValueBindingObjectImpl
getComponent, getFacesContext, getValueBinding, isTransient, setComponent, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.xsp.complex.EncodableObject
encodeObject
 

Field Detail

RENDERER_TYPE

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

StyleSheetResource

public StyleSheetResource()
Default Constructor


StyleSheetResource

public StyleSheetResource(java.lang.String href)
Constructor for StyleSheetResources

Parameters:
href - location of stylesheet

StyleSheetResource

public StyleSheetResource(java.lang.String href,
                          boolean dojoTheme,
                          java.lang.String media)
Constructor for StyleSheetResources

Parameters:
href - location of stylesheet
whether - to set dojoTheme
media - that resource is linked to
Method Detail

getContents

public java.lang.String getContents()
For style sheets, the "contents" property can be set in the XPage source.

Returns:
contents

setContents

public void setContents(java.lang.String contents)
Sets the contents of the CSS resource

Parameters:
contents -

getHref

public java.lang.String getHref()
Returns the location of the style sheets resources

Returns:
href

setHref

public void setHref(java.lang.String href)
Sets the href location of style sheet resources

Parameters:
href -

isDojoTheme

public boolean isDojoTheme()
Returns whether the style sheet resource is using the dojoTheme

Returns:
true is dojoTheme is be used, false if not

setDojoTheme

public void setDojoTheme(boolean dojoTheme)
Sets whether the style sheet resource is using the dojoTheme

Parameters:
-

getMedia

public java.lang.String getMedia()
Returns the device for this stylesheet.

Returns:
media

setMedia

public void setMedia(java.lang.String media)
Sets the media device for this stylesheet

Parameters:
media -

getCharset

public java.lang.String getCharset()
Indicates the character encoding of the linked style sheet file. Same as the HTML "link" tag's "charset" attribute.

Returns:
Returns the charset.

setCharset

public void setCharset(java.lang.String charset)
Sets the charset which is the character encoding

Parameters:
charset -

getAttrs

public java.util.List<Attr> getAttrs()
The extra attributes to be output on the base element at the root of this control or object tag. This should only be used when none of the properties in the All Properties pane correspond to the desired attribute. This may return null. The addAttr(Attr) method should be used to add an Attr.

Specified by:
getAttrs in interface FacesAttrsObject

addAttr

public void addAttr(Attr attr)
Add an Attr, to appear as an attribute in the HTML output of this control or object tag.

Specified by:
addAttr in interface FacesAttrsObject
Parameters:
action -

setAttrs

public void setAttrs(java.util.List<Attr> attrs)
This method is not used by the XPage generated .java file - instead the addAttr(Attr) method is used to add attributes to the list.


saveState

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

restoreState

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object