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 TypeMethodDescriptionvoid
addListener
(MediaQueryListListener listener) Appends a listener to the list of media query list listeners, unless it is already in that list.void
appendMedium
(String newMedium) static MediaList
createFromMediaList
(MediaList list) static MediaList
Create a media list for all media.static MediaList
createMediaList
(String media) Create a media list for the given media.static MediaList
createMediaList
(SACMediaList media) Create a media list for the given SAC media list.static MediaList
Create an unmodifiable media list for all media.static MediaList
createUnmodifiable
(String media) Create an unmodifiable media list for the given media.void
deleteMedium
(String oldMedium) boolean
Get the exceptions found while parsing the query, if any.int
getMedia()
Get the serialized form of this media query list.Get a minified serialized form of this media query list.boolean
Did this media query list produce errors when being parsed ?int
hashCode()
boolean
Is this an all-media list?boolean
Determine if this list is composed only of queries that evaluate tonot all
.item
(int index) boolean
matches
(MediaQueryList otherMedia) Does the given media list contain any media present in this list?boolean
Does this list match the given medium-canvas combination?void
removeListener
(MediaQueryListListener listener) Removes a listener from the list of media query list listeners.void
setMediaText
(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:MediaQueryList
Get the serialized form of this media query list.- Specified by:
getMedia
in interfaceMediaQueryList
- Returns:
- the serialized form of this media query list.
-
getMediaText
- Specified by:
getMediaText
in interfaceMediaList
-
getMinifiedMedia
Description copied from interface:MediaQueryList
Get a minified serialized form of this media query list.- Specified by:
getMinifiedMedia
in interfaceMediaQueryList
- Returns:
- the minified serialized form of this media query list.
-
setMediaText
- Specified by:
setMediaText
in interfaceMediaList
- Throws:
DOMException
-
getLength
public int getLength() -
item
-
deleteMedium
- Specified by:
deleteMedium
in interfaceMediaList
- Throws:
DOMException
-
appendMedium
- Specified by:
appendMedium
in interfaceMediaList
- Throws:
DOMException
-
isAllMedia
public boolean isAllMedia()Is this an all-media list?- Specified by:
isAllMedia
in interfaceMediaQueryList
- Returns:
true
if this list matches all media,false
otherwise.
-
isNotAllMedia
public boolean isNotAllMedia()Description copied from interface:MediaQueryList
Determine if this list is composed only of queries that evaluate tonot all
.- Specified by:
isNotAllMedia
in interfaceMediaQueryList
- Returns:
true
if this list matches no media,false
otherwise.
-
hasErrors
public boolean hasErrors()Did this media query list produce errors when being parsed ?- Specified by:
hasErrors
in interfaceMediaQueryList
- Returns:
true
if this list come from a media string that produced errors when parsed,false
otherwise.
-
getExceptions
Description copied from interface:MediaQueryList
Get the exceptions found while parsing the query, if any.- Specified by:
getExceptions
in interfaceMediaQueryList
- Returns:
- the exceptions found while parsing the query, or
null
if no errors were found while parsing the media query.
-
matches
Does the given media list contain any media present in this list?- Specified by:
matches
in interfaceMediaQueryList
- Parameters:
otherMedia
- the other media list to test.- Returns:
true
if the other list contains any media which belongs to this list,false
otherwise.
-
matches
Does this list match the given medium-canvas combination?Unless
medium
is a media query string, matches are according to HTML4 spec, section 6.13.- Specified by:
matches
in 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:
true
if 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:MediaQueryList
Appends a listener to the list of media query list listeners, unless it is already in that list.- Specified by:
addListener
in interfaceMediaQueryList
- Parameters:
listener
- the listener to be appended.- Throws:
DOMException
-
removeListener
Description copied from interface:MediaQueryList
Removes a listener from the list of media query list listeners.- Specified by:
removeListener
in interfaceMediaQueryList
- Parameters:
listener
- the listener to be removed.- Throws:
DOMException
-