Package org.htmlunit.cssparser.dom
Class CSSStyleSheetImpl
- java.lang.Object
-
- org.htmlunit.cssparser.dom.CSSStyleSheetImpl
-
- All Implemented Interfaces:
Serializable
public class CSSStyleSheetImpl extends Object implements Serializable
Implementation of CSSStyleSheet.- Author:
- Ronald Brill
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCSSStyleSheetImpl.CSSStyleSheetRuleIndexCSSStyleSheetRuleIndex.static classCSSStyleSheetImpl.SelectorEntrySelectorEntry.
-
Constructor Summary
Constructors Constructor Description CSSStyleSheetImpl()Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteRule(int index)delete the rule at the given pos.booleanequals(Object obj)CSSRuleListImplgetCssRules()getCssRules.booleangetDisabled()getDisabled.StringgetHref()getHref.MediaListImplgetMedia()getMedia.NodegetOwnerNode()getOwnerNode.AbstractCSSRuleImplgetOwnerRule()getOwnerRule.CSSStyleSheetImpl.CSSStyleSheetRuleIndexgetRuleIndex()getRuleIndex.StringgetTitle()getTitle.inthashCode()voidinsertRule(String rule, int index)inserts a new rule.voidresetRuleIndex()Clean the index.voidsetCssRules(CSSRuleListImpl rules)setCssRules.voidsetDisabled(boolean disabled)We will need to respond more fully if a stylesheet is disabled, probably by generating an event for the main application.voidsetHref(String href)Set the href.voidsetMediaText(String mediaText)Set the media text.voidsetOwnerNode(Node ownerNode)Set the owner node.voidsetOwnerRule(AbstractCSSRuleImpl ownerRule)setOwnerRule.voidsetRuleIndex(CSSStyleSheetImpl.CSSStyleSheetRuleIndex index)Set the CSSStyleSheetRuleIndex.voidsetTitle(String title)Set the title.StringtoString()
-
-
-
Method Detail
-
getDisabled
public boolean getDisabled()
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 Node getOwnerNode()
getOwnerNode.
- Returns:
- the owner node
-
getHref
public String getHref()
getHref.
- Returns:
- the href
-
getTitle
public String getTitle()
getTitle.
- Returns:
- the title
-
getMedia
public MediaListImpl getMedia()
getMedia.
- Returns:
- the media list
-
getOwnerRule
public AbstractCSSRuleImpl getOwnerRule()
getOwnerRule.
- Returns:
- the owner rule
-
getCssRules
public CSSRuleListImpl getCssRules()
getCssRules.
- Returns:
- the css rules
-
insertRule
public void insertRule(String rule, int index) throws DOMException
inserts a new rule.- Parameters:
rule- the rule to insertindex- the insert pos- Throws:
DOMException- in case of error
-
deleteRule
public void deleteRule(int index) throws DOMExceptiondelete the rule at the given pos.- Parameters:
index- the pos- Throws:
DOMException- in case of error
-
setOwnerNode
public void setOwnerNode(Node ownerNode)
Set the owner node.- Parameters:
ownerNode- the new node
-
setHref
public void setHref(String href)
Set the href.- Parameters:
href- the new href
-
setTitle
public void setTitle(String title)
Set the title.- Parameters:
title- the new title
-
setMediaText
public void setMediaText(String mediaText)
Set the media text.- Parameters:
mediaText- the new media text
-
setOwnerRule
public void setOwnerRule(AbstractCSSRuleImpl ownerRule)
setOwnerRule.
- Parameters:
ownerRule- the new ownerRule
-
setCssRules
public void setCssRules(CSSRuleListImpl rules)
setCssRules.
- Parameters:
rules- the new rules
-
getRuleIndex
public CSSStyleSheetImpl.CSSStyleSheetRuleIndex getRuleIndex()
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.
-
-