Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.steadystate.css.dom
Class CSSStyleSheetImpl  view CSSStyleSheetImpl download CSSStyleSheetImpl.java

java.lang.Object
  extended bycom.steadystate.css.dom.CSSStyleSheetImpl
All Implemented Interfaces:
org.w3c.dom.css.CSSStyleSheet, java.io.Serializable, org.w3c.dom.stylesheets.StyleSheet

public class CSSStyleSheetImpl
extends java.lang.Object
implements org.w3c.dom.css.CSSStyleSheet, java.io.Serializable

TODO: Setting the media list

Version:
$Release$

Field Summary
private  boolean _disabled
           
private  java.lang.String _href
           
private  org.w3c.dom.stylesheets.MediaList _media
           
private  org.w3c.dom.Node _ownerNode
           
private  org.w3c.dom.css.CSSRule _ownerRule
           
private  org.w3c.dom.stylesheets.StyleSheet _parentStyleSheet
           
private  boolean _readOnly
           
private  CSSRuleListImpl _rules
           
private  java.lang.String _title
           
 
Constructor Summary
CSSStyleSheetImpl()
           
 
Method Summary
 void deleteRule(int index)
          Used to delete a rule from the style sheet.
 org.w3c.dom.css.CSSRuleList getCssRules()
          The list of all CSS rules contained within the style sheet.
 boolean getDisabled()
          false if the style sheet is applied to the document.
 java.lang.String getHref()
          If the style sheet is a linked style sheet, the value of its attribute is its location.
 org.w3c.dom.stylesheets.MediaList getMedia()
          The intended destination media for style information.
 org.w3c.dom.Node getOwnerNode()
          The node that associates this style sheet with the document.
 org.w3c.dom.css.CSSRule getOwnerRule()
          If this style sheet comes from an @import rule, the ownerRule attribute will contain the CSSImportRule.
 org.w3c.dom.stylesheets.StyleSheet getParentStyleSheet()
          For style sheet languages that support the concept of style sheet inclusion, this attribute represents the including style sheet, if one exists.
 java.lang.String getTitle()
          The advisory title.
 java.lang.String getType()
          This specifies the style sheet language for this style sheet.
 int insertRule(java.lang.String rule, int index)
          Used to insert a new rule into the style sheet.
 boolean isReadOnly()
           
 void setDisabled(boolean disabled)
          We will need to respond more fully if a stylesheet is disabled, probably by generating an event for the main application.
 void setHref(java.lang.String href)
           
 void setMedia(java.lang.String mediaText)
           
 void setOwnerNode(org.w3c.dom.Node ownerNode)
           
 void setOwnerRule(org.w3c.dom.css.CSSRule ownerRule)
           
 void setParentStyleSheet(org.w3c.dom.stylesheets.StyleSheet parentStyleSheet)
           
 void setReadOnly(boolean b)
           
 void setRuleList(CSSRuleListImpl rules)
           
 void setTitle(java.lang.String title)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_disabled

private boolean _disabled

_ownerNode

private org.w3c.dom.Node _ownerNode

_parentStyleSheet

private org.w3c.dom.stylesheets.StyleSheet _parentStyleSheet

_href

private java.lang.String _href

_title

private java.lang.String _title

_media

private org.w3c.dom.stylesheets.MediaList _media

_ownerRule

private org.w3c.dom.css.CSSRule _ownerRule

_readOnly

private boolean _readOnly

_rules

private CSSRuleListImpl _rules
Constructor Detail

CSSStyleSheetImpl

public CSSStyleSheetImpl()
Method Detail

getType

public java.lang.String getType()
Description copied from interface: org.w3c.dom.stylesheets.StyleSheet
This specifies the style sheet language for this style sheet. The style sheet language is specified as a content type (e.g. "text/css"). The content type is often specified in the ownerNode. Also see the type attribute definition for the LINK element in HTML 4.0, and the type pseudo-attribute for the XML style sheet processing instruction.

Specified by:
getType in interface org.w3c.dom.stylesheets.StyleSheet

getDisabled

public boolean getDisabled()
Description copied from interface: org.w3c.dom.stylesheets.StyleSheet
false if the style sheet is applied to the document. true if it is not. Modifying this attribute may cause a new resolution of style for the document. A stylesheet only applies if both an appropriate medium definition is present and the disabled attribute is false. So, if the media doesn't apply to the current user agent, the disabled attribute is ignored.

Specified by:
getDisabled in interface org.w3c.dom.stylesheets.StyleSheet

setDisabled

