3.2.1: 2012-12-13

net.sf.basedb.clients.web.taglib
Class StylableTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by net.sf.basedb.clients.web.taglib.StylableTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
Direct Known Subclasses:
Button, Button, ButtonGroup, ColumnDef, Data, Form, Header, HeaderRow, Headers, Help, HideableSection, Icon, Label, Menu, Menuitem, Menuseparator, Navigator, Panel, Path, PathElement, PresetSelector, Row, Rows, Submenu, TabControl, Table, Toolbar

public abstract class StylableTag
extends TagSupport

Generic tag class for tags that want to support id, class and style of the main html object they use. The class can be specified as a main class and a subclass which is added instead of replacing the main class.

Since:
3.1
Author:
Nicklas
See Also:
Serialized Form
Last modified
$Date: 2011-12-07 14:43:15 +0100 (Wed, 07 Dec 2011) $

Field Summary
private  String clazz
           
private static long serialVersionUID
           
private  String style
           
private  String subclass
           
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
protected StylableTag(String defaultClass)
          Create a new stylable tag.
 
Method Summary
protected  void addIdAndStyles(StringBuilder sb, String... extraClasses)
          Add id, class and style attributes the the stringbuilder.
 String getClazz()
           
 String getFullClass(String... extraClasses)
          Get the full class (eg. main and subclass) as a single string.
 String getStyle()
           
 String getSubclass()
           
 void setClazz(String clazz)
           
 void setStyle(String style)
           
 void setSubclass(String subclass)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

clazz

private String clazz

subclass

private String subclass

style

private String style
Constructor Detail

StylableTag

protected StylableTag(String defaultClass)
Create a new stylable tag.

Parameters:
defaultClass - The default class to use if the tag doesn't override with it's own value
Method Detail

setClazz

public void setClazz(String clazz)

getClazz

public String getClazz()

setSubclass

public void setSubclass(String subclass)

getSubclass

public String getSubclass()

setStyle

public void setStyle(String style)

getStyle

public String getStyle()

getFullClass

public String getFullClass(String... extraClasses)
Get the full class (eg. main and subclass) as a single string.

Parameters:
extraClasses - Additional classes that should also be added
Returns:
The combined class or null if no class has been set

addIdAndStyles

protected void addIdAndStyles(StringBuilder sb,
                              String... extraClasses)
Add id, class and style attributes the the stringbuilder.


3.2.1: 2012-12-13