Package org.htmlunit.cssparser.dom
Class CSSMediaRuleImpl
java.lang.Object
org.htmlunit.cssparser.parser.AbstractLocatable
org.htmlunit.cssparser.dom.AbstractCSSRuleImpl
org.htmlunit.cssparser.dom.CSSMediaRuleImpl
- All Implemented Interfaces:
Serializable
,Locatable
Implementation of CSSMediaRule.
- Author:
- Ronald Brill
- See Also:
-
Constructor Summary
ConstructorDescriptionCSSMediaRuleImpl
(CSSStyleSheetImpl parentStyleSheet, AbstractCSSRuleImpl parentRule, MediaListImpl media) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteRule
(int index) Removes a rule at the given index.boolean
getCssRules.getCssText.getMediaList.int
hashCode()
void
insertRule
(String rule, int index) Insert a new rule at the given index.void
setCssText
(String cssText) Sets the css text.void
setRuleList
(CSSRuleListImpl rules) Replaces the rule list.toString()
Methods inherited from class org.htmlunit.cssparser.dom.AbstractCSSRuleImpl
getParentRule, getParentStyleSheet, setParentRule, setParentStyleSheet
Methods inherited from class org.htmlunit.cssparser.parser.AbstractLocatable
getLocator, setLocator
-
Constructor Details
-
CSSMediaRuleImpl
public CSSMediaRuleImpl(CSSStyleSheetImpl parentStyleSheet, AbstractCSSRuleImpl parentRule, MediaListImpl media) Ctor.- Parameters:
parentStyleSheet
- the parent style sheetparentRule
- the parent rulemedia
- the media
-
-
Method Details
-
getCssText
getCssText.
- Specified by:
getCssText
in classAbstractCSSRuleImpl
- Returns:
- the current css text
-
setCssText
Sets the css text.- Specified by:
setCssText
in classAbstractCSSRuleImpl
- Parameters:
cssText
- the new css text- Throws:
DOMException
-
getMediaList
getMediaList.
- Returns:
- the media list
-
getCssRules
getCssRules.
- Returns:
- the css rules
-
insertRule
Insert a new rule at the given index.- Parameters:
rule
- the rule to be insertedindex
- the insert pos- Throws:
DOMException
- in case of error
-
deleteRule
Removes a rule at the given index.- Parameters:
index
- the insert pos- Throws:
DOMException
- in case of error
-
setRuleList
Replaces the rule list.- Parameters:
rules
- the new rule list
-
toString
-
equals
- Overrides:
equals
in classAbstractCSSRuleImpl
-
hashCode
public int hashCode()Description copied from class:AbstractCSSRuleImpl
- Overrides:
hashCode
in classAbstractCSSRuleImpl
-