All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.w3c.css.properties.CssListStyle

java.lang.Object
   |
   +----org.w3c.css.properties.CssProperty
           |
           +----org.w3c.css.properties.CssListStyle

public class CssListStyle
extends CssProperty
implements CssOperator

   'list-style'

Value: <keyword> || <position> || <url>
Initial: not defined for shorthand properties
Applies to: elements with 'display' value 'list-item'
Inherited: yes
Percentage values: N/A

The 'list-style' property is a shorthand notation for setting the three properties 'list-style-type', 'list-style-image' and 'list-style-position' at the same place in the style sheet.

   UL { list-style: upper-roman inside }
   UL UL { list-style: circle outside }
   LI.square { list-style: square }
 

Setting 'list-style' directly on 'LI' elements can have unexpected results. Consider:

   <STYLE TYPE="text/css">
     OL.alpha LI  { list-style: lower-alpha }
     UL LI        { list-style: disc }
   </STYLE>
   <BODY>
     <OL CLASS=alpha>
       <LI>level 1
       <UL>
          <LI>level 2
       </UL>
     </OL>
   </BODY>
 

Since the specificity (as defined in the cascading order) is higher for the first rule in the style sheet in the example above, it will override the second rule on all 'LI' elements and only 'lower-alpha' list styles will be used. It is therefore recommended to set 'list-style' only on the list type elements:

   OL.alpha  { list-style: lower-alpha }
   UL        { list-style: disc }
 

In the above example, inheritance will transfer the 'list-style' values from 'OL' and 'UL' elements to 'LI' elements.

A URL value can be combined with any other value:

   UL { list-style: url(http://png.com/ellipse.png) disc }
 

In the example above, the 'disc' will be used when the image is unavailable.


Constructor Index

 o CssListStyle()
Create a new CssListStyle
 o CssListStyle(CssExpression)
Create a new CssListStyle

Method Index

 o addToStyle(CssStyle)
Add this property to the CssStyle
 o equals(CssProperty)
Compares two properties for equality.
 o get()
Returns the value of this property
 o getImportant()
Returns true if this property is important.
 o getPropertyInStyle(CssStyle, boolean)
Get this property in the style.
 o getPropertyName()
Returns the name of this property
 o isSoftlyInherited()
Returns true if this property is "softly" inherited e.g.
 o print(CssPrinterStyle)
Print this property.
 o setImportant()
Set this property to be important.
 o setInfo(int, String)
Update the source file and the line.
 o setSelectors(CssSelectors)
Set the context.
 o toString()
Returns a string representation of the object.

Constructors

 o CssListStyle
 public CssListStyle()
Create a new CssListStyle

 o CssListStyle
 public CssListStyle(CssExpression expression) throws InvalidParamException
Create a new CssListStyle

Parameters:
expression - The expression for this property
Throws: InvalidParamException
Values are incorrect

Methods

 o get
 public Object get()
Returns the value of this property

Overrides:
get in class CssProperty
 o getPropertyName
 public String getPropertyName()
Returns the name of this property

Overrides:
getPropertyName in class CssProperty
 o isSoftlyInherited
 public boolean isSoftlyInherited()
Returns true if this property is "softly" inherited e.g. his value equals inherit

Overrides:
isSoftlyInherited in class CssProperty
 o toString
 public String toString()
Returns a string representation of the object.

Overrides:
toString in class CssProperty
 o setImportant
 public void setImportant()
Set this property to be important. Overrides this method for a macro

Overrides:
setImportant in class CssProperty
 o getImportant
 public boolean getImportant()
Returns true if this property is important. Overrides this method for a macro

Overrides:
getImportant in class CssProperty
 o print
 public void print(CssPrinterStyle printer)
Print this property.

Overrides:
print in class CssProperty
See Also:
toString, getPropertyName
 o setSelectors
 public void setSelectors(CssSelectors selector)
Set the context. Overrides this method for a macro

Overrides:
setSelectors in class CssProperty
See Also:
order, handleRule
 o addToStyle
 public void addToStyle(CssStyle style)
Add this property to the CssStyle

Parameters:
style - The CssStyle
Overrides:
addToStyle in class CssProperty
 o getPropertyInStyle
 public CssProperty getPropertyInStyle(CssStyle style,
                                       boolean resolve)
Get this property in the style.

Parameters:
style - The style where the property is
resolve - if true, resolve the style to find this property
Overrides:
getPropertyInStyle in class CssProperty
 o setInfo
 public void setInfo(int line,
                     String source)
Update the source file and the line. Overrides this method for a macro

Parameters:
line - The line number where this property is defined
source - The source file where this property is defined
Overrides:
setInfo in class CssProperty
 o equals
 public boolean equals(CssProperty property)
Compares two properties for equality.

Parameters:
value - The other property.
Overrides:
equals in class CssProperty

All Packages  Class Hierarchy  This Package  Previous  Next  Index