Java Doc for TreeBase.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » component » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.component 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.rave.web.ui.component.TemplateComponentBase
   com.sun.rave.web.ui.component.TreeNodeBase
      com.sun.rave.web.ui.component.TreeNode
         com.sun.rave.web.ui.component.TreeBase

All known Subclasses:   com.sun.rave.web.ui.component.Tree,
TreeBase
abstract public class TreeBase extends com.sun.rave.web.ui.component.TreeNode (Code)

Use the ui:tree tag to display a tree structure in the rendered HTML page. Trees are often used for navigating in a web application.

HTML Elements and Layout

The Tree component defines and renders a tree structure. A tree structure is commonly used for navigation through data, as in file system navigators. The base, or root, of the tree is shown at the top, with the branches going downward.

The tree is rendered with <div> XHTML elements which define rows as well as nesting within the tree.

The ui:tree tag is the root of the tree, and acts as a container for the ui:treeNode tags. The ui:treeNode tags add branches, or nodes, to the tree. In the rendered web page, nodes can be expanded and collapsed when you click on small icons next to the nodes. In addition, the node is highlighted when you click on the node's hyperlink to indicate the node has focus.

The ui:tree tag provides the ability to render the tree root in any of the following ways:

  • As a single root, with a title bar to make the root visually distinctive. You must specify attributes or facets in the ui:tree tag to allow the title bar to be rendered.
  • As a single root, without a title bar. The root looks like any other container node in the tree. You must omit attributes and facets in the ui:tree tag, and specify a single ui:treeNode as the root node, with other ui:treeNode tags contained within the first ui:treeNode.
  • As a multi-root tree, without a title bar. There is no single top node, but two or more at the same level. You must omit attributes and facets in the ui:tree tag and include multiple ui:treeNode tags.

Defining a Title Bar for the Single Root Tree

The title bar consists of the following elements:

  • A shaded background color determined by the theme.
  • An optional graphic to the left of the title bar's text.
  • Text or a hyperlink for the content of the title bar.

The title bar can be defined with either ui:tree tag attributes or facets. The title bar is rendered if the tree component includes imageURL property for the graphic, the text property for the title text, the content facet, or the image facet.

The graphic and title text areas can be overridden with the following facets:

  • content
    --
    Specifies the text or hyperlink for the title bar. When the content facet is used, the text and hyperlink properties have no effect.
  • image
    --
    Specifies the image area. When the image facet is used, image properties have no effect.

Defining a Tree with Multiple Roots

To define a tree that has multiple roots rather than a single top root, you must use the ui:tree tag only as a container. You should not specify attributes for the graphic or title text, or use facets in the ui:tree tag.

You can use ui:treeNode tags as containers for other ui:treeNode tags, but should not use one to contain all the others to avoid the appearance of a single root.

Client Side Javascript Functions

The JavaScript functions listed in the following table are defined in a file that is referenced automatically by the Tree component. The functions are called automatically in the rendered HTML. You can also call these functions independently; you may choose to do this to select or expand/collapse a TreeNode on the client.

  • clearHightlight(treeNode)
    --
    This function clears the highlighting for a particular TreeNode. The treeNode passed in should be the <div> around the html for the TreeNode. This may be obtained by calling getElementById("<TreeNode.getClidentId()>").
  • expandCollapse(treeNode, event)
    --
    This function expands or collapses the given tree node. It expects the source of the given event object (if supplied) to be a tree handle image. It will change this image to point in the correct direction (right or down). This implementation depends on the tree handle image names including "tree_handleright" and "tree_handledown" in them. Swapping "right" and "down" in these names must change the handle direction to right and down respectively.
  • getParentTreeNode(treeId)
    --
    This function returns the parent TreeNode of the given TreeNode.
  • getSelectedTreeNode(treeId)
    --
    This function returns the selected TreeNode given the treeId of the Tree.
  • getTree(treeNode)
    --
    This function provides access to the Tree object containing the given TreeNode.
  • highlight(treeNode)
    --
    This function highlights the given TreeNode. The treeNode passed in is the <div> around the html for the TreeNode and may be obtained by calling getElementById("<TreeNode.getClidentId()>").
  • highlightParent(treeNode)
    --
    This function highlights the parent TreeNode of the given TreeNode. It only does so if the given TreeNode is not visible. The parent is considered the first visible parent of this TreeNode. The treeNode passed in is the <div> around the html for the child TreeNode and may be obtained by calling getElementById("<TreeNode.getClidentId()>").
  • isAnHref(event)
    --
    This method checks to see if the event.target is an href, or if any of the parent nodes which contain it is an href. To considered an href, it must be an "A" tag with an "href" attribute containing atleast 4 characters. (Note: Browsers will add on the protocol if you supply a relative URL such as one starting with a '#', '/', or filename).
  • isTreeHandle(event)
    --
    This function determines if the event source was a tree handle image. This implementation depends on the tree handle image file name containing "tree_handle" and no other images containing this string.
  • onTreeNodeClick(treeNode)
    --
    This function Takes in the TreeNode <div> object that was clicked in order to process the highlighting changes that are necessary. This object may be obtained by calling getElementById("<TreeNode.getClidentId()>"). If this function is invoked from the TreeNode <div> object itself (as is the case when this method is implicitly called), the TreeNode object is simply the this variable.
  • selectTreeNode(treeNode)
    --
    This function may be used to select the given TreeNode. It will clear the previous TreeNode and select the given one.
  • treeNodeIsExpanded(treeNode)
    --
    This function determines if the given TreeNode is expanded. It returns true if it is, false otherwise.
  • unhighlightParent(treeNode)
    --
    This function un-applies parent highlighting to the parent TreeNode of the given TreeNode. It only does so if the given TreeNode is not visible. The parent is considered the first visible parent of this TreeNode. The treeNode passed in is the <div> element around the html for the TreeNode and may be obtained by calling getElementById("<TreeNode.getClidentId()>").
  • updateHightlight(id)
    --
    This function updates the highlighting for the given Tree client id. This function provides a way to restore the highlighting when a Tree is reloaded in a window (necessary each page load).

Example:

Below is an example showing how a tree may be defined in a JSP page:

 <ui:tree id="MyTree" text="hi">
 <f:facet name="image">
 <ui:image id="image" icon="TREE_SERVER" />
 </f:facet>
 <ui:treeNode id="Node0" text="About..." />
 <ui:treeNode id="Node1" expanded="true" text="External URLs">
 <f:facet name="image">
 <ui:image id="image" icon="TREE_SERVER" />
 </f:facet>
 <ui:treeNode id="Node1_1" text="Sun Microsystems, Inc." url="http://www.sun.com" target="external">
 <f:facet name="image">
 <ui:image id="image" icon="TREE_STORAGE_MAJOR" />
 </f:facet>
 </ui:treeNode>
 <ui:treeNode id="Node1_2" text="Search Engines">
 <ui:treeNode id="Node1_2_1" text="Google" url="http://www.google.com" imageURL="../images/google.jpg" target="external" />
 <ui:treeNode id="Node1_2_2" text="Yahoo!" url="http://www.yahoo.com" imageURL="../images/yahoo.jpg" target="external" />
 <ui:treeNode id="Node1_2_3" text="Lycos" url="http://www.lycos.com" target="external">
 <f:facet name="image">
 <ui:image id="image" url="http://ly.lygo.com/ly/srch/hp/dog_web_34x35.gif" height="16" width="16" />
 </f:facet>
 </ui:treeNode>
 </ui:treeNode>
 </ui:treeNode>
 </ui:tree>
 

Auto-generated component class. Do NOT modify; all changes will be lost!




Constructor Summary
public  TreeBase()
    

Method Summary
public  StringgetFamily()
    

Return the identifier of the component family to which this component belongs.

public  StringgetSelected()
    
public  StringgetStyle()
    
public  StringgetStyleClass()
    
public  StringgetText()
    
public  booleanisClientSide()
    

Specifies if this Tree should run on the client, or if it should interact with the server.

public  booleanisExpandOnSelect()
    

Flag indicating that folder / container nodes will automatically expand when they are selected.

public  booleanisImmediate()
    
public  booleanisRequired()
    
public  booleanisVisible()
    

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.

public  voidrestoreState(FacesContext _context, Object _state)
    
public  ObjectsaveState(FacesContext _context)
    
public  voidsetClientSide(boolean clientSide)
    

Specifies if this Tree should run on the client, or if it should interact with the server.

public  voidsetExpandOnSelect(boolean expandOnSelect)
    

Flag indicating that folder / container nodes will automatically expand when they are selected.

public  voidsetImmediate(boolean immediate)
    
public  voidsetRequired(boolean required)
    
public  voidsetSelected(String selected)
    
public  voidsetStyle(String style)
    
public  voidsetStyleClass(String styleClass)
    
public  voidsetText(String text)
    
public  voidsetVisible(boolean visible)
    

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.



Constructor Detail
TreeBase
public TreeBase()(Code)

Construct a new TreeBase.





Method Detail
getFamily
public String getFamily()(Code)

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.




getSelected
public String getSelected()(Code)

Specifies the client id of the selected tree node.




getStyle
public String getStyle()(Code)

CSS style(s) to be applied when this component is rendered.




getStyleClass
public String getStyleClass()(Code)

CSS style class(es) to be applied when this component is rendered.




getText
public String getText()(Code)

The text displayed at root of the tree




isClientSide
public boolean isClientSide()(Code)

Specifies if this Tree should run on the client, or if it should interact with the server. If it runs on the client, then clicking on the tree icon to expand or collapse portions of the tree will happen only on the client (browser). Otherwise, it will make a request to the server each time the tree is expanded or collapsed.




isExpandOnSelect
public boolean isExpandOnSelect()(Code)

Flag indicating that folder / container nodes will automatically expand when they are selected. This attribute is true by default. If you want a tree's container nodes to expand only when the handle icons are clicked, set expandOnSelect to false.




isImmediate
public boolean isImmediate()(Code)

Indicate that event handling for this component should be handled immediately (in Apply Request Values phase) rather than waiting until Invoke Application phase.




