com.sas.servlet.tbeans
Class BaseTreeView

com.sas.servlet.tbeans.BaseTreeView
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, RenderableInterface, TransformationInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable
Direct Known Subclasses:
TreeView

public class BaseTreeView

The BaseTreeView is an abstract TransformationBean™ used to create a TreeView.

Note that subclasses of this bean actually provide the markup rendering used in/with Servlet and JavaServer Pages technologies. If you need to add support for a markup language that is not explicitly provided with AppDev Studio, then you must extend this class.

For More Information:

JSP custom tags provide an alternative to using the TransformationBeans™. Visit the Custom Tag Library Reference for additional 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:
TreeNodeInterface, Serialized Form

Field Summary
static int CHECKBOX_LEAF_SELECTION
          SelectionMode constant for using checkboxes next to every leaf node (nodes without any children) for selection.
static int CHECKBOX_SELECTION
          SelectionMode constant for using checkboxes next to every node for selection.
static java.lang.String CLOSED_FOLDER
          Key used by the imageMap for a closed folder.
static int COMPLEX_INDICATOR_SELECTION
          SelectionMode constant for using checkboxes next to every node for selection, and an image next to every node indicating if none/some/all of its children have been selected.
protected static java.util.HashMap defaultImageMap
           
static java.lang.String DISABLED_FOLDER
          Key used by the imageMap for a disabled folder.
static java.lang.String FIRST_NODE
          Key used by the imageMap for the 'first node' image
static int FULL
          NodeLoading constant for loading all tree nodes into the page and use JavaScript to implement all the tree functionality.
static int FULLYCOLLAPSED
          ExpansionLevel constant for all nodes being collapsed.
static int FULLYEXPANDED
          ExpansionLevel constant for all nodes being expanded.
static int IMAGE
          LineStyle constant for using images for all the tree decoration vertical and horizontal lines.
protected  java.lang.String imageLocation
           
static java.lang.String INDICATOR_ALL_CHILDREN
          Key used by the imageMap for the indicator image when all children are selected but not the node itself.
static java.lang.String INDICATOR_NO_CHILDREN
          Key used by the imageMap for the indicator image when no children are selected nor the node itself.
static java.lang.String INDICATOR_SELF_ALL_CHILDREN
          Key used by the imageMap for the indicator image when all children are selected as well as the node itself.
static java.lang.String INDICATOR_SELF_NO_CHILDREN
          Key used by the imageMap for the indicator image when no children are selected but the node itself is selected.
static java.lang.String INDICATOR_SELF_SOME_CHILDREN
          Key used by the imageMap for the indicator image when some children are selected as well as the node itself.
static java.lang.String INDICATOR_SOME_CHILDREN
          Key used by the imageMap for the indicator image when some children are selected but not the node itself.
static java.lang.String LAST_NODE
          Key used by the imageMap for the 'last node' image
static java.lang.String LEAF_ICON
          Key used by the imageMap for a leaf icon.
static java.lang.String MINUS_LAST_NODE
          Key used by the imageMap for the 'minus last node' image
static java.lang.String MINUS_NODE
          Key used by the imageMap for the 'minus node' image
static java.lang.String MINUS_ONLY_NODE
          Key used by the imageMap for the 'minus only node' image
static java.lang.String MISSING_ROOT_MINUS_NODE
          Key used by the imageMap for the 'missing root minus node' image
static java.lang.String MISSING_ROOT_PLUS_NODE
          Key used by the imageMap for the 'missing root plus node' image
static int MULTIPLE_SELECTION
          SelectionMode constant for allowing multiple selections.
static int NO_SELECTION
          SelectionMode constant for not showing any selection.
static java.lang.String NODE
          Key used by the imageMap for the 'node' image
static int NOIMAGE
          LineStyle constant for using HTML tables for all the tree decoration vertical and horizontal lines, which allows rows to be resized (eg when the node text is in a larger font) without vertical gaps between rows.
static java.lang.String OPEN_FOLDER
          Key used by the imageMap for an open folder.
static java.lang.String PLUS_LAST_NODE
          Key used by the imageMap for the 'plus last node' image
static java.lang.String PLUS_NODE
          Key used by the imageMap for the 'plus node' image
static java.lang.String PLUS_ONLY_NODE
          Key used by the imageMap for the 'plus only node' image
static int PROGRESSIVE
          NodeLoading constant for loading tree nodes as needed into the page and generate a new page on any expand or collapse.
