|
NextApp Echo App Container 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echoservlet.html.Style
A representation of a CSS style that may be associated with multiple types of elements.
Field Summary | |
private java.util.Map |
attributes
|
private static java.lang.String |
DOUBLE_INDENT
|
private java.util.Set |
elementTypes
|
private java.lang.String |
id
|
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. |
private java.util.Map |
pseudonyms
|
private static java.lang.String |
TRIPLE_INDENT
|
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 . |
private void |
renderClass(java.io.PrintWriter pw,
java.lang.String elementType,
java.lang.String pseudonym,
java.util.Map attributeData)
Renders a class element of the 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 |
private static final java.lang.String DOUBLE_INDENT
private static final java.lang.String TRIPLE_INDENT
private java.util.Map attributes
private java.util.Map pseudonyms
private java.util.Set elementTypes
private java.lang.String id
public static final java.lang.String PERCENT_UNITS
public static final java.lang.String PIXEL_UNITS
public static final java.lang.String POINT_UNITS
Constructor Detail |
public Style(java.lang.String id)
id
- The identifier of this style.Method Detail |
public void addElementType(java.lang.String elementType)
elementType
- The element to be added, e.g.
"a", "input", or "td".public void addAttribute(java.lang.String name, java.lang.String value)
name
- The name of the attribute.value
- The value of the attribute.public void addAttribute(java.lang.String name, int value)
name
- The name of the attribute.value
- The value of the attribute.public void addAttribute(java.lang.String name, int value, java.lang.String units)
name
- The name of the attribute.value
- The value of the attribute.units
- The units of the value.public void addPseudoAttribute(java.lang.String pseudonym, java.lang.String name, java.lang.String value)
pseudonym
- The name of the pseudoclass.name
- The name of the attribute.value
- The value of the attribute.public void addPseudoAttribute(java.lang.String pseudonym, java.lang.String name, int value)
pseudonym
- The name of the pseudoclass.name
- The name of the attribute.value
- The value of the attribute.public void render(java.io.PrintWriter pw, int depth, boolean parentWhitespaceRelevant)
PrintWriter
.
render
in interface Renderable
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.Renderable.render(PrintWriter, int, boolean)
private void renderClass(java.io.PrintWriter pw, java.lang.String elementType, java.lang.String pseudonym, java.util.Map attributeData)
PrintWriter
.
pw
- The PrintWriter
to print the output to.elementType
- The element type which the style is describing,
e.g. "a", "span", etc.pseudonym
- The pseudoclass being rendered (null if the main
class is being rendered).attributeData
- A map containing attributes (name/value pairs)
as Strings.
|
NextApp Echo App Container 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |