public abstract class StylableTag extends TagSupport implements DynamicAttributes, DynamicActionAttributes
Modifier and Type | Field and Description |
---|---|
private String |
clazz |
private Map<String,DynamicActionAttribute> |
dynamicAttributes |
private static long |
serialVersionUID |
private String |
style |
private String |
subclass |
id, pageContext
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Modifier | Constructor and Description |
---|---|
protected |
StylableTag(String defaultClass)
Create a new stylable tag.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addDynamicAttributes(StringBuilder sb) |
protected void |
addIdAndStyles(StringBuilder sb,
String... extraClasses)
Add id, class and style attributes the the stringbuilder.
|
String |
getClazz() |
Iterator<DynamicActionAttribute> |
getDynamicActionAttributes()
Get an iterator that return all dynamic attributes.
|
protected DynamicActionAttribute |
getDynamicAttribute(String name)
Get the dynamic attribute for the given name
|
String |
getFullClass(String... extraClasses)
Get the full class (eg. main and subclass) as a single
string.
|
protected String |
getIdPrefix()
Optional prefix to include in the 'id' attribute.
|
String |
getStyle() |
String |
getSubclass() |
void |
setClazz(String clazz) |
void |
setDynamicAttribute(String uri,
String name,
Object value) |
protected void |
setMoreDynamicAttributes(Iterator<DynamicActionAttribute> moreAttributes) |
void |
setPageContext(PageContext pageContext)
Reset the dynamic attributes to make sure old ones are not
included in case the tag object is reused.
|
void |
setStyle(String style) |
void |
setSubclass(String subclass) |
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
private static final long serialVersionUID
private String clazz
private String subclass
private String style
private Map<String,DynamicActionAttribute> dynamicAttributes
protected StylableTag(String defaultClass)
defaultClass
- The default class to use if the tag doesn't
override with it's own valuepublic void setPageContext(PageContext pageContext)
setPageContext
in interface Tag
setPageContext
in class TagSupport
public void setClazz(String clazz)
public String getClazz()
public void setSubclass(String subclass)
public String getSubclass()
public void setStyle(String style)
public String getStyle()
public void setDynamicAttribute(String uri, String name, Object value)
setDynamicAttribute
in interface DynamicAttributes
public Iterator<DynamicActionAttribute> getDynamicActionAttributes()
DynamicActionAttributes
getDynamicActionAttributes
in interface DynamicActionAttributes
public String getFullClass(String... extraClasses)
extraClasses
- Additional classes that should also be addedprotected String getIdPrefix()
addIdAndStyles(StringBuilder, String...)
.protected DynamicActionAttribute getDynamicAttribute(String name)
name
- The name of the attributeprotected void addIdAndStyles(StringBuilder sb, String... extraClasses)
protected void setMoreDynamicAttributes(Iterator<DynamicActionAttribute> moreAttributes)
protected void addDynamicAttributes(StringBuilder sb)