public void setDisabled(boolean disabled)
We will need to respond more fully if a stylesheet is disabled, probably by generating an event for the main application.

Specified by:
setDisabled in interface org.w3c.dom.stylesheets.StyleSheet

getOwnerNode

public org.w3c.dom.Node getOwnerNode()
Description copied from interface: org.w3c.dom.stylesheets.StyleSheet
The node that associates this style sheet with the document. For HTML, this may be the corresponding LINK or STYLE element. For XML, it may be the linking processing instruction. For style sheets that are included by other style sheets, the value of this attribute is null.

Specified by:
getOwnerNode in interface org.w3c.dom.stylesheets.StyleSheet

getParentStyleSheet

public org.w3c.dom.stylesheets.StyleSheet getParentStyleSheet()
Description copied from interface: org.w3c.dom.stylesheets.StyleSheet
For style sheet languages that support the concept of style sheet inclusion, this attribute represents the including style sheet, if one exists. If the style sheet is a top-level style sheet, or the style sheet language does not support inclusion, the value of this attribute is null.

Specified by:
getParentStyleSheet in interface org.w3c.dom.stylesheets.StyleSheet

getHref

public java.lang.String getHref()
Description copied from interface: org.w3c.dom.stylesheets.StyleSheet
If the style sheet is a linked style sheet, the value of its attribute is its location. For inline style sheets, the value of this attribute is null. See the href attribute definition for the LINK element in HTML 4.0, and the href pseudo-attribute for the XML style sheet processing instruction.

Specified by:
getHref in interface org.w3c.dom.stylesheets.StyleSheet

getTitle

public java.lang.String getTitle()
Description copied from interface: org.w3c.dom.stylesheets.StyleSheet
The advisory title. The title is often specified in the ownerNode. See the title attribute definition for the LINK element in HTML 4.0, and the title pseudo-attribute for the XML style sheet processing instruction.

Specified by:
getTitle in interface org.w3c.dom.stylesheets.StyleSheet

getMedia

public org.w3c.dom.stylesheets.MediaList getMedia()
Description copied from interface: org.w3c.dom.stylesheets.StyleSheet
The intended destination media for style information. The media is often specified in the ownerNode. If no media has been specified, the MediaList will be empty. See the media attribute definition for the LINK element in HTML 4.0, and the media pseudo-attribute for the XML style sheet processing instruction . Modifying the media list may cause a change to the attribute disabled.

Specified by:
getMedia in interface org.w3c.dom.stylesheets.StyleSheet

getOwnerRule

public org.w3c.dom.css.CSSRule getOwnerRule()
Description copied from interface: org.w3c.dom.css.CSSStyleSheet
If this style sheet comes from an @import rule, the ownerRule attribute will contain the CSSImportRule. In that case, the ownerNode attribute in the StyleSheet interface will be null. If the style sheet comes from an element or a processing instruction, the ownerRule attribute will be null and the ownerNode attribute will contain the Node.

Specified by:
getOwnerRule in interface org.w3c.dom.css.CSSStyleSheet

getCssRules

public org.w3c.dom.css.CSSRuleList getCssRules()
Description copied from interface: org.w3c.dom.css.CSSStyleSheet
The list of all CSS rules contained within the style sheet. This includes both rule sets and at-rules.

Specified by:
getCssRules in interface org.w3c.dom.css.CSSStyleSheet

insertRule

public int insertRule(java.lang.String rule,
                      int index)
               throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.css.CSSStyleSheet
Used to insert a new rule into the style sheet. The new rule now becomes part of the cascade.

Specified by:
insertRule in interface org.w3c.dom.css.CSSStyleSheet

deleteRule

public void deleteRule(int index)
                throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.css.CSSStyleSheet
Used to delete a rule from the style sheet.

Specified by:
deleteRule in interface org.w3c.dom.css.CSSStyleSheet

isReadOnly

public boolean isReadOnly()

setReadOnly

public void setReadOnly(boolean b)

setOwnerNode

public void setOwnerNode(org.w3c.dom.Node ownerNode)

setParentStyleSheet

public void setParentStyleSheet(org.w3c.dom.stylesheets.StyleSheet parentStyleSheet)

setHref

public void setHref(java.lang.String href)

setTitle

public void setTitle(java.lang.String title)

setMedia

public void setMedia(java.lang.String mediaText)

setOwnerRule

public void setOwnerRule(org.w3c.dom.css.CSSRule ownerRule)

setRuleList

public void setRuleList(CSSRuleListImpl rules)

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).