| java.lang.Object org.zkoss.xml.HTMLs
HTMLs | public class HTMLs (Code) | | Utilities for HTML attributes and styles.
author: tomyeh |
Method Summary | |
final public static void | appendAttribute(StringBuffer sb, String name, String val) Appends an attribute to the string buffer for HTML/XML (name="val"). | final public static void | appendAttribute(StringBuffer sb, String name, int val) Appends an attribute with a int value to the string buffer for HTML/XML (name="val"). | final public static void | appendAttribute(StringBuffer sb, String name, long val) Appends an attribute with a long value to the string buffer for HTML/XML (name="val"). | final public static void | appendAttribute(StringBuffer sb, String name, short val) Appends an attribute with a short value to the string buffer for HTML/XML (name="val"). | final public static void | appendAttribute(StringBuffer sb, String name, boolean val) Appends an attribute to the string buffer for HTML/XML (name="val"). | final public static void | appendStyle(StringBuffer sb, String name, String val) Appends a style value to the string buffer for HTML/XML (name:"val";). | final public static int | getSubstyleIndex(String style, String substyle) Returns the position of the specified substyle, or -1 if not found. | final public static String | getSubstyleValue(String style, int j) Returns the value starting at the specified index (never null). | final public static String | getTextRelevantStyle(String style) Retrieves text relevant CSS styles.
For example, if style is
"border: 1px solid blue; font-size: 10px; padding: 3px; color: black;",
then "font-size: 10px;color: black;" is returned.
null if style is null. | final public static boolean | isOrphanTag(String tagname) Returns whether the specified tag is an 'orphan' tag. |
appendAttribute | final public static void appendAttribute(StringBuffer sb, String name, String val)(Code) | | Appends an attribute to the string buffer for HTML/XML (name="val").
If val is null or empty (if String), nothing is generated.
Note:
XMLs.encodeAttribute is called automatically
to encode val.
|
appendAttribute | final public static void appendAttribute(StringBuffer sb, String name, int val)(Code) | | Appends an attribute with a int value to the string buffer for HTML/XML (name="val").
|
appendAttribute | final public static void appendAttribute(StringBuffer sb, String name, long val)(Code) | | Appends an attribute with a long value to the string buffer for HTML/XML (name="val").
since: 3.0.2 |
appendAttribute | final public static void appendAttribute(StringBuffer sb, String name, short val)(Code) | | Appends an attribute with a short value to the string buffer for HTML/XML (name="val").
since: 3.0.2 |
appendAttribute | final public static void appendAttribute(StringBuffer sb, String name, boolean val)(Code) | | Appends an attribute to the string buffer for HTML/XML (name="val").
|
appendStyle | final public static void appendStyle(StringBuffer sb, String name, String val)(Code) | | Appends a style value to the string buffer for HTML/XML (name:"val";).
If val is null or empty (if String), nothing is generated.
|
getSubstyleIndex | final public static int getSubstyleIndex(String style, String substyle)(Code) | | Returns the position of the specified substyle, or -1 if not found.
Parameters: style - the style Parameters: substyle - the sub-style, e.g., display. exception: IllegalArgumentException - if style is null, or substyle is nullor empty. |
getSubstyleValue | final public static String getSubstyleValue(String style, int j)(Code) | | Returns the value starting at the specified index (never null).
Note: the index is usually the returned vale of
HTMLs.getSubstyleIndex .
Parameters: style - the style Parameters: j - the index that the substyle starts at (including the style's name) |
getTextRelevantStyle | final public static String getTextRelevantStyle(String style)(Code) | | Retrieves text relevant CSS styles.
For example, if style is
"border: 1px solid blue; font-size: 10px; padding: 3px; color: black;",
then "font-size: 10px;color: black;" is returned.
null if style is null. Otherwise, it never returns null. |
isOrphanTag | final public static boolean isOrphanTag(String tagname)(Code) | | Returns whether the specified tag is an 'orphan' tag.
By orphan we mean it doesn't support the format of
<xx> </xx>.
For example, br and img are orphan tags.
Parameters: tagname - the tag name, e.g., br and tr. since: 3.0.0 |
|
|