|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.tbeans.BaseTreeView
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 .
TreeNodeInterface
,
Serialized FormField 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. |
Field Detail |
---|
public static final int FULL
setNodeLoading(int)
,
Constant Field Valuespublic static final int PROGRESSIVE
setNodeLoading(int)
,
Constant Field Valuespublic static final int FULLYEXPANDED
setExpansionLevel(int)
,
Constant Field Valuespublic static final int FULLYCOLLAPSED
setExpansionLevel(int)
,
Constant Field Valuespublic static final int IMAGE
setLineStyle(int)
,
Constant Field Valuespublic static final int NOIMAGE
setLineStyle(int)
,
Constant Field Valuespublic static final int NO_SELECTION
setSelectionMode(int)
,
Constant Field Valuespublic static final int SINGLE_SELECTION
setSelectionMode(int)
,
Constant Field Valuespublic static final int SINGLE_REQUIRED_SELECTION
setSelectionMode(int)
,
Constant Field Valuespublic static final int MULTIPLE_SELECTION
setSelectionMode(int)
,
Constant Field Valuespublic static final int CHECKBOX_SELECTION
setSelectionMode(int)
,
Constant Field Valuespublic static final int CHECKBOX_LEAF_SELECTION
setSelectionMode(int)
,
Constant Field Valuespublic static final int TRISTATE_SELECTION
setSelectionMode(int)
,
Constant Field Valuespublic static final int COMPLEX_INDICATOR_SELECTION
setSelectionMode(int)
,
Constant Field Valuespublic static final int RADIO_SELECTION
setSelectionMode(int)
,
Constant Field Valuespublic static final int RADIO_LEAF_SELECTION
setSelectionMode(int)
,
Constant Field Valuesprotected java.lang.String imageLocation
protected static final java.util.HashMap defaultImageMap
public static final java.lang.String OPEN_FOLDER
getImageMap()
,
Constant Field Valuespublic static final java.lang.String CLOSED_FOLDER
getImageMap()
,
Constant Field Valuespublic static final java.lang.String DISABLED_FOLDER
getImageMap()
,
Constant Field Valuespublic static final java.lang.String LEAF_ICON
getImageMap()
,
Constant Field Valuespublic static final java.lang.String INDICATOR_ALL_CHILDREN
getImageMap()
,
Constant Field Valuespublic static final java.lang.String INDICATOR_SOME_CHILDREN
getImageMap()
,
Constant Field Valuespublic static final java.lang.String INDICATOR_NO_CHILDREN
getImageMap()
,
Constant Field Valuespublic static final java.lang.String INDICATOR_SELF_ALL_CHILDREN
getImageMap()
,
Constant Field Valuespublic static final java.lang.String INDICATOR_SELF_SOME_CHILDREN
getImageMap()
,
Constant Field Valuespublic static final java.lang.String INDICATOR_SELF_NO_CHILDREN
getImageMap()
,
Constant Field Valuespublic static final java.lang.String VERTICAL_LINE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String MISSING_ROOT_MINUS_NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String MISSING_ROOT_PLUS_NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String MINUS_ONLY_NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String PLUS_ONLY_NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String FIRST_NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String MINUS_LAST_NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String PLUS_LAST_NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String MINUS_NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String PLUS_NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String NODE
getImageMap()
,
Constant Field Valuespublic static final java.lang.String LAST_NODE
getImageMap()
,
Constant Field ValuesConstructor Detail |
---|
public BaseTreeView()
Method Detail |
---|
public boolean isFolderExpandCollapseEnabled()
setFolderExpandCollapseEnabled(boolean)
public void setFolderExpandCollapseEnabled(boolean folderExpandCollapseEnabled)
folderExpandCollapseEnabled
- false if expand or collapse is disabled on folders, true otherwise.public boolean isNodeSelectionVisible()
setSelectionMode(int)
public boolean isImageVisible()
public void setImageVisible(boolean imageVisible)
imageVisible
- true if images are to be displayed, false otherwise.public java.lang.String getImageLocation()
public void setImageLocation(java.lang.String iLocation)
imageLocation
- the location of the images needed to create the TreeViewpublic java.lang.String getTarget()
public void setTarget(java.lang.String target)
target
- attribute of each node's anchor tag.public void setExpansionLevel(int expansionLevel)
level
- the expansion level of the tree.public int getExpansionLevel()
public void setInitialExpansionLevel(int expansionLevel)
level
- the expansion level of the tree.public int getInitialExpansionLevel()
public void setNodeLoading(int load_state)
load_state
- integer value that determines if tree is to load PROGRESSIVE or FULL.public int getNodeLoading()
setNodeLoading(int)
public void setUsePlusMinus(boolean usePlusMinus)
plus_minus
- true if the plus_minus images are visible, false otherwise.public boolean isUsePlusMinus()
public void setSelectedNode(java.lang.String selectedNode)
selectedNode
- the name of the node that is to be set as selected when the TreeView is initially renderedpublic void setSelectedNodes(javax.swing.ListModel selectedNodes)
selectedNodes
- the nodes that are to be set as selected when the TreeView is initially renderedpublic java.lang.String getSelectedNode()
public javax.swing.ListModel getSelectedNodes()
public void setUsingURLLinks(boolean useURLLinks)
useURLLinks
- true if url links are to be set on the node text.TreeNodeInterface.getURL()
,
getTarget()
public boolean isUsingURLLinks()
TreeNodeInterface.getURL()
public void setRootNodeVisible(boolean rootNodeVisible)
rootNodeVisible
- true if the root node is visible, false otherwise.public boolean isRootNodeVisible()
public void setStyleClassPrefix(java.lang.String styleClassPrefix)
tree1.setStyleClassPrefix("tree1");
tree2.setStyleClassPrefix("tree2");
TreeViewStyleKeysInterface
.
styleClassPrefix
- style prefix used for the TreeViewTreeViewStyleKeysInterface
,
TreeView.getStyleMap()
public java.lang.String getStyleClassPrefix()
setStyleClassPrefix(java.lang.String)
.
public java.lang.String getLevelCellStyle(int level)
level
- The level of the nodepublic javax.swing.tree.TreeModel getModel()
setModel(javax.swing.tree.TreeModel)
,
TreeView.getTransform()
,
TreeNodeInterface
public void setModel(javax.swing.tree.TreeModel model)
treeModel
- the model for the TreeViewgetModel()
,
TreeView.getTransform()
,
TreeNodeInterface
public void setLineStyle(int lstyle)
lstyle
- the line style;
valid values are TreeViewInterface.IMAGE
and TreeViewInterface.NOIMAGEpublic int getLineStyle()
public void setAutoChildrenVerify(boolean autochildren)
setNodeLoading(int)
is set to PROGRESSIVE.
autochildren
- autoChildrenVerifypublic boolean isAutoChildrenVerify()
setNodeLoading(int)
is set to PROGRESSIVE.
setAutoChildrenVerify(boolean)
public boolean getMultipleSelections()
setSelectionMode(int)
public boolean isSelectionRequired()
setSelectionMode(int)
public boolean isCheckboxSelectionMode()
setSelectionMode(int)
public boolean isOnlyLeavesSelectable()
public int getSelectionMode()
public void setSelectionMode(int selectionMode)
selectionMode
- The selection mode to be used by the TreeViewpublic java.util.Map getImageMap()
treeview.getImageMap().put(TreeView.LEAF_ICON,"leaf.gif");
would result in this TreeView having the image/icon next to
the node be "leaf.gif".
OPEN_FOLDER
,
CLOSED_FOLDER
,
DISABLED_FOLDER
,
LEAF_ICON
public java.lang.String getSelectNodeFunctionName()
setSelectNodeFunctionName(String)
public void setSelectNodeFunctionName(java.lang.String selectFunctionName)
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.
the
- name of the JavaScript function called when the node is selectedgetSelectNodeFunctionName()
public java.lang.String getDeselectNodeFunctionName()
setDeselectNodeFunctionName(String)
public void setDeselectNodeFunctionName(java.lang.String deselectFunctionName)
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.
the
- name of the JavaScript function called when the node is deselectedpublic java.lang.String getNodeRendererFunctionName()
setNodeRendererFunctionName(String)
public void setNodeRendererFunctionName(java.lang.String string)
<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");
the
- name of the JavaScript function to render a nodepublic java.lang.String getPreSelectNodeFunctionName()
setPreSelectNodeFunctionName(String)
public void setPreSelectNodeFunctionName(java.lang.String preSelectFunctionName)
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.
the
- name of the JavaScript function called prior to normal select behavior when the node is selectedgetPreSelectNodeFunctionName()
public java.lang.String getPostSelectNodeFunctionName()
setPreSelectNodeFunctionName(String)
public void setPostSelectNodeFunctionName(java.lang.String postSelectFunctionName)
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.
the
- name of the JavaScript function called prior to normal select behavior when the node is selectedgetPreSelectNodeFunctionName()
public java.lang.String getPreExpandNodeFunctionName()
setPreExpandNodeFunctionName(String)
public void setPreExpandNodeFunctionName(java.lang.String preExpandFunctionName)
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.
the
- name of the JavaScript function called before node expansiongetPreExpandNodeFunctionName()
public java.lang.String getPostExpandNodeFunctionName()
setPostExpandNodeFunctionName(String)
public void setPostExpandNodeFunctionName(java.lang.String postExpandFunctionName)
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.
the
- name of the JavaScript function called after node expansiongetPostExpandNodeFunctionName()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |