com.sas.taglib.servlet.tbeans
Class TreeViewTag

com.sas.taglib.servlet.tbeans.TreeViewTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally

public class TreeViewTag

TreeViewTag is the tag handler class for the sas:TreeView custom tag . TreeViewTag is invoked by the JSP page to evaluate the sas:TreeView custom tag during the execution of the page. Tag handler methods are called by the JSP page implementation class at various points during the evaluation of the tag. The tag handler methods in turn call methods on the underlying Transformation Bean object, TreeView, to execute the methods.

If you need to extend or modify the functionality of the sas:TreeView custom tag, you can subclass this tag handler class.

For More Information:

Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.

Refer to the Custom Tag Library Reference for usage information on the sas:TreeView custom tag.

Note: A snapshot of the AppDev Studio Developers Site is installed on your local Web server when you install AppDev Studio. To access the site from webAF, select Help -> Developer Site.

See Also:
TreeNodeTag, BaseTreeView, TreeView, Serialized Form

Field Summary
static java.lang.String RB_KEY
           
 
Fields inherited from class com.sas.taglib.BaseBodyTag
DELIMITERS
 
Constructor Summary
TreeViewTag()
           
 
Method Summary
protected  void applyAttributes()
          Sets the attributes on the underlying TreeView object.
 int doStartTag()
          Process the start tag for this instance.
 java.lang.String getDeselectNodeFunctionName()
          Gets the name of a JavaScript function which will be called to deselect a node.
 int getExpansionLevel()
          getExpansionLevel detemines what level the tree will be expanded when render.
 java.lang.String getImageLocation()
          getImageLocation returns the location of the images needed to construct the Tree.
 int getInitialExpansionLevel()
          getInitialExpansionLevel detemines what level the tree will be expanded when render.
 java.lang.String getLineStyle()
          Sets the line style used for the tree.
 java.lang.String getModel()
          Gets the model property (String).
 java.lang.String getNodeLoading()
          getNodeLoading returns the value of load_state which determines if the tree is written out all at once, or incrementally.
 java.lang.String getNodeRendererFunctionName()
          Gets the name of the JavaScript function which will be called to render a node.
 java.lang.String getPostExpandNodeFunctionName()
          Gets the name of a user-supplied JavaScript function which will be called after the node expands.
 java.lang.String getPostSelectNodeFunctionName()
          Gets the name of a user-supplied JavaScript function which will be called after the normal select behavior executes when a node is selected.
 java.lang.String getPreExpandNodeFunctionName()
          Gets the name of a user-supplied JavaScript function which will be called prior to node expansion.
 java.lang.String getPreSelectNodeFunctionName()
          Gets the name of a user-supplied JavaScript function which will be called prior to normal select behavior when a node is selected.
 java.lang.String getSelectedNode()
          getSelectedNode returns the node which is to be 'selected' at initial rendering of the tree.
 java.lang.String getSelectedNodesModel()
          Gets the selectedNodesModel property of the TreeViewTag.
 java.lang.String getSelectionMode()
          Returns the selectionMode.
 java.lang.String getSelectNodeFunctionName()
          Gets the name of a JavaScript function which will be called to select a node.
 java.lang.String getStyleClassPrefix()
          getStyleClassPrefix returns the style class prefix set for a tree.
 java.lang.String getTarget()
          Returns the value of the TARGET= argument used on the anchor tags generated.
