org.wings.style
Interface Style

All Superinterfaces:
Cloneable, Renderable, Serializable
All Known Implementing Classes:
CSSStyle

public interface Style
extends Renderable, Serializable, Cloneable

A CSS Style definition.

A Style is collection of CSS property/value pairs that are applied to a specified component or component element. This target is defined by the CSS selector.

So this object can be understood as the OO equivalent of a CSS style definition likw i.e.
A.myStyle { color: red; background: #fff; }
which consists of a CSS selector before the braces and the CSS property/value list inside the braces.

Author:
Holger Engels, Benjamin Schmid

Method Summary
 Selector getSelector()
          A object defining on what this styles applies to.
 Map<CSSProperty,String> properties()
          Gets the Map of defined CSS properties.
 String put(CSSProperty styleProperty, String styleValue)
          Defines a CSS property/value pair in this style.
 boolean putAll(CSSAttributeSet attributes)
          Adds a set of CSS property/value pairs to this style definition.
 String remove(CSSProperty name)
          Removes an attribute from the list.
 
Methods inherited from interface org.wings.Renderable
write
 

Method Detail

getSelector

Selector getSelector()
A object defining on what this styles applies to.

Returns:
The CSS selector which defines to which elements this style applies to.

put

String put(CSSProperty styleProperty,
           String styleValue)
Defines a CSS property/value pair in this style.

Returns:
The previous style property value.

putAll

boolean putAll(CSSAttributeSet attributes)
Adds a set of CSS property/value pairs to this style definition.

Parameters:
attributes - Set of CSS property/value pairs to add to this style definition
Returns:
true if the style was changed, false if no modification was necessary

remove

String remove(CSSProperty name)
Removes an attribute from the list.

Parameters:
name - the attribute name
Returns:
The previous value for this CSS property

properties

Map<CSSProperty,String> properties()
Gets the Map of defined CSS properties.

Returns:
the map of CSS properties


wingS Swings ;-)