java.lang.Object
io.sf.carte.doc.style.css.om.MediaList
- All Implemented Interfaces:
MediaQueryList,Serializable,MediaList
Old
MediaList and MediaQueryList implementation,
supporting lists of plain media types (not media queries).
You can use it as a faster MediaQueryList implementation when you
know that the media does not involve media queries.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(MediaQueryListListener listener) Appends a listener to the list of media query list listeners, unless it is already in that list.voidappendMedium(String newMedium) static MediaListcreateFromMediaList(MediaList list) static MediaListCreate a media list for all media.static MediaListcreateMediaList(String media) Create a media list for the given media.static MediaListcreateMediaList(SACMediaList media) Create a media list for the given SAC media list.static MediaListCreate an unmodifiable media list for all media.static MediaListcreateUnmodifiable(String media) Create an unmodifiable media list for the given media.voiddeleteMedium(String oldMedium) booleanGet the exceptions found while parsing the query, if any.intgetMedia()Get the serialized form of this media query list.Get a minified serialized form of this media query list.booleanDid this media query list produce errors when being parsed ?inthashCode()booleanIs this an all-media list?booleanDetermine if this list is composed only of queries that evaluate tonot all.item(int index) booleanmatches(MediaQueryList otherMedia) Does the given media list contain any media present in this list?booleanDoes this list match the given medium-canvas combination?voidremoveListener(MediaQueryListListener listener) Removes a listener from the list of media query list listeners.voidsetMediaText(String mediaText) toString()Gives an unmodifiable view of this media list.
-
Method Details
-
createMediaList
Create a media list for all media.- Returns:
- the media list.
-
createMediaList
Create a media list for the given media.- Parameters:
media- the media specification.- Returns:
- the media list.
-
createFromMediaList
-
createUnmodifiable
Create an unmodifiable media list for all media.- Returns:
- the unmodifiable media list.
-
createUnmodifiable
Create an unmodifiable media list for the given media.- Parameters:
media- the comma-separated list of media. Ifnull, the media list will be for all media.- Returns:
- the unmodifiable media list.
-
createMediaList
Create a media list for the given SAC media list.- Parameters:
media- the media list. Ifnull, the list will be for all media.- Returns:
- the media list.
-
getMedia
Description copied from interface:MediaQueryListGet the serialized form of this media query list.- Specified by:
getMediain interfaceMediaQueryList- Returns:
- the serialized form of this media query list.
-
getMediaText
- Specified by:
getMediaTextin interfaceMediaList
-
getMinifiedMedia
Description copied from interface:MediaQueryListGet a minified serialized form of this media query list.- Specified by:
getMinifiedMediain interfaceMediaQueryList- Returns:
- the minified serialized form of this media query list.
-
setMediaText
- Specified by:
setMediaTextin interfaceMediaList- Throws:
DOMException
-
getLength
public int getLength() -
item
-
deleteMedium
- Specified by:
deleteMediumin interfaceMediaList- Throws:
DOMException
-
appendMedium
- Specified by:
appendMediumin interfaceMediaList- Throws:
DOMException
-
isAllMedia
public boolean isAllMedia()Is this an all-media list?- Specified by:
isAllMediain interfaceMediaQueryList- Returns:
trueif this list matches all media,falseotherwise.
-
isNotAllMedia
public boolean isNotAllMedia()Description copied from interface:MediaQueryListDetermine if this list is composed only of queries that evaluate tonot all.- Specified by:
isNotAllMediain interfaceMediaQueryList- Returns:
trueif this list matches no media,falseotherwise.
-
hasErrors
public boolean hasErrors()Did this media query list produce errors when being parsed ?- Specified by:
hasErrorsin interfaceMediaQueryList- Returns:
trueif this list come from a media string that produced errors when parsed,falseotherwise.
-
getExceptions
Description copied from interface:MediaQueryListGet the exceptions found while parsing the query, if any.- Specified by:
getExceptionsin interfaceMediaQueryList- Returns:
- the exceptions found while parsing the query, or
nullif no errors were found while parsing the media query.
-
matches
Does the given media list contain any media present in this list?- Specified by:
matchesin interfaceMediaQueryList- Parameters:
otherMedia- the other media list to test.- Returns:
trueif the other list contains any media which belongs to this list,falseotherwise.
-
matches
Does this list match the given medium-canvas combination?Unless
mediumis a media query string, matches are according to HTML4 spec, section 6.13.- Specified by:
matchesin interfaceMediaQueryList- Parameters:
medium- the lowercase name of the medium to test for.canvas- the canvas where the document is to be rendered, or null if no canvas.- Returns:
trueif this list matches the supplied media name and canvas, false otherwise.
-
unmodifiable
Gives an unmodifiable view of this media list.- Returns:
- an unmodifiable view of this media list.
-
hashCode
public int hashCode() -
equals
-
toString
-
addListener
Description copied from interface:MediaQueryListAppends a listener to the list of media query list listeners, unless it is already in that list.- Specified by:
addListenerin interfaceMediaQueryList- Parameters:
listener- the listener to be appended.- Throws:
DOMException
-
removeListener
Description copied from interface:MediaQueryListRemoves a listener from the list of media query list listeners.- Specified by:
removeListenerin interfaceMediaQueryList- Parameters:
listener- the listener to be removed.- Throws:
DOMException
-