|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.tbeans.html.TreeView
public class TreeView
The TreeView is a TransformationBean that generates the appropriate HTML 4.0 and JavaScript to represent a tree. You can use TreeView beans in a Java servlet or in a JSP scriplet. The TreeView uses a javax.swing.tree.TreeModel which should contain TreeNode tbeans for best performance. Objects of other types are also supported in the TreeModel by transforming them into tbean TreeNodes, with the default transform simply setting the tbean TreeNode text to the result of the calling toString() on the object in the model.
Most of the properties used for a TreeView are inherited from
BaseTreeView
The TreeView is one of several TransformationBeans that rely on a set of style classes that are used by default when generating the resulting markup language. For more information on style sheets and the default style classes that apply to this TransformationBean, refer to the AppDev Studio Developer Site. You'll find a useful reference document entitled Cascading Style Sheets, Images, and TransformationBeans as well as the TransformationBeans Style Sheet Reference.
The TreeView is one of several TransformationBeans that rely on JavaScript to provide some of its functionality. These JavaScript files are including automatically by the tbean. See JavaScriptIncludeHandler for more information about how these files are included and how to customize this behavior. The TreeView uses the following JavaScript files:
Note that the toString() method on this class calls the write
method, which may have undesirable side effects. See BaseTransformation.toString() for more information. Debuggers often use toString() to show the value of a variable, and this may cause unexpected behavior while debugging
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/.
Examples for this class may be found on the Examples Site.
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 .
BaseTreeView
,
TreeNode
,
JDBCToTreeViewModelAdapter
,
TreeViewTag
,
Serialized FormField Summary | |
---|---|
static int |
AJAX
Remote scripting constant for loading expanded tree nodes into the page using AJAX remote scripting. |
static int |
IFRAME
Remote scripting constant for loading expanded tree nodes into the page using IFRAME remote scripting. |
Fields inherited from interface com.sas.servlet.tbeans.html.TreeViewStyleKeysInterface |
---|
TREEVIEW_BACKGROUND_IMAGE, TREEVIEW_BACKGROUND_IMAGE1, TREEVIEW_CURSOR_HAND, TREEVIEW_DESCRIPTION, TREEVIEW_DISABLED, TREEVIEW_DIV_IMAGE_SPACE, TREEVIEW_FLOAT, TREEVIEW_IMAGE, TREEVIEW_IMAGE_SPACE, TREEVIEW_LINK, TREEVIEW_LINKACTIVE, TREEVIEW_PANE, TREEVIEW_SELECTED, TREEVIEW_TABLE, TREEVIEW_TEXT |
Constructor Summary | |
---|---|
TreeView()
Default constructor for the TreeView. |
|
TreeView(java.lang.String name)
Constructor which creates a new TreeView with associated name. |
|
TreeView(java.lang.String name,
boolean urlLinks,
boolean usePlusMinus,
boolean nodeSelection,
int expansionLevel,
int nodeLoading,
boolean imageVisible,
java.lang.String styleClassPrefix)
Constructor which creates a new TreeView with many properties provided as parameters. |
Method Summary | |
---|---|
protected java.lang.StringBuffer |
addDivExpansionLink(java.lang.StringBuffer imageTemplate,
java.lang.String nodeName)
|
protected java.lang.StringBuffer |
addDivFolderImageTag(java.lang.StringBuffer imageTemplate,
TreeNodeInterface node)
|
protected void |
addDivLink(java.lang.StringBuffer tableString,
TreeNodeInterface node)
|
protected void |
addDivNode(java.lang.StringBuffer tableString,
TreeNodeInterface node,
java.lang.String addOns,
TreeNodeInterface parentNode,
TreeNodeInterface rootOfTree,
boolean firstChild)
|
protected void |
addDivNodeImage(java.lang.StringBuffer tableString,
TreeNodeInterface node,
java.lang.String plusMinusLink)
|
protected void |
addDivPlusMinusImage(java.lang.StringBuffer tableString,
TreeNodeInterface node,
TreeNodeInterface parentNode,
TreeNodeInterface rootOfTree,
boolean firstChild,
java.lang.String plusMinusLink)
|
protected void |
addDivText(java.lang.StringBuffer tableString,
TreeNodeInterface node)
|
protected java.lang.StringBuffer |
addDivTextSpan(java.lang.StringBuffer tableString,
TreeNodeInterface node)
|
protected void |
addPlusMinusImage(java.lang.StringBuffer tableString,
java.lang.String plusMinusLink,
java.lang.String img,
java.lang.String imgKey)
|
protected void |
addPlusMinusImageCommon(java.lang.StringBuffer tableString,
java.lang.String plusMinusLink,
java.lang.String img,
java.lang.String imgKey)
|
protected void |
addPlusMinusImageTop(java.lang.StringBuffer tableString,
java.lang.String plusMinusLink,
java.lang.String img,
java.lang.String imgKey)
|
protected java.lang.StringBuffer |
createIconConnector(java.lang.StringBuffer nodeTemplate,
boolean vLine,
java.lang.String vLineColor,
boolean row1,
boolean firstChild,
int numRows)
|
protected java.lang.String |
createPlusMinus(boolean vLine,
java.lang.String nImage,
java.lang.String nImageKey,
boolean vLine2,
boolean hLine,
java.lang.String addOns,
java.lang.String nodeName,
java.lang.String altText,
boolean enabled,
int numRows)
Create the node, a table with one row with columns for the addOns/onTheLeft, plus/minus icon, and the horizontal line before the node icon. |
protected java.lang.StringBuffer |
createPlusMinusConnector(java.lang.StringBuffer nodeTemplate,
boolean vLine,
java.lang.String vLineColor,
java.lang.String nImage,
java.lang.String nImageKey,
int numRows)
|
protected java.lang.StringBuffer |
createPlusMinusIconConnector(java.lang.StringBuffer nodeTemplate,
boolean hLine,
java.lang.String hLineColor,
java.lang.String nImage,
java.lang.String nImageKey)
|
protected java.lang.StringBuffer |
createPlusMinusImage(java.lang.StringBuffer nodeTemplate,
java.lang.String nImage,
java.lang.String nImageKey,
java.lang.String nodeName,
java.lang.String altText,
boolean enabled)
|
void |
expandNode(TreeNodeInterface node,
int currentLevel,
int maxLevel)
|
java.util.HashMap |
getAdditionalParameters()
Returns an HashMap containing additional parameters that should be added to the form used to perform the various actions on the TreeView when nodeLoading is PROGRESSIVE. |
Form |
getDefaultFormObject()
Gets the default form object to be used by this TreeView. |
protected java.lang.String |
getDivAddOns(TreeNodeInterface node,
java.lang.String addOns,
TreeNodeInterface parentNode,
TreeNodeInterface rootOfTree)
|
protected java.lang.String |
getDivHTMLTreeTextImage(java.lang.String toLookFor,
java.lang.String PMLink,
TreeNodeInterface node,
java.lang.String addOns,
TreeNodeInterface parentNode,
TreeNodeInterface rootOfTree,
boolean firstChild,
java.lang.String selectedNode)
|
protected java.lang.String |
getDivHTMLTreeTextNoImage(java.lang.String toLookFor,
java.lang.String PMLink,
TreeNodeInterface node,
java.lang.String addOns,
TreeNodeInterface parentNode,
TreeNodeInterface rootOfTree,
boolean firstChild,
java.lang.String selectedNode)
|
Form |
getFormObject()
Gets the form object to be used by this TreeView. |
java.util.Map |
getStyleMap()
Returns a Map that contains all the Style information for a component |
static boolean |
getThreadLocalTrimURL()
Not intended for public use. |
com.sas.servlet.tbeans.html.TreeView.TreeNodeTransform |
getTransform()
Gets the transform used to convert a node from in a TreeModel into a tree node for use by this treeView. |
boolean |
isDelayExecutionEnabled()
Determines whether the TreeView should delay execution of its JavaScript. |
boolean |
isFormEnabled()
Determines if the tbean should render its formObject. |
boolean |
isRenderUsingDivs()
Determines whether the TreeView should render using div tags instead of TABLE tags. |
void |
setAdditionalParameter(java.lang.String name,
java.lang.String value)
Sets an additional parameter to be added to the form used to perform the various actions on the TreeView when nodeLoading is PROGRESSIVE. |
void |
setAdditionalParameters(java.util.HashMap map)
Sets an HashMap containing additional parameters that should be added to the form used to perform the various actions on the TreeView when nodeLoading is PROGRESSIVE. |
void |
setDelayExecutionEnabled(boolean enabled)
Sets whether the TreeView should delay execution of its JavaScript. |
void |
setFormEnabled(boolean enabled)
Sets whether the tbean should render its formObject. |
void |
setFormObject(Form form)
Sets the form object to be used by this TreeView. |
void |
setRenderUsingDivs(boolean enabled)
Sets whether the TreeView should render using div tags instead of TABLE tags. |
static void |
setThreadLocalTrimURL(boolean value)
Not intended for public use. |
void |
setTransform(com.sas.servlet.tbeans.html.TreeView.TreeNodeTransform transform)
Sets the transform to be used to convert a node from in a TreeModel into a tree node for use by this treeView |
static void |
sort(javax.swing.tree.MutableTreeNode node,
java.util.Comparator comparator)
Sort the nodes in a tree. |
void |
write(java.io.PrintWriter out)
Writes out either the JavaScript code or the HTML code to display the tree. |
Field Detail |
---|
public static final int IFRAME
setRemoteScripting(int)
,
Constant Field Valuespublic static final int AJAX
setRemoteScripting(int)
,
Constant Field ValuesConstructor Detail |
---|
public TreeView()
public TreeView(java.lang.String name)
name
- The name of the TreeViewpublic TreeView(java.lang.String name, boolean urlLinks, boolean usePlusMinus, boolean nodeSelection, int expansionLevel, int nodeLoading, boolean imageVisible, java.lang.String styleClassPrefix)
name
- The name of the TreeViewurlLinks
- boolean value if URL links are to be used.usePlusMinus
- boolean value determines if the plus/minus signs are to be displayed.nodeSelection
- boolean value determines if the node selection is visible.int
- expansionLevel determines at what level the tree is initially expanded.nodeLoading
- int value determines if node loading should be full or progressive.imageVisible
- boolean determines if the tree images are to be displayed.styleClassPrefix
- String value that determines the prefix to the style class.Method Detail |
---|
public static void setThreadLocalTrimURL(boolean value)
value
- public static boolean getThreadLocalTrimURL()
public void write(java.io.PrintWriter out) throws java.io.IOException
write
in interface TransformationInterface
write
in interface com.sas.util.WriteToPrintWriterInterface
write
in class BaseTransformation
out
- The printWriter to be written to.
java.io.IOException
- Thrown if some type of I/O error occurspublic void expandNode(TreeNodeInterface node, int currentLevel, int maxLevel)
protected java.lang.String getDivAddOns(TreeNodeInterface node, java.lang.String addOns, TreeNodeInterface parentNode, TreeNodeInterface rootOfTree)
protected java.lang.String getDivHTMLTreeTextNoImage(java.lang.String toLookFor, java.lang.String PMLink, TreeNodeInterface node, java.lang.String addOns, TreeNodeInterface parentNode, TreeNodeInterface rootOfTree, boolean firstChild, java.lang.String selectedNode)
protected void addDivNode(java.lang.StringBuffer tableString, TreeNodeInterface node, java.lang.String addOns, TreeNodeInterface parentNode, TreeNodeInterface rootOfTree, boolean firstChild)
protected java.lang.String createPlusMinus(boolean vLine, java.lang.String nImage, java.lang.String nImageKey, boolean vLine2, boolean hLine, java.lang.String addOns, java.lang.String nodeName, java.lang.String altText, boolean enabled, int numRows)
protected java.lang.StringBuffer createPlusMinusConnector(java.lang.StringBuffer nodeTemplate, boolean vLine, java.lang.String vLineColor, java.lang.String nImage, java.lang.String nImageKey, int numRows)
protected java.lang.StringBuffer createPlusMinusImage(java.lang.StringBuffer nodeTemplate, java.lang.String nImage, java.lang.String nImageKey, java.lang.String nodeName, java.lang.String altText, boolean enabled)
protected java.lang.StringBuffer addDivExpansionLink(java.lang.StringBuffer imageTemplate, java.lang.String nodeName)
protected java.lang.StringBuffer createPlusMinusIconConnector(java.lang.StringBuffer nodeTemplate, boolean hLine, java.lang.String hLineColor, java.lang.String nImage, java.lang.String nImageKey)
protected java.lang.StringBuffer createIconConnector(java.lang.StringBuffer nodeTemplate, boolean vLine, java.lang.String vLineColor, boolean row1, boolean firstChild, int numRows)
protected java.lang.StringBuffer addDivFolderImageTag(java.lang.StringBuffer imageTemplate, TreeNodeInterface node)
protected void addDivText(java.lang.StringBuffer tableString, TreeNodeInterface node)
protected java.lang.StringBuffer addDivTextSpan(java.lang.StringBuffer tableString, TreeNodeInterface node)
protected void addDivLink(java.lang.StringBuffer tableString, TreeNodeInterface node)
protected java.lang.String getDivHTMLTreeTextImage(java.lang.String toLookFor, java.lang.String PMLink, TreeNodeInterface node, java.lang.String addOns, TreeNodeInterface parentNode, TreeNodeInterface rootOfTree, boolean firstChild, java.lang.String selectedNode)
protected void addDivNodeImage(java.lang.StringBuffer tableString, TreeNodeInterface node, java.lang.String plusMinusLink)
protected void addDivPlusMinusImage(java.lang.StringBuffer tableString, TreeNodeInterface node, TreeNodeInterface parentNode, TreeNodeInterface rootOfTree, boolean firstChild, java.lang.String plusMinusLink)
protected void addPlusMinusImageTop(java.lang.StringBuffer tableString, java.lang.String plusMinusLink, java.lang.String img, java.lang.String imgKey)
protected void addPlusMinusImage(java.lang.StringBuffer tableString, java.lang.String plusMinusLink, java.lang.String img, java.lang.String imgKey)
protected void addPlusMinusImageCommon(java.lang.StringBuffer tableString, java.lang.String plusMinusLink, java.lang.String img, java.lang.String imgKey)
public void setFormObject(Form form)
setFormObject
in interface FormViewInterface
form
- the form objectpublic Form getFormObject()
getFormObject
in interface FormViewInterface
public Form getDefaultFormObject()
getDefaultFormObject
in interface FormViewInterface
public java.util.HashMap getAdditionalParameters()
getAdditionalParameters
in interface FormViewInterface
HashMap
public void setAdditionalParameters(java.util.HashMap map)
setAdditionalParameters
in interface FormViewInterface
map
- The hashMap containing additional parameters that should be added to the form.HashMap
public void setAdditionalParameter(java.lang.String name, java.lang.String value)
setAdditionalParameter
in interface FormViewInterface
name
- name of the list itemvalue
- value of the list itemHashMap
public boolean isFormEnabled()
FormViewInterface
isFormEnabled
in interface FormViewInterface
public void setFormEnabled(boolean enabled)
FormViewInterface
setFormEnabled
in interface FormViewInterface
public boolean isDelayExecutionEnabled()
public void setDelayExecutionEnabled(boolean enabled)
value
- true if the TreeView should delay execution of its javascript.public boolean isRenderUsingDivs()
public void setRenderUsingDivs(boolean enabled)
value
- true if the TreeView should render using div tags.public java.util.Map getStyleMap()
ComplexStyleInterface
getStyleMap
in interface ComplexStyleInterface
public com.sas.servlet.tbeans.html.TreeView.TreeNodeTransform getTransform()
public void setTransform(com.sas.servlet.tbeans.html.TreeView.TreeNodeTransform transform)
transform
- the transform for the tree nodepublic static void sort(javax.swing.tree.MutableTreeNode node, java.util.Comparator comparator)
node
- The root node to start sorting under.comparator
- The comparator used to compare nodes during a sort.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |