org.intermine.web.tags.disclosure
Class DisclosureTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by org.intermine.web.tags.disclosure.BaseDisclosureTag
          extended by org.intermine.web.tags.disclosure.DisclosureTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

public class DisclosureTag
extends BaseDisclosureTag

This class renders disclosure tag. See tag library descriptor for tag description.


Constructor Summary
DisclosureTag()
           
 
Method Summary
 void doTag()
          Renders tag.
protected  java.lang.String getDefaultStyleClass()
          Returns default style class.
 java.lang.String getId()
          Gets element id.
 java.lang.String getLink()
          Returns link switching between displayed and hidden state.
 java.lang.String getOnClick()
           
 boolean getOpened()
          Returns true if disclosure is opened else false.
 java.lang.String getType()
          Returns type of tag.
 boolean isConsistentType()
           
 void setId(java.lang.String id)
          Sets element id.
 void setOnClick(java.lang.String onChange)
           
 void setOpened(boolean opened)
          Sets new state of disclosure.
 void setType(java.lang.String type)
          Sets type of tag.
 
Methods inherited from class org.intermine.web.tags.disclosure.BaseDisclosureTag
getStyle, getStyleClass, printStyleAndClass, setStyle, setStyleClass
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisclosureTag

public DisclosureTag()
Method Detail

getType

public java.lang.String getType()
Returns type of tag. At this moment is relevant only 'consistent' type.

Returns:
type of tag

setType

public void setType(java.lang.String type)
Sets type of tag.

Parameters:
type - type

getDefaultStyleClass

protected java.lang.String getDefaultStyleClass()
Returns default style class. Each of tags has its own default style class. So if you want to set style of disclosure tag, just simply set 'disclosure' class in style sheet file.

Overrides:
getDefaultStyleClass in class BaseDisclosureTag
Returns:
default style class

getOnClick

public java.lang.String getOnClick()
Returns:
additional javascript code, that should be executed on element change.

setOnClick

public void setOnClick(java.lang.String onChange)
Parameters:
onChange - additional javascript code, that should be executed on element change.

setId

public void setId(java.lang.String id)
Sets element id. Disclosure tag is implemented with div, it sets div id.

Parameters:
id - element id

getId

public java.lang.String getId()
Gets element id.

Returns:
element id

getOpened

public boolean getOpened()
Returns true if disclosure is opened else false.

Returns:
disclosure state

isConsistentType

public boolean isConsistentType()
Returns:
true if disclosure is consistent type, i.e. saves its state (opened or closed) during user session

setOpened

public void setOpened(boolean opened)
Sets new state of disclosure.

Parameters:
opened - true if should be opened

doTag

public void doTag()
           throws javax.servlet.jsp.JspException,
                  java.io.IOException
Renders tag.

Specified by:
doTag in interface javax.servlet.jsp.tagext.SimpleTag
Overrides:
doTag in class javax.servlet.jsp.tagext.SimpleTagSupport
Throws:
java.io.IOException - if error occurs during writing to stream output
javax.servlet.jsp.JspException - if JspException error occurs during rendering nested tags

getLink

public java.lang.String getLink()
Returns link switching between displayed and hidden state.

Returns:
link