isRequired
public boolean isRequired()(Code)

Indicates that the user must select a value for this tree.




isVisible
public boolean isVisible()(Code)

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.




restoreState
public void restoreState(FacesContext _context, Object _state)(Code)

Restore the state of this component.




saveState
public Object saveState(FacesContext _context)(Code)

Save the state of this component.




setClientSide
public void setClientSide(boolean clientSide)(Code)

Specifies if this Tree should run on the client, or if it should interact with the server. If it runs on the client, then clicking on the tree icon to expand or collapse portions of the tree will happen only on the client (browser). Otherwise, it will make a request to the server each time the tree is expanded or collapsed.


See Also:   TreeBase.isClientSide()



setExpandOnSelect
public void setExpandOnSelect(boolean expandOnSelect)(Code)

Flag indicating that folder / container nodes will automatically expand when they are selected. This attribute is true by default. If you want a tree's container nodes to expand only when the handle icons are clicked, set expandOnSelect to false.


See Also:   TreeBase.isExpandOnSelect()



setImmediate
public void setImmediate(boolean immediate)(Code)

Indicate that event handling for this component should be handled immediately (in Apply Request Values phase) rather than waiting until Invoke Application phase.


See Also:   TreeBase.isImmediate()



setRequired
public void setRequired(boolean required)(Code)

Indicates that the user must select a value for this tree.


See Also:   TreeBase.isRequired()



setSelected
public void setSelected(String selected)(Code)

Specifies the client id of the selected tree node.


See Also:   TreeBase.getSelected()



setStyle
public void setStyle(String style)(Code)

CSS style(s) to be applied when this component is rendered.


See Also:   TreeBase.getStyle()



setStyleClass
public void setStyleClass(String styleClass)(Code)

CSS style class(es) to be applied when this component is rendered.


See Also:   TreeBase.getStyleClass()



setText
public void setText(String text)(Code)

The text displayed at root of the tree


See Also:   TreeBase.getText()



setVisible
public void setVisible(boolean visible)(Code)

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.


See Also:   TreeBase.isVisible()



Fields inherited from com.sun.rave.web.ui.component.TreeNode
final public static String CONTENT_FACET_KEY(Code)(Java Doc)
final public static String IMAGE_FACET_KEY(Code)(Java Doc)
final public static String LAYOUT_KEY(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.TreeNode
public void addActionListener(ActionListener listener)(Code)(Java Doc)
public void fireTurnerEvent(ActionEvent event) throws AbortProcessingException(Code)(Java Doc)
public ActionListener[] getActionListeners()(Code)(Java Doc)
protected String getHandleIcon(String value)(Code)(Java Doc)
public List getImageKeys()(Code)(Java Doc)
public static TreeNode getParentTreeNode(UIComponent node)(Code)(Java Doc)
public void removeActionListener(ActionListener listener)(Code)(Java Doc)
public void toggleNode(ActionEvent event) throws AbortProcessingException(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.TreeNodeBase
public javax.faces.el.MethodBinding getAction()(Code)(Java Doc)
public javax.faces.el.MethodBinding getActionListener()(Code)(Java Doc)
public String getFamily()(Code)(Java Doc)
public String getImageURL()(Code)(Java Doc)
public String getStyle()(Code)(Java Doc)
public String getStyleClass()(Code)(Java Doc)
public String getTarget()(Code)(Java Doc)
public String getText()(Code)(Java Doc)
public String getToolTip()(Code)(Java Doc)
public String getUrl()(Code)(Java Doc)
public boolean isExpanded()(Code)(Java Doc)
public boolean isVisible()(Code)(Java Doc)
public void restoreState(FacesContext _context, Object _state)(Code)(Java Doc)
public Object saveState(FacesContext _context)(Code)(Java Doc)
public void setAction(javax.faces.el.MethodBinding action)(Code)(Java Doc)
public void setActionListener(javax.faces.el.MethodBinding actionListener)(Code)(Java Doc)
public void setExpanded(boolean expanded)(Code)(Java Doc)
public void setImageURL(String imageURL)(Code)(Java Doc)
public void setStyle(String style)(Code)(Java Doc)
public void setStyleClass(String styleClass)(Code)(Java Doc)
public void setTarget(String target)(Code)(Java Doc)
public void setText(String text)(Code)(Java Doc)
public void setToolTip(String toolTip)(Code)(Java Doc)
public void setUrl(String url)(Code)(Java Doc)
public void setVisible(boolean visible)(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.TemplateComponentBase
public UIComponent getChild(FacesContext context, String id)(Code)(Java Doc)
public UIComponent getChild(FacesContext context, LayoutComponent descriptor)(Code)(Java Doc)
public LayoutDefinition getLayoutDefinition(FacesContext context)(Code)(Java Doc)
public String getLayoutDefinitionKey()(Code)(Java Doc)
public void restoreState(FacesContext context, Object state)(Code)(Java Doc)
public Object saveState(FacesContext context)(Code)(Java Doc)
public void setLayoutDefinitionKey(String key)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.