protected  void initialize(boolean includeAttributes)
          Initializes attributes and variables for this tag handler.
 boolean isAutoChildrenVerify()
          Returns true if the autoChildrenCheckVerify is enabled, false otherwise.
 boolean isImageVisible()
          isImageVisible returns a boolean value that determines if Images are visible next to the node text.
 boolean isRootNodeVisible()
          isRootNodeVisible
 boolean isUsePlusMinus()
          isUsePlusMinus returns the boolean value of plus_minus which determines if the +/- images are to be used on the tree.
 boolean isUsingURLLinks()
          isUsingURLLinks returns a boolean value telling the TreeView whether or not to use the URL links set in the model.
 void setAutoChildrenVerify(boolean autoChildrenVerify)
          Enables the auto children check.
 void setDeselectNodeFunctionName(java.lang.String deselectFunctionName)
          Sets the name of a JavaScript function which will be called to deselect a node.
 void setExpansionLevel(int expansionLevel)
          setExpansionLevel detemines what level the tree will be expanded when render.
 void setImageLocation(java.lang.String imageLocation)
          setImageLocation the location of the images needed to construct the Tree.
 void setImageVisible(boolean imageVisible)
          setImageVisible sets node images visibile.
 void setInitialExpansionLevel(int initialExpansionLevel)
          setInitialExpansionLevel detemines what level the tree will be expanded when render.
 void setLineStyle(java.lang.String lineStyle)
          Sets the line style used for the tree.
 void setModel(java.lang.String model)
          Sets the model property (String).
 void setNodeLoading(java.lang.String load_state)
          setNodeLoading determines if the tree is written out all at once or incrementally.
 void setNodeRendererFunctionName(java.lang.String string)
          Sets the name of a JavaScript function which will be called to render a node.
 void setPostExpandNodeFunctionName(java.lang.String postExpandFunctionName)
          Sets the name of a user-supplied JavaScript function which will be called after the node expands.
 void setPostSelectNodeFunctionName(java.lang.String postSelectFunctionName)
          Sets the name of a user-supplied JavaScript function which will be called after the normal select behavior executes when a node is selected.
 void setPreExpandNodeFunctionName(java.lang.String preExpandFunctionName)
          Sets the name of a user-supplied JavaScript function which will be called prior to node expansion.
 void setPreSelectNodeFunctionName(java.lang.String preSelectFunctionName)
          Sets the name of a user-supplied JavaScript function which will be called prior to normal select behavior when a node is selected.
 void setRootNodeVisible(boolean rootNodeVisible)
          setRootNodeVisible set the rootnode visible.
 void setSelectedNode(java.lang.String selectedNode)
          setSelectedNode sets the node that is to be 'selected', or highlighed upon initial rendering of the tree.
 void setSelectedNodesModel(java.lang.String selectedNodesModel)
          * Sets the selectedNodesModel property (String).
 void setSelectionMode(java.lang.String selectionMode)
          Sets the selectionMode.
 void setSelectNodeFunctionName(java.lang.String selectFunctionName)
          Sets the name of a JavaScript function which will be called to select a node.
 void setStyleClassPrefix(java.lang.String styleClassPrefix)
          setStyleClassPrefix sets the prefix for a style class.
 void setTarget(java.lang.String target)
          Sets the value of the TARGET= argument used on the anchor tags generated.
 void setUsePlusMinus(boolean usePlusMinus)
          setUsePlusMinus determines whether or not to use the +/- images on the tree.
 void setUsingURLLinks(boolean usingURLLinks)
          setUsingURLLinks tells the TreeView whether or not to use the URL links set on the model.
 
Methods inherited from class com.sas.taglib.servlet.tbeans.BaseTransformationBodyTag
doEndTag, getCustomAttributes, getEpilog, getLocale, getName, getObjectDataProperty, getProlog, getRender, getRenderType, setCustomAttributes, setEpilog, setLocale, setName, setObjectDataProperty, setProlog, setRender, setRenderType
 
Methods inherited from class com.sas.taglib.BaseBodyTag
doCatch, doFinally, getApplyAttributes, getBodyStrings, getCompositeComponentKey, getInstantiate, getPageContext, getRef, getScope, getTagScope, getWrappedClassName, getWrappedObject, getWrappedObject, loadBeanInstance, newInstance, release, removeFromScope, searchContext, setApplyAttributes, setCompositeComponentKey, setInstantiate, setRef, setScope, setTagScope, setVariableWithinScope, setWrappedClassName, setWrappedObject, validate
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

TreeViewTag

public TreeViewTag()
Method Detail

initialize

protected void initialize(boolean includeAttributes)
Initializes attributes and variables for this tag handler.

Overrides:
initialize in class BaseTransformationBodyTag
Parameters:
includeAttributes - Set to true if attributes are to be set to default values.

setModel

public void setModel(java.lang.String model)
Sets the model property (String). The model String is used to find the model

Parameters:
model - the model String

getModel

public java.lang.String getModel()
Gets the model property (String).

Returns:
the model String

setNodeLoading

public void setNodeLoading(java.lang.String load_state)
setNodeLoading determines if the tree is written out all at once or incrementally. If the tree is not loaded all at once, each time an action is taken, a call to the server must be made. The default value is Full, which tells the Tree to load all at once. Current valid values are FULL or PROGRESSIVE.

Parameters:
String - Determines if the tree is written all at once or incrementally.

getNodeLoading

public java.lang.String getNodeLoading()
getNodeLoading returns the value of load_state which determines if the tree is written out all at once, or incrementally.

Returns:
load_state

setImageVisible

public void setImageVisible(boolean imageVisible)
setImageVisible sets node images visibile. If this is set to true, an image will appear next to the node text. Image location is set by using, setImageLocation. The default value is true.

Parameters:
style - Boolean value if images are to be displayed.

isImageVisible

public boolean isImageVisible()
isImageVisible returns a boolean value that determines if Images are visible next to the node text.

Returns:
displayStyle - boolean value if images are displayed.

getSelectionMode

public java.lang.String getSelectionMode()
Returns the selectionMode.

Returns:
String

setSelectionMode

public void setSelectionMode(java.lang.String selectionMode)
Sets the selectionMode.

Parameters:
selectionMode - The selectionMode to set

setImageLocation

public void setImageLocation(java.lang.String imageLocation)
setImageLocation the location of the images needed to construct the Tree. The location can be a fully qualified URL or a relative location.

Parameters:
imageLocation - The location of the needed images

getImageLocation

public java.lang.String getImageLocation()
getImageLocation returns the location of the images needed to construct the Tree. The location can be a fully qualified URL or a relative location.

Returns:
imageLocation the location of the needed images

setTarget

public void setTarget(java.lang.String target)
Sets the value of the TARGET= argument used on the anchor tags generated. This value determines where/how the links associated with the nodes on the tree are displayed. The default value is _blank which will cause a new browser window to be opened each time a node is clicked on.

Parameters:
target - Argument of each folders anchor tag.

getTarget

public java.lang.String getTarget()
Returns the value of the TARGET= argument used on the anchor tags generated. This value determines where/how the links associated with the nodes on the tree are displayed. The default value is _blank which will cause a new browser window to be opened each time a node is clicked on.

Returns:
TARGET= argument of each folders anchor tag.

setExpansionLevel

public void setExpansionLevel(int expansionLevel)
setExpansionLevel detemines what level the tree will be expanded when render. The default value is to be fully collapsed. Current valid values are 0, fully collapsed, or 1, fully expanded.

Parameters:
level - The expansion level of the tree.

getExpansionLevel

public int getExpansionLevel()
getExpansionLevel detemines what level the tree will be expanded when render. The default value is to be fully collapsed. Current valid values are 0, fully collapsed, or 1, fully expanded.

Returns:
level expansion of the tree.

setInitialExpansionLevel

public void setInitialExpansionLevel(int initialExpansionLevel)
setInitialExpansionLevel detemines what level the tree will be expanded when render. The default value is to be fully collapsed. Current valid values are 0, fully collapsed, or 1, fully expanded.

Parameters:
level - The expansion level of the tree.

getInitialExpansionLevel

public int getInitialExpansionLevel()
getInitialExpansionLevel detemines what level the tree will be expanded when render. The default value is to be fully collapsed. Current valid values are 0, fully collapsed, or 1, fully expanded.

Returns:
level expansion of the tree.

setUsePlusMinus

public void setUsePlusMinus(boolean usePlusMinus)
setUsePlusMinus determines whether or not to use the +/- images on the tree. If setUsePlustMinus is set to false, a user will have to click on the image to expand and collapse the tree. Default value is true.

Parameters:
usePlusMinus - Flag which determines whether or not to use the +/- images on the tree.

isUsePlusMinus

public boolean isUsePlusMinus()
isUsePlusMinus returns the boolean value of plus_minus which determines if the +/- images are to be used on the tree.

Returns:
boolean usePlusMinus.

setSelectedNode

public void setSelectedNode(java.lang.String selectedNode)
setSelectedNode sets the node that is to be 'selected', or highlighed upon initial rendering of the tree. The selectedNode String should be one or more strings separated by commas.

Parameters:
selectedNode - The selected node.

getSelectedNode

public java.lang.String getSelectedNode()
getSelectedNode returns the node which is to be 'selected' at initial rendering of the tree.

Returns:
selectedNode String

setUsingURLLinks

public void setUsingURLLinks(boolean usingURLLinks)
setUsingURLLinks tells the TreeView whether or not to use the URL links set on the model. The default is set to true.

Parameters:
usingURLLinks - Boolean value which determines whether or not to use URL links.

isUsingURLLinks

public boolean isUsingURLLinks()
isUsingURLLinks returns a boolean value telling the TreeView whether or not to use the URL links set in the model. Defaults to false.

Returns:
usingURLLinks

setRootNodeVisible

public void setRootNodeVisible(boolean rootNodeVisible)
setRootNodeVisible set the rootnode visible. Only works with PROGRESSIVE NodeLoading.

Parameters:
isRootVisible - Boolean value to set if rootNode is visible.

isRootNodeVisible

public boolean isRootNodeVisible()
isRootNodeVisible

Returns:
rootNodeVisible boolean value that determines if the root node is visible.

setStyleClassPrefix

public void setStyleClassPrefix(java.lang.String styleClassPrefix)
setStyleClassPrefix sets the prefix for a style class. This will allow multiple TreeView's on a page have different styles.
For example, if there are two TreeView's, t1 and t2, on a page the following would be needed:
t1.setStyleClassPrefix(t1)
t2.setStyleClassPrefix(t2).
The style classes available are:
.treeLink - sets style for node that has URL and setUsingURLLinks is true.
.treeLinkActive - sets the style for a node whose URL has been selected.
.treeText - sets style for node text which is not linked to a URL.
In the style sheet, the prefix would be used to define styles.

Parameters:
styleClassPrefix - style prefix used for the TreeView

getStyleClassPrefix

public java.lang.String getStyleClassPrefix()
getStyleClassPrefix returns the style class prefix set for a tree. The style class prefix is needed when there is more than one TreeView on a single page and different styles are needed for each TreeView. For additional information, see setStyleClassPrefix(java.lang.String).

Returns:
styleClassPrefix returns the style class prefix set for the TreeView

setLineStyle

public void setLineStyle(java.lang.String lineStyle)
Sets the line style used for the tree. If NodeLoading is PROGRESSIVE the line used to connect the nodes can be an image or a line. Current valid values are IMAGE or NOIMAGE

Parameters:
String - Determines if lines in a PROGRESSIVE tree are written using various images or with HTML.

getLineStyle

public java.lang.String getLineStyle()
Sets the line style used for the tree. If NodeLoading is PROGRESSIVE the line used to connect the nodes can be an image or a line. Current valid values are IMAGE or NOIMAGE

Parameters:
String - Determines if lines in a PROGRESSIVE tree are written using various images or with HTML.

setAutoChildrenVerify

public void setAutoChildrenVerify(boolean autoChildrenVerify)
Enables the auto children check. If ture the node image and/or plus/minus images will be clickable even if the node does not have children. Note: This method applies only when setNodeLoading(java.lang.String) is set to PROGRESSIVE.

Parameters:
autochildren - autoChildrenVerify

isAutoChildrenVerify

public boolean isAutoChildrenVerify()
Returns true if the autoChildrenCheckVerify is enabled, false otherwise.

Returns:
autoChildrenVerify
See Also:
setAutoChildrenVerify(boolean)

setSelectedNodesModel

public void setSelectedNodesModel(java.lang.String selectedNodesModel)
* Sets the selectedNodesModel property (String). The selectedNodesModel String is used to find the selected nodes model (with in the specified scope) to select the nodes of the TreeView.

Parameters:
selectedNodesModel - The model of selected nodes specified in the TreeView.

getSelectedNodesModel

public java.lang.String getSelectedNodesModel()
Gets the selectedNodesModel property of the TreeViewTag.

Returns:
the selectedNodesModel attribute of the TreeViewTag

getSelectNodeFunctionName

public java.lang.String getSelectNodeFunctionName()
Gets the name of a JavaScript function which will be called to select a node. Only available when nodeLoading is set to FULL.

Returns:
the name of the JavaScript function called when node is selected.
See Also:
setSelectNodeFunctionName(String)

setSelectNodeFunctionName

public void setSelectNodeFunctionName(java.lang.String selectFunctionName)
Sets the name of a JavaScript function which will be called to select a node. This function should update the style of the selected node to differentiate it from nodes which are not selected, for example by highlighting it. Only available when nodeLoading is set to FULL. The function should look similar to function selectNodeFunction(node,el) { if (node.text == "test";) el.className = "selectedTestStyle"; else el.className = "selectedNormalStyle"; } The first parameter is the node being selected. The second parameter is the HTML element representing the node.

Parameters:
the - name of the JavaScript function called when the node is selected
See Also:
getSelectNodeFunctionName()

getDeselectNodeFunctionName

public java.lang.String getDeselectNodeFunctionName()
Gets the name of a JavaScript function which will be called to deselect a node. Only available when nodeLoading is set to FULL.

Returns:
String The name of the JavaScript function called when node is deselected.
See Also:
setDeselectNodeFunctionName(String)

setDeselectNodeFunctionName

public void setDeselectNodeFunctionName(java.lang.String deselectFunctionName)
Sets the name of a JavaScript function which will be called to deselect a node. Only available when nodeLoading is set to FULL. The function should look similar to function deselectNodeFunction(node,el) { if (node.text == "test";) el.className = "deselectedTestStyle"; else el.className = "deselectedNormalStyle"; } The first parameter is the node being selected. The second parameter is the HTML element representing the node.

Parameters:
the - name of the JavaScript function called when the node is deselected

getNodeRendererFunctionName

public java.lang.String getNodeRendererFunctionName()
Gets the name of the JavaScript function which will be called to render a node. Only available when nodeLoading is set to FULL.

Returns:
the name of the JavaScript function to render a node
See Also:
setNodeRendererFunctionName(String)

setNodeRendererFunctionName

public void setNodeRendererFunctionName(java.lang.String string)
Sets the name of a JavaScript function which will be called to render a node. The function should look similar to <script> function nodeRenderer(node) { return node.text; } </script> The returned value is set on the innerHTML of the HTML element. In addition to the default node renderer, one simple node renderer is provided which allows the node text to include HTML. It may be used by setting the node renderer as follows: treeview.setNodeRendererFunctionName("sas_TreeView_HTMLNodeRenderer");

Parameters:
the - name of the JavaScript function to render a node

getPreSelectNodeFunctionName

public java.lang.String getPreSelectNodeFunctionName()
Gets the name of a user-supplied JavaScript function which will be called prior to normal select behavior when a node is selected. Only available when nodeLoading is set to FULL.

Returns:
the name of the user-supplied JavaScript function called prior to normal select behavior when a node is selected.
See Also:
setPreSelectNodeFunctionName(String)

setPreSelectNodeFunctionName

public void setPreSelectNodeFunctionName(java.lang.String preSelectFunctionName)
Sets the name of a user-supplied JavaScript function which will be called prior to normal select behavior when a node is selected. This function should return a boolean indicating success. A return value of FALSE will stop normal behavior from processing. Only available when nodeLoading is set to FULL. The function should look similar to function preSelectNodeFunction(node,el) { ...some user-defined action; return true; } The first parameter is the node being selected. The second parameter is the HTML element representing the node.

Parameters:
the - name of the JavaScript function called prior to normal select behavior when the node is selected
See Also:
getPreSelectNodeFunctionName()

getPostSelectNodeFunctionName

public java.lang.String getPostSelectNodeFunctionName()
Gets the name of a user-supplied JavaScript function which will be called after the normal select behavior executes when a node is selected. Only available when nodeLoading is set to FULL.

Returns:
the name of the user-supplied JavaScript function called after the normal select behavior when a node is selected.
See Also:
setPostSelectNodeFunctionName(String)

setPostSelectNodeFunctionName

public void setPostSelectNodeFunctionName(java.lang.String postSelectFunctionName)
Sets the name of a user-supplied JavaScript function which will be called after the normal select behavior executes when a node is selected. Only available when nodeLoading is set to FULL. The function should look similar to function postSelectNodeFunction(node,el) { ...some user-defined action; } The first parameter is the node being selected. The second parameter is the HTML element representing the node.

Parameters:
the - name of the JavaScript function called after the normal select behavior when the node is selected
See Also:
getPostSelectNodeFunctionName()

getPreExpandNodeFunctionName

public java.lang.String getPreExpandNodeFunctionName()
Gets the name of a user-supplied JavaScript function which will be called prior to node expansion.

Returns:
the name of the user-supplied JavaScript function called prior to node expansion
See Also:
setPreExpandNodeFunctionName(String)

setPreExpandNodeFunctionName

public void setPreExpandNodeFunctionName(java.lang.String preExpandFunctionName)
Sets the name of a user-supplied JavaScript function which will be called prior to node expansion. This function should return a boolean indicating success. A return value of FALSE will stop normal behavior from processing. The function should look similar to function preExpandNodeFunction(node,el) { ...some user-defined action; return true; } The first parameter is the node being selected. The second parameter is the HTML element representing the node.

Parameters:
the - name of the JavaScript function called prior to node expansion
See Also:
getPreExpandNodeFunctionName()

getPostExpandNodeFunctionName

public java.lang.String getPostExpandNodeFunctionName()
Gets the name of a user-supplied JavaScript function which will be called after the node expands.

Returns:
the name of the user-supplied JavaScript function called after the node expands.
See Also:
setPostExpandNodeFunctionName(String)

setPostExpandNodeFunctionName

public void setPostExpandNodeFunctionName(java.lang.String postExpandFunctionName)
Sets the name of a user-supplied JavaScript function which will be called after the node expands. The function should look similar to function postExpandNodeFunction(node,el) { ...some user-defined action; } The first parameter is the node being selected. The second parameter is the HTML element representing the node.

Parameters:
the - name of the JavaScript function called node expansion.
See Also:
getPostExpandNodeFunctionName()

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Process the start tag for this instance. The doStartTag() method assumes that all setter methods have been invoked before. When this method is invoked, the body has not yet been invoked.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class BaseTransformationBodyTag
Returns:
int designating the next course of action for the tag/jsp page.
Throws:
javax.servlet.jsp.JspException - Thrown if a JspException occurs.
See Also:
BaseBodyTag.setInstantiate(boolean), TagSupport.doStartTag()

applyAttributes

protected void applyAttributes()
                        throws javax.servlet.jsp.JspException
Sets the attributes on the underlying TreeView object.

Overrides:
applyAttributes in class BaseTransformationBodyTag
Throws:
javax.servlet.jsp.JspException - Thrown if a JspException occurs.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.