static int RADIO_LEAF_SELECTION
          SelectionMode constant for using radio boxes next to every leaf node (nodes without any children) for selection.
static int RADIO_SELECTION
          SelectionMode constant for using radio boxes next to every node for selection.
static int SINGLE_REQUIRED_SELECTION
          SelectionMode constant for allowing a single required selection.
static int SINGLE_SELECTION
          SelectionMode constant for allowing a single selection.
static int TRISTATE_SELECTION
          SelectionMode constant for using checkboxes next to every leaf node (nodes without any children) for selection, and an image next to each folder indicating if none/some/all of its children have been selected.
static java.lang.String VERTICAL_LINE
          Key used by the imageMap for the vertical line image
 
Constructor Summary
BaseTreeView()
          Default constructor.
 
Method Summary
 java.lang.String getDeselectNodeFunctionName()
          Gets the name of a JavaScript function which will be called to deselect a node.
 int getExpansionLevel()
          Determines what level the tree will be expanded when rendered.
 java.lang.String getImageLocation()
          Returns the location of the images needed to construct the TreeView.
 java.util.Map getImageMap()
          Gets a map of the images to be used by the TreeView.
 int getInitialExpansionLevel()
          Determines what level the tree will be expanded when initially rendered.
 java.lang.String getLevelCellStyle(int level)
          Returns the style for a cell when the node is at a particular level.
 int getLineStyle()
          Returns the line style used for this TreeView as decoration to connect nodes.
 javax.swing.tree.TreeModel getModel()
          Return the model for this TreeView.
 boolean getMultipleSelections()
          Gets the multiple selection property
 int getNodeLoading()
          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 expansion executes.
 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 before the node expansion executes.
 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()
          Returns the value of a single item to be marked as 'selected' or highlighted upon initial rendering of the tree.
 javax.swing.ListModel getSelectedNodes()
          Returns the nodes that are to be 'selected', or highlighted, upon initial rendering of the tree.
 int 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()
          Sets the prefix for the style classes in a TreeView.
 java.lang.String getTarget()
          Returns the value of the target attribute used on the anchor tags generated for a node.
 boolean isAutoChildrenVerify()
          Returns the auto children check.
 boolean isCheckboxSelectionMode()
          Returns true if checkboxes are used in this TreeView.
 boolean isFolderExpandCollapseEnabled()
          Returns false if a folder is not to expand or collapse on clicking.
 boolean isImageVisible()
          Returns true if images are visible next to the node text.
 boolean isNodeSelectionVisible()
          Returns true if a node is selectable.
 boolean isOnlyLeavesSelectable()
          Returns true if only leaves (nodes without any children) are selectable.
 boolean isRootNodeVisible()
          Determines if the root node is visible.
 boolean isSelectionRequired()
          Determines if having a selection is required.
 boolean isUsePlusMinus()
          Determines whether or not to use the +/- images on the tree.
 boolean isUsingURLLinks()
          Determines whether or not to use the URL links set on the tree nodes in the model.
 void setAutoChildrenVerify(boolean autochildren)
          Sets 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)
          Determines what level the tree will be expanded when rendereded.
 void setFolderExpandCollapseEnabled(boolean folderExpandCollapseEnabled)
          Determine if expand or collapse is disabled on folders.
 void setImageLocation(java.lang.String iLocation)
          Sets the location of the images needed to construct the TreeView.
 void setImageVisible(boolean imageVisible)
          Determine if images are visible next to the node text.
 void setInitialExpansionLevel(int expansionLevel)
          Determines what level the tree will be expanded when initially rendereded.
 void setLineStyle(int lstyle)
          Sets the line style used for this TreeView as decoration to connect nodes.
 void setModel(javax.swing.tree.TreeModel model)
          Sets the model for this TreeView.
 void setNodeLoading(int load_state)
          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 expansion executes.
 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 before the node expansion executes.
 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)
          Determines if the root node is visible.
 void setSelectedNode(java.lang.String selectedNode)
          Sets the node that is to be 'selected', or highlighted, upon initial rendering of the tree.
 void setSelectedNodes(javax.swing.ListModel selectedNodes)
          Sets the nodes that are to be 'selected', or highlighted, upon initial rendering of the tree.
 void setSelectionMode(int 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)
          Sets the prefix for the style classes in a TreeView.
 void setTarget(java.lang.String target)
          Sets the value of the target attribute used on the anchor tags generated for a node.
 void setUsePlusMinus(boolean usePlusMinus)
          Determines whether or not to use the +/- images on the tree.
 void setUsingURLLinks(boolean useURLLinks)
          Determines whether or not to use the URL links set on the tree nodes in the model.
 
Methods inherited from class com.sas.servlet.tbeans.BaseTransformation
addPropertyChangeListener, addPropertyChangeListener, cleanUpResources, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCustomAttributes, getDescription, getId, getInputTransform, getLocale, getName, getObjectData, getObjectDataProperty, getOutputTransform, getRequest, getResponse, getTagEpilog, getTagProlog, hasListeners, isCleanUpResourcesOn, isVisible, removePropertyChangeListener, removePropertyChangeListener, setCleanUpResourcesOn, setCustomAttributes, setDescription, setId, setInputTransform, setLocale, setLocaleDependentProperties, setName, setObjectData, setObjectDataProperty, setOutputTransform, setRequest, setResponse, setTagEpilog, setTagProlog, setVisible, toString, write, write, write, write
 

Field Detail

FULL

public static final int FULL
NodeLoading constant for loading all tree nodes into the page and use JavaScript to implement all the tree functionality.

See Also:
setNodeLoading(int), Constant Field Values

PROGRESSIVE

public static final int PROGRESSIVE
NodeLoading constant for loading tree nodes as needed into the page and generate a new page on any expand or collapse.

See Also:
setNodeLoading(int), Constant Field Values

FULLYEXPANDED

public static final int FULLYEXPANDED
ExpansionLevel constant for all nodes being expanded.

See Also:
setExpansionLevel(int), Constant Field Values

FULLYCOLLAPSED

public static final int FULLYCOLLAPSED
ExpansionLevel constant for all nodes being collapsed.

See Also:
setExpansionLevel(int), Constant Field Values

IMAGE

public static final int IMAGE
LineStyle constant for using images for all the tree decoration vertical and horizontal lines.

See Also:
setLineStyle(int), Constant Field Values

NOIMAGE

public static final int NOIMAGE
LineStyle constant for using HTML tables for all the tree decoration vertical and horizontal lines, which allows rows to be resized (eg when the node text is in a larger font) without vertical gaps between rows.

See Also:
setLineStyle(int), Constant Field Values

NO_SELECTION

public static final int NO_SELECTION
SelectionMode constant for not showing any selection.

See Also:
setSelectionMode(int), Constant Field Values

SINGLE_SELECTION

public static final int SINGLE_SELECTION
SelectionMode constant for allowing a single selection.

See Also:
setSelectionMode(int), Constant Field Values

SINGLE_REQUIRED_SELECTION

public static final int SINGLE_REQUIRED_SELECTION
SelectionMode constant for allowing a single required selection. An node must be selected at all times, unselecting an item will not be allowed.

See Also:
setSelectionMode(int), Constant Field Values

MULTIPLE_SELECTION

public static final int MULTIPLE_SELECTION
SelectionMode constant for allowing multiple selections.

See Also:
setSelectionMode(int), Constant Field Values

CHECKBOX_SELECTION

public static final int CHECKBOX_SELECTION
SelectionMode constant for using checkboxes next to every node for selection.

See Also:
setSelectionMode(int), Constant Field Values

CHECKBOX_LEAF_SELECTION

public static final int CHECKBOX_LEAF_SELECTION
SelectionMode constant for using checkboxes next to every leaf node (nodes without any children) for selection.

See Also:
setSelectionMode(int), Constant Field Values

TRISTATE_SELECTION

public static final int TRISTATE_SELECTION
SelectionMode constant for using checkboxes next to every leaf node (nodes without any children) for selection, and an image next to each folder indicating if none/some/all of its children have been selected. Clicking on this image will select all children or unselect all children or restore a previous partially selected state.

See Also:
setSelectionMode(int), Constant Field Values

COMPLEX_INDICATOR_SELECTION

public static final int COMPLEX_INDICATOR_SELECTION
SelectionMode constant for using checkboxes next to every node for selection, and an image next to every node indicating if none/some/all of its children have been selected. Clicking on this image will select all children or unselect all children or restore a previous partially selected state. Selection of a checkbox does not affect selection of children, click the image to affect children or use TRISTATE_SELECTION if selection of a folder is the same as selecting all children.

See Also:
setSelectionMode(int), Constant Field Values

RADIO_SELECTION

public static final int RADIO_SELECTION
SelectionMode constant for using radio boxes next to every node for selection.

See Also:
setSelectionMode(int), Constant Field Values

RADIO_LEAF_SELECTION

public static final int RADIO_LEAF_SELECTION
SelectionMode constant for using radio boxes next to every leaf node (nodes without any children) for selection.

See Also:
setSelectionMode(int), Constant Field Values

imageLocation

protected java.lang.String imageLocation

defaultImageMap

protected static final java.util.HashMap defaultImageMap

OPEN_FOLDER

public static final java.lang.String OPEN_FOLDER
Key used by the imageMap for an open folder.

See Also:
getImageMap(), Constant Field Values

CLOSED_FOLDER

public static final java.lang.String CLOSED_FOLDER
Key used by the imageMap for a closed folder.

See Also:
getImageMap(), Constant Field Values

DISABLED_FOLDER

public static final java.lang.String DISABLED_FOLDER
Key used by the imageMap for a disabled folder.

See Also:
getImageMap(), Constant Field Values

LEAF_ICON

public static final java.lang.String LEAF_ICON
Key used by the imageMap for a leaf icon.

See Also:
getImageMap(), Constant Field Values

INDICATOR_ALL_CHILDREN

public static final java.lang.String INDICATOR_ALL_CHILDREN
Key used by the imageMap for the indicator image when all children are selected but not the node itself.

See Also:
getImageMap(), Constant Field Values

INDICATOR_SOME_CHILDREN

public static final java.lang.String INDICATOR_SOME_CHILDREN
Key used by the imageMap for the indicator image when some children are selected but not the node itself.

See Also:
getImageMap(), Constant Field Values

INDICATOR_NO_CHILDREN

public static final java.lang.String INDICATOR_NO_CHILDREN
Key used by the imageMap for the indicator image when no children are selected nor the node itself.

See Also:
getImageMap(), Constant Field Values

INDICATOR_SELF_ALL_CHILDREN

public static final java.lang.String INDICATOR_SELF_ALL_CHILDREN
Key used by the imageMap for the indicator image when all children are selected as well as the node itself.

See Also:
getImageMap(), Constant Field Values

INDICATOR_SELF_SOME_CHILDREN

public static final java.lang.String INDICATOR_SELF_SOME_CHILDREN
Key used by the imageMap for the indicator image when some children are selected as well as the node itself.

See Also:
getImageMap(), Constant Field Values

INDICATOR_SELF_NO_CHILDREN

public static final java.lang.String INDICATOR_SELF_NO_CHILDREN
Key used by the imageMap for the indicator image when no children are selected but the node itself is selected.

See Also:
getImageMap(), Constant Field Values

VERTICAL_LINE

public static final java.lang.String VERTICAL_LINE
Key used by the imageMap for the vertical line image

See Also:
getImageMap(), Constant Field Values

MISSING_ROOT_MINUS_NODE

public static final java.lang.String MISSING_ROOT_MINUS_NODE
Key used by the imageMap for the 'missing root minus node' image

See Also:
getImageMap(), Constant Field Values

MISSING_ROOT_PLUS_NODE

public static final java.lang.String MISSING_ROOT_PLUS_NODE
Key used by the imageMap for the 'missing root plus node' image

See Also:
getImageMap(), Constant Field Values

MINUS_ONLY_NODE

public static final java.lang.String MINUS_ONLY_NODE
Key used by the imageMap for the 'minus only node' image

See Also:
getImageMap(), Constant Field Values

PLUS_ONLY_NODE

public static final java.lang.String PLUS_ONLY_NODE
Key used by the imageMap for the 'plus only node' image

See Also:
getImageMap(), Constant Field Values

FIRST_NODE

public static final java.lang.String FIRST_NODE
Key used by the imageMap for the 'first node' image

See Also:
getImageMap(), Constant Field Values

MINUS_LAST_NODE

public static final java.lang.String MINUS_LAST_NODE
Key used by the imageMap for the 'minus last node' image

See Also:
getImageMap(), Constant Field Values

PLUS_LAST_NODE

public static final java.lang.String PLUS_LAST_NODE
Key used by the imageMap for the 'plus last node' image

See Also:
getImageMap(), Constant Field Values

MINUS_NODE

public static final java.lang.String MINUS_NODE
Key used by the imageMap for the 'minus node' image

See Also:
getImageMap(), Constant Field Values

PLUS_NODE

public static final java.lang.String PLUS_NODE
Key used by the imageMap for the 'plus node' image

See Also:
getImageMap(), Constant Field Values

NODE

public static final java.lang.String NODE
Key used by the imageMap for the 'node' image

See Also:
getImageMap(), Constant Field Values

LAST_NODE

public static final java.lang.String LAST_NODE
Key used by the imageMap for the 'last node' image

See Also:
getImageMap(), Constant Field Values
Constructor Detail

BaseTreeView

public BaseTreeView()
Default constructor.

Method Detail

isFolderExpandCollapseEnabled

public boolean isFolderExpandCollapseEnabled()
Returns false if a folder is not to expand or collapse on clicking. True by default.

Returns:
false if unable to expand or collapse using the folder.
See Also:
setFolderExpandCollapseEnabled(boolean)

setFolderExpandCollapseEnabled

public void setFolderExpandCollapseEnabled(boolean folderExpandCollapseEnabled)
Determine if expand or collapse is disabled on folders. Default is true.

Parameters:
folderExpandCollapseEnabled - false if expand or collapse is disabled on folders, true otherwise.

isNodeSelectionVisible

public boolean isNodeSelectionVisible()
Returns true if a node is selectable. If the node is selectable then when a user selects a node the node selection will be apparent by changing the style of the text.

Returns:
true if the node is selectable.
See Also:
setSelectionMode(int)

isImageVisible

public boolean isImageVisible()
Returns true if images are visible next to the node text. If images are not visible, the image next to the node text will not be displayed. Note that other images are used as tree decorations for the TreeView, but the image or icon next to the text will not be displayed. For example, the default image is a folder, if isImageVisible() is false, the folder will not be displayed.

Returns:
true if images are displayed, false otherwise.

setImageVisible

public void setImageVisible(boolean imageVisible)
Determine if images are visible next to the node text. If images are not visible, the image next to the node text will not be displayed. Note that other images are used as tree decorations for the TreeView, but the image or icon next to the text will not be displayed. For example, the default image is a folder, if isImageVisible() is false, the folder will not be displayed.

Parameters:
imageVisible - true if images are to be displayed, false otherwise.

getImageLocation

public java.lang.String getImageLocation()
Returns the location of the images needed to construct the TreeView. The location can be a fully qualified URL or a relative location. This image location should contain all images needed to display the TreeView.

Returns:
imageLocation the location of the images needed to create the tree.

setImageLocation

public void setImageLocation(java.lang.String iLocation)
Sets the location of the images needed to construct the TreeView. The location can be a fully qualified URL or a relative location. This image location should contain all images needed to display the TreeView. Note the form of the location requires a trailing '/'. For example, setImageLocation("images/").

Parameters:
imageLocation - the location of the images needed to create the TreeView

getTarget

public java.lang.String getTarget()
Returns the value of the target attribute used on the anchor tags generated for a node. 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 attribute of each node's anchor tag.

setTarget

public void setTarget(java.lang.String target)
Sets the value of the target attribute used on the anchor tags generated for a node. 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 - attribute of each node's anchor tag.

setExpansionLevel

public void setExpansionLevel(int expansionLevel)
Determines what level the tree will be expanded when rendereded. The default value is to be fully collapsed. Current valid values are TreeViewInterface.FULLYEXPANDED or TreeViewInterface.FULLYCOLLAPSED.

Parameters:
level - the expansion level of the tree.

getExpansionLevel

public int getExpansionLevel()
Determines what level the tree will be expanded when rendered. The default value is to be fully collapsed. Current valid values are TreeViewInterface.FULLYEXPANDED or TreeViewInterface.FULLYCOLLAPSED.

Returns:
expansion level of the tree.

setInitialExpansionLevel

public void setInitialExpansionLevel(int expansionLevel)
Determines what level the tree will be expanded when initially rendereded. This method differs slightly from the setExpansionLevel method. This method will allow you to expand to any level. Setting this method to -1 will fully expand the tree. Any value lower than -1 will be ignored. The default value is to be fully collapsed.

Parameters:
level - the expansion level of the tree.

getInitialExpansionLevel

public int getInitialExpansionLevel()
Determines what level the tree will be expanded when initially rendered. The default value is to be fully collapsed.

Returns:
expansion level of the tree.

setNodeLoading

public void setNodeLoading(int load_state)
Determines if the tree is written out all at once or incrementally. If the tree is not loaded all at once, each time the tree is expanded, new nodes are created. This can potentially decrease the initial load time of the tree. Progressive nodeLoading works best when using the LevelTreeInterface as a models. The default value is FULL, loads the tree all at once. Current valid values TreeViewInterface.FULL or TreeViewInterface.PROGRESSIVE.

Parameters:
load_state - integer value that determines if tree is to load PROGRESSIVE or FULL.

getNodeLoading

public int getNodeLoading()
The value of load_state which determines if the tree is written out all at once, or incrementally. For additional information, see setNodeLoading(int)

Returns:
integer that determines if tree is to load PROGRESSIVE or FULL.

setUsePlusMinus

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

Parameters:
plus_minus - true if the plus_minus images are visible, false otherwise.

isUsePlusMinus

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


setSelectedNode

public void setSelectedNode(java.lang.String selectedNode)
Sets the node that is to be 'selected', or highlighted, upon initial rendering of the tree.

Parameters:
selectedNode - the name of the node that is to be set as selected when the TreeView is initially rendered

setSelectedNodes

public void setSelectedNodes(javax.swing.ListModel selectedNodes)
Sets the nodes that are to be 'selected', or highlighted, upon initial rendering of the tree.

Parameters:
selectedNodes - the nodes that are to be set as selected when the TreeView is initially rendered

getSelectedNode

public java.lang.String getSelectedNode()
Returns the value of a single item to be marked as 'selected' or highlighted upon initial rendering of the tree. If more than one value has been set this will return the last item in the selections list.


getSelectedNodes

public javax.swing.ListModel getSelectedNodes()
Returns the nodes that are to be 'selected', or highlighted, upon initial rendering of the tree.


setUsingURLLinks

public void setUsingURLLinks(boolean useURLLinks)
Determines whether or not to use the URL links set on the tree nodes in the model. If true, any node which has the URL property set on it will be rendered as an anchor with an href attribute set to the URL set on the node and a target attribute from the node or this TreeView. The default is true.

Parameters:
useURLLinks - true if url links are to be set on the node text.
See Also:
TreeNodeInterface.getURL(), getTarget()

isUsingURLLinks

public boolean isUsingURLLinks()
Determines whether or not to use the URL links set on the tree nodes in the model. If true, any node which has the URL property set on it will be rendered as an anchor with an href attribute set to the URL set on the node and a target attribute from the node or this TreeView. The default is true.

Returns:
true if url links are to be set on the node text.
See Also:
TreeNodeInterface.getURL()

setRootNodeVisible

public void setRootNodeVisible(boolean rootNodeVisible)
Determines if the root node is visible.

Parameters:
rootNodeVisible - true if the root node is visible, false otherwise.

isRootNodeVisible

public boolean isRootNodeVisible()
Determines if the root node is visible.

Returns:
true if the root node is visible, false otherwise.

setStyleClassPrefix

public void setStyleClassPrefix(java.lang.String styleClassPrefix)
Sets the prefix for the style classes in a TreeView. This is one way to allow multiple TreeViews on a page to have different styles.
For example, if there are two TreeViews, tree1 and tree2, on a page the following would be needed:
tree1.setStyleClassPrefix("tree1"); tree2.setStyleClassPrefix("tree2");
Normal tree text would then use style class ".tree1treeText" in tree1 and ".tree2treeText" in tree2, and similarly for other style classes.
The style classes available are listed in TreeViewStyleKeysInterface.
In the style sheet, the prefix would be used to define styles.

Parameters:
styleClassPrefix - style prefix used for the TreeView
See Also:
TreeViewStyleKeysInterface, TreeView.getStyleMap()

getStyleClassPrefix

public java.lang.String getStyleClassPrefix()
Sets the prefix for the style classes in a TreeView. This is one way to allow multiple TreeViews on a page to have different styles. 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).


getLevelCellStyle

public java.lang.String getLevelCellStyle(int level)
Returns the style for a cell when the node is at a particular level. For example, each child of the rootNode, level 1, would have the same style class. The node must be of type StaticLevelNodeInterface for this style to be used.

Parameters:
level - The level of the node

getModel

public javax.swing.tree.TreeModel getModel()
Return the model for this TreeView. The nodes contained in the TreeModel should be of type TreeNodeInterface for best integration with the TreeView. Nodes of other types will be transformed into a TreeNodeInterface.

Returns:
the model for this TreeView.
See Also:
setModel(javax.swing.tree.TreeModel), TreeView.getTransform(), TreeNodeInterface

setModel

public void setModel(javax.swing.tree.TreeModel model)
Sets the model for this TreeView. The nodes contained in the TreeModel should be of type TreeNodeInterface for best integration with the TreeView. Nodes of other types will be transformed into a TreeNodeInterface.

Parameters:
treeModel - the model for the TreeView
See Also:
getModel(), TreeView.getTransform(), TreeNodeInterface

setLineStyle

public void setLineStyle(int lstyle)
Sets the line style used for this TreeView as decoration to connect nodes. This property is only available when nodeLoading is PROGRESSIVE.

Parameters:
lstyle - the line style; valid values are TreeViewInterface.IMAGE and TreeViewInterface.NOIMAGE

getLineStyle

public int getLineStyle()
Returns the line style used for this TreeView as decoration to connect nodes. This property is only available when nodeLoading is PROGRESSIVE.

Returns:
the line style used for this TreeView; valid values are TreeViewInterface.IMAGE and TreeViewInterface.NOIMAGE

setAutoChildrenVerify

public void setAutoChildrenVerify(boolean autochildren)
Sets the auto children check. If true the node images and/or plus/minus images will be clickable even if the node does not have children. Note: This method applies only when setNodeLoading(int) is set to PROGRESSIVE.

Parameters:
autochildren - autoChildrenVerify

isAutoChildrenVerify

public boolean isAutoChildrenVerify()
Returns the auto children check. If true 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(int) is set to PROGRESSIVE.

Returns:
autoChildrenVerify
See Also:
setAutoChildrenVerify(boolean)

getMultipleSelections

public boolean getMultipleSelections()
Gets the multiple selection property

Returns:
true if multiple selections are allowed
See Also:
setSelectionMode(int)

isSelectionRequired

public boolean isSelectionRequired()
Determines if having a selection is required. If true, no deselect would be allowed which would result in no selections remaining.

Returns:
true is have a selection is required.
See Also:
setSelectionMode(int)

isCheckboxSelectionMode

public boolean isCheckboxSelectionMode()
Returns true if checkboxes are used in this TreeView.

Returns:
true if checkboxes are used in this TreeView.
See Also:
setSelectionMode(int)

isOnlyLeavesSelectable

public boolean isOnlyLeavesSelectable()
Returns true if only leaves (nodes without any children) are selectable.

Returns:
true if only leaves (nodes without any children) are selectable.

getSelectionMode

public int getSelectionMode()
Returns the selectionMode. Valid modes are NO_SELECTION, SINGLE_SELECTION, SINGLE_REQUIRED_SELECTION MULTIPLE_SELECTION, CHECKBOX_SELECTION, CHECKBOX_LEAF_SELECTION, TRISTATE_SELECTION, COMPLEX_INDICATOR_SELECTION

Returns:
the selection mode used by this TreeView

setSelectionMode

public void setSelectionMode(int selectionMode)
Sets the selectionMode. Valid modes are NO_SELECTION, SINGLE_SELECTION, SINGLE_REQUIRED_SELECTION MULTIPLE_SELECTION, CHECKBOX_SELECTION, CHECKBOX_LEAF_SELECTION, RADIO_SELECTION, RADIO_LEAF_SELECTION, TRISTATE_SELECTION, COMPLEX_INDICATOR_SELECTION

Parameters:
selectionMode - The selection mode to be used by the TreeView

getImageMap

public java.util.Map getImageMap()
Gets a map of the images to be used by the TreeView. Names of images may be put in this map to change the image used in various places. For example, treeview.getImageMap().put(TreeView.LEAF_ICON,"leaf.gif"); would result in this TreeView having the image/icon next to the node be "leaf.gif".

Returns:
a map which may be used to set images for the TreeView to use.
See Also:
OPEN_FOLDER, CLOSED_FOLDER, DISABLED_FOLDER, LEAF_ICON

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:
setPreSelectNodeFunctionName(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 prior to normal select behavior when the node is selected
See Also:
getPreSelectNodeFunctionName()

getPreExpandNodeFunctionName

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

Returns:
the name of the user-supplied JavaScript function called before the node expands
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 before the node expansion executes. 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 before 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 expansion executes.

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 expansion executes. 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 after node expansion
See Also:
getPostExpandNodeFunctionName()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.