public class CSSDeclarationBlock extends java.lang.Object
Constructor and Description |
---|
CSSDeclarationBlock(CSSDeclarationBlock superBlock,
java.lang.Object... values)
Create new declaration block.
|
CSSDeclarationBlock(java.lang.Object... values)
Create new declaration block.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getProperty(ECSSProperty property)
Returns the value of the property (or null if it is not defined for this
block).
|
CSSDeclarationBlock |
inheritFrom(CSSDeclarationBlock css)
Adds another block to inherit from.
|
CSSDeclarationBlock |
removeProperty(ECSSProperty property)
Removes the property from this block (whether it exists or not).
|
CSSDeclarationBlock |
setBorder(java.lang.String width,
java.lang.String style,
java.lang.String color)
Sets the border to the given values.
|
CSSDeclarationBlock |
setBorderColor(java.lang.String color)
Sets the border color to the given value.
|
CSSDeclarationBlock |
setBorderStyle(java.lang.String style)
Sets the border style to the given value.
|
CSSDeclarationBlock |
setBorderWidth(java.lang.String width)
Sets the border width to the given value.
|
CSSDeclarationBlock |
setMargin(java.lang.String value)
Sets the margin to the given value.
|
CSSDeclarationBlock |
setPadding(java.lang.String value)
Sets the padding to the given value.
|
CSSDeclarationBlock |
setProperty(ECSSProperty property,
java.lang.String value)
Adds a property to this block.
|
java.lang.String |
toInlineStyle()
Returns the full (including inherited) properties as a single line string
using the format suitable for inline styles as used in HTML.
|
void |
writeOut(java.io.PrintStream ps,
java.lang.String indent)
Writes the full (including inherited) properties into the given stream
using the format for CSS files, i.e.
|
public CSSDeclarationBlock(java.lang.Object... values)
values
- the property value pairs to add (so the number must be even).public CSSDeclarationBlock(CSSDeclarationBlock superBlock, java.lang.Object... values)
superBlock
- the block to inherit from.values
- the property value pairs to add (so the number must be even).public CSSDeclarationBlock setProperty(ECSSProperty property, java.lang.String value)
public CSSDeclarationBlock setMargin(java.lang.String value)
public CSSDeclarationBlock setPadding(java.lang.String value)
public CSSDeclarationBlock setBorder(java.lang.String width, java.lang.String style, java.lang.String color)
public CSSDeclarationBlock setBorderWidth(java.lang.String width)
public CSSDeclarationBlock setBorderStyle(java.lang.String style)
public CSSDeclarationBlock setBorderColor(java.lang.String color)
public CSSDeclarationBlock removeProperty(ECSSProperty property)
public java.lang.String getProperty(ECSSProperty property)
public CSSDeclarationBlock inheritFrom(CSSDeclarationBlock css)
public void writeOut(java.io.PrintStream ps, java.lang.String indent)
public java.lang.String toInlineStyle()