|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.tum.cs.commons.html.CSSDeclarationBlock
public class CSSDeclarationBlock
This class describes a set of CSS declarations (property value pairs). Additionally it allows for simple multiple inheritance, where the properties of all inherited blocks are merged (including the block itself). The classes coming later in the inheritance list and the block itself will overwrite any properties defined multiple times.
Constructor Summary | |
---|---|
CSSDeclarationBlock(CSSDeclarationBlock superBlock,
java.lang.Object... values)
Create new declaration block. |
|
CSSDeclarationBlock(java.lang.Object... values)
Create new declaration block. |
Method Summary | |
---|---|
java.lang.String |
getProperty(java.lang.String 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(java.lang.String 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. one property in each line followed by a colon, the value, and a semicolon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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).Method Detail |
---|
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(java.lang.String property)
public java.lang.String getProperty(java.lang.String property)
public CSSDeclarationBlock inheritFrom(CSSDeclarationBlock css)
public void writeOut(java.io.PrintStream ps, java.lang.String indent)
public java.lang.String toInlineStyle()
|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |