NextApp Echo
App Container 1.1.4

nextapp.echoservlet.html
Class Style

java.lang.Object
  extended bynextapp.echoservlet.html.Style
All Implemented Interfaces:
Renderable, java.io.Serializable

public class Style
extends java.lang.Object
implements Renderable, java.io.Serializable

A representation of a CSS style that may be associated with multiple types of elements.

See Also:
Serialized Form

Field Summary
static java.lang.String PERCENT_UNITS
          A unit suffix for percent units.
static java.lang.String PIXEL_UNITS
          A unit suffix for pixel units.
static java.lang.String POINT_UNITS
          A unit suffix for point units.
 
Fields inherited from interface nextapp.echoservlet.html.Renderable
INDENT_STRING
 
Constructor Summary
Style(java.lang.String id)
          Creates a new style with the given identifier.
 
Method Summary
 void addAttribute(java.lang.String name, int value)
          Adds an integer attribute (with no units) to this style.
 void addAttribute(java.lang.String name, int value, java.lang.String units)
          Adds an integer attribute with the specified units to this style.
 void addAttribute(java.lang.String name, java.lang.String value)
          Adds a text attribute to the style.
 void addElementType(java.lang.String elementType)
          Adds an element type to the style.
 void addPseudoAttribute(java.lang.String pseudonym, java.lang.String name, int value)
          Adds a pseudoclass integer attribute to the style.
 void addPseudoAttribute(java.lang.String pseudonym, java.lang.String name, java.lang.String value)
          Adds a pseudoclass attribute to the style.
 void render(java.io.PrintWriter pw, int depth, boolean parentWhitespaceRelevant)
          Renders this style to the given PrintWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERCENT_UNITS

public static final java.lang.String PERCENT_UNITS
A unit suffix for percent units.

See Also:
Constant Field Values

PIXEL_UNITS

public static final java.lang.String PIXEL_UNITS
A unit suffix for pixel units.

See Also:
Constant Field Values

POINT_UNITS

public static final java.lang.String POINT_UNITS
A unit suffix for point units.

See Also:
Constant Field Values
Constructor Detail

Style

public Style(java.lang.String id)
Creates a new style with the given identifier.

Parameters:
id - The identifier of this style.
Method Detail

addElementType

public void addElementType(java.lang.String elementType)
Adds an element type to the style. The style will be rendered identically for each element type that is specified. For example, a single style might be used for the elements <A>, <INPUT> and <TD>.

Parameters:
elementType - The element to be added, e.g. "a", "input", or "td".

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Adds a text attribute to the style.

Parameters:
name - The name of the attribute.
value - The value of the attribute.

addAttribute

public void addAttribute(java.lang.String name,
                         int value)
Adds an integer attribute (with no units) to this style.

Parameters:
name - The name of the attribute.
value - The value of the attribute.

addAttribute

public void addAttribute(java.lang.String name,
                         int value,
                         java.lang.String units)
Adds an integer attribute with the specified units to this style.

Parameters:
name - The name of the attribute.
value - The value of the attribute.
units - The units of the value.

addPseudoAttribute

public void addPseudoAttribute(java.lang.String pseudonym,
                               java.lang.String name,
                               java.lang.String value)
Adds a pseudoclass attribute to the style.

Parameters:
pseudonym - The name of the pseudoclass.
name - The name of the attribute.
value - The value of the attribute.

addPseudoAttribute

public void addPseudoAttribute(java.lang.String pseudonym,
                               java.lang.String name,
                               int value)
Adds a pseudoclass integer attribute to the style.

Parameters:
pseudonym - The name of the pseudoclass.
name - The name of the attribute.
value - The value of the attribute.

render

public void render(java.io.PrintWriter pw,
                   int depth,
                   boolean parentWhitespaceRelevant)
Renders this style to the given PrintWriter.

Specified by:
render in interface Renderable
Parameters:
pw - The PrintWriter to render to.
depth - The indentation depth that should be applied to the element being rendered.
parentWhitespaceRelevant - A flag that indicates whether the containing element is sensitive to white space.
See Also:
Renderable.render(PrintWriter, int, boolean)

NextApp Echo
App Container 1.1.4