Package org.htmlunit.cssparser.dom
Class CSSStyleSheetImpl
- java.lang.Object
-
- org.htmlunit.cssparser.dom.CSSStyleSheetImpl
-
- All Implemented Interfaces:
java.io.Serializable
public class CSSStyleSheetImpl extends java.lang.Object implements java.io.Serializable
Implementation of CSSStyleSheet.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CSSStyleSheetImpl.CSSStyleSheetRuleIndex
CSSStyleSheetRuleIndex.(package private) static class
CSSStyleSheetImpl.SelectorEntriesIterator
static class
CSSStyleSheetImpl.SelectorEntry
SelectorEntry.
-
Field Summary
Fields Modifier and Type Field Description private CSSRuleListImpl
cssRules_
private boolean
disabled_
private java.lang.String
href_
private CSSStyleSheetImpl.CSSStyleSheetRuleIndex
index_
private MediaListImpl
media_
private org.w3c.dom.Node
ownerNode_
private AbstractCSSRuleImpl
ownerRule_
private java.lang.String
title_
-
Constructor Summary
Constructors Constructor Description CSSStyleSheetImpl()
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteRule(int index)
delete the rule at the given pos.boolean
equals(java.lang.Object obj)
CSSRuleListImpl
getCssRules()
boolean
getDisabled()
java.lang.String
getHref()
MediaListImpl
getMedia()
org.w3c.dom.Node
getOwnerNode()
AbstractCSSRuleImpl
getOwnerRule()
CSSStyleSheetImpl.CSSStyleSheetRuleIndex
getRuleIndex()
java.lang.String
getTitle()
int
hashCode()
void
insertRule(java.lang.String rule, int index)
inserts a new rule.private void
readObject(java.io.ObjectInputStream in)
void
resetRuleIndex()
Clean the index.void
setCssRules(CSSRuleListImpl rules)
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)
Set the href.void
setMediaText(java.lang.String mediaText)
Set the media text.void
setOwnerNode(org.w3c.dom.Node ownerNode)
Set the owner node.void
setOwnerRule(AbstractCSSRuleImpl ownerRule)
void
setRuleIndex(CSSStyleSheetImpl.CSSStyleSheetRuleIndex index)
Set the CSSStyleSheetRuleIndex.void
setTitle(java.lang.String title)
Set the title.java.lang.String
toString()
private void
writeObject(java.io.ObjectOutputStream out)
-
-
-
Field Detail
-
disabled_
private boolean disabled_
-
ownerNode_
private org.w3c.dom.Node ownerNode_
-
href_
private java.lang.String href_
-
title_
private java.lang.String title_
-
media_
private MediaListImpl media_
-
ownerRule_
private AbstractCSSRuleImpl ownerRule_
-
cssRules_
private CSSRuleListImpl cssRules_
-
index_
private CSSStyleSheetImpl.CSSStyleSheetRuleIndex index_
-
-
Method Detail
-
getDisabled
public boolean getDisabled()
- Returns:
- the disable state
-
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.- Parameters:
disabled
- the new disabled
-
getOwnerNode
public org.w3c.dom.Node getOwnerNode()
- Returns:
- the owner node
-
getHref
public java.lang.String getHref()
- Returns:
- the href
-
getTitle
public java.lang.String getTitle()
- Returns:
- the title
-
getMedia
public MediaListImpl getMedia()
- Returns:
- the media list
-
getOwnerRule
public AbstractCSSRuleImpl getOwnerRule()
- Returns:
- the owner rule
-
getCssRules
public CSSRuleListImpl getCssRules()
- Returns:
- the css rules
-
insertRule
public void insertRule(java.lang.String rule, int index) throws org.w3c.dom.DOMException
inserts a new rule.- Parameters:
rule
- the rule to insertindex
- the insert pos- Throws:
org.w3c.dom.DOMException
- in case of error
-
deleteRule
public void deleteRule(int index) throws org.w3c.dom.DOMException
delete the rule at the given pos.- Parameters:
index
- the pos- Throws:
org.w3c.dom.DOMException
- in case of error
-
setOwnerNode
public void setOwnerNode(org.w3c.dom.Node ownerNode)
Set the owner node.- Parameters:
ownerNode
- the new node
-
setHref
public void setHref(java.lang.String href)
Set the href.- Parameters:
href
- the new href
-
setTitle
public void setTitle(java.lang.String title)
Set the title.- Parameters:
title
- the new title
-
setMediaText
public void setMediaText(java.lang.String mediaText)
Set the media text.- Parameters:
mediaText
- the new media text
-
setOwnerRule
public void setOwnerRule(AbstractCSSRuleImpl ownerRule)
- Parameters:
ownerRule
- the new ownerRule
-
setCssRules
public void setCssRules(CSSRuleListImpl rules)
- Parameters:
rules
- the new rules
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
writeObject
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
getRuleIndex
public CSSStyleSheetImpl.CSSStyleSheetRuleIndex getRuleIndex()
- Returns:
- the CSSStyleSheetRuleIndex
-
setRuleIndex
public void setRuleIndex(CSSStyleSheetImpl.CSSStyleSheetRuleIndex index)
Set the CSSStyleSheetRuleIndex.- Parameters:
index
- the new index
-
resetRuleIndex
public void resetRuleIndex()
Clean the index.
-
-