Java Doc for Tree.java in  » Ajax » zk » org » zkoss » zul » 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 » Ajax » zk » org.zkoss.zul 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.zkoss.zul.impl.XulElement
   org.zkoss.zul.Tree

Tree
public class Tree extends XulElement (Code)
A container which can be used to hold a tabular or hierarchical set of rows of elements.

Event:

  1. org.zkoss.zk.ui.event.SelectEvent is sent when user changes the selection.

Default Tree.getSclass : tree.
author:
   tomyeh


Inner Class :protected class ExtraCtrl extends XulElement.ExtraCtrl implements InnerWidth,Selectable


Constructor Summary
public  Tree()
    

Method Summary
public  voidaddItemToSelection(Treeitem item)
     Selects the given item, without deselecting any other items that are already selected..
public  voidclear()
     Clears all child tree items ( Treeitem .
public  voidclearSelection()
     Clears the selection.
public  Objectclone()
    
protected  ObjectgetAssociatedNode(Treeitem ti, Tree t)
    
protected  ComponentgetChildByNode(Object node)
     Return the Tree or Treeitem component by a given associated node in model.
This implmentation calls TreeModel.getPath method to locate assoicated Treeitem (or Tree) via path.
public  CollectiongetHeads()
     Returns a collection of heads, including Tree.getTreecols and auxiliary heads ( Auxhead ) (never null).
public  StringgetIconSclass()
     Returns the style class prefix used to generate the icons of this tree.
public  StringgetInnerWidth()
     Returns the inner width of this component.
public  intgetItemCount()
     Returns the number of child Treeitem .
public  CollectiongetItems()
     Returns a readonly list of all descending Treeitem (children's children and so on).
public  TreeModelgetModel()
     Returns the list model associated with this tree, or null if this tree is not associated with any tree data model.
public  StringgetName()
     Returns the name of this component.

Default: null.

The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers.

public  StringgetOuterAttrs()
    
public  intgetPageSize()
     Returns the page size that is used by all Treechildren to display a portion of their child Treeitem , or -1 if no limitation.
public  intgetRows()
     Returns the rows.
public  intgetSelectedCount()
     Returns the number of items being selected.
public  TreeitemgetSelectedItem()
     Returns the selected item.
public  SetgetSelectedItems()
     Returns all selected items.
public  StringgetSeltype()
     Returns the seltype.
public  TreechildrengetTreechildren()
     Returns the treechildren that this tree owns (might null).
public  TreecolsgetTreecols()
     Returns the treecols that this tree owns (might null).
public  TreefootgetTreefoot()
     Returns the treefoot that this tree owns (might null).
public  TreeitemRenderergetTreeitemRenderer()
     Returns the renderer to render each item, or null if the default renderer is used.
public  booleaninsertBefore(Component newChild, Component refChild)
    
final public  booleanisCheckmark()
     Returns whether the check mark shall be displayed in front of each item.
public  booleanisMultiple()
     Returns whether multiple selections are allowed.
final public  booleanisVflex()
     Returns whether to grow and shrink vertical to fit their given space, so called vertial flexibility.
protected  ObjectnewExtraCtrl()
    
public  voidonChildAdded(Component child)
    
public  voidonChildRemoved(Component child)
    
 voidonTreechildrenAdded(Treechildren tchs)
     Called by Treechildren when is added to a tree.
 voidonTreechildrenRemoved(Treechildren tchs)
     Called by Treechildren when is removed from a tree.
 voidonTreeitemAdded(Treeitem item)
     Called by Treeitem when is added to a tree.
 voidonTreeitemRemoved(Treeitem item)
     Called by Treeitem when is removed from a tree.
public  voidremoveItemFromSelection(Treeitem item)
     Deselects the given item without deselecting other items.
public  voidrenderItem(Treeitem item)
     Renders the specified Treeitem if not loaded yet, with Tree.getTreeitemRenderer .
public  voidrenderItem(Treeitem item, Object data)
     Renders the specified Treeitem with data if not loaded yet, with Tree.getTreeitemRenderer .

It does nothing if Tree.getModel returns null.

Note: Since the corresponding data is given, This method has better performance than renderItem(Treeitem item) due to not searching for its corresponding data.

public  TreeitemrenderItemByPath(int[] path)
    
public  voidrenderItems(Set items)
     Renders the specified Treeitem s with data if not loaded yet, with Tree.getTreeitemRenderer .
public  voidselectAll()
     Selects all items.
public  voidselectItem(Treeitem item)
     Deselects all of the currently selected items and selects the given item.

It is the same as Tree.setSelectedItem .
Parameters:
  item - the item to select.

public  voidsetCheckmark(boolean checkmark)
     Sets whether the check mark shall be displayed in front of each item.

The check mark is a checkbox if Tree.isMultiple returns true.

public  voidsetIconSclass(String scls)
     Sets the style class prefix used to generate the icons of this tree.
public  voidsetInnerWidth(String innerWidth)
     Sets the inner width of this component. The inner width is the width of the inner table. By default, it is 100%.
public  voidsetModel(TreeModel model)
     Sets the tree model associated with this tree.
public  voidsetMultiple(boolean multiple)
     Sets whether multiple selections are allowed.
public  voidsetName(String name)
     Sets the name of this component.

The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers.

public  voidsetPageSize(int size)
     Sets the page size that is used by all Treechildren to display a portion of their child Treeitem .
Parameters:
  size - the page size.
public  voidsetRows(int rows)
     Sets the rows.
public  voidsetSelectedItem(Treeitem item)
     Deselects all of the currently selected items and selects the given item.
public  voidsetSeltype(String seltype)
     Sets the seltype.
public  voidsetTreeitemRenderer(TreeitemRenderer renderer)
     Sets the renderer which is used to render each item if Tree.getModel is not null.
public  voidsetVflex(boolean vflex)
     Sets whether to grow and shrink vertical to fit their given space, so called vertial flexibility.
public  voidsmartUpdate(String attr, String value)
    
public  voidtoggleItemSelection(Treeitem item)
     If the specified item is selected, it is deselected. If it is not selected, it is selected.


Constructor Detail
Tree
public Tree()(Code)




Method Detail
addItemToSelection
public void addItemToSelection(Treeitem item)(Code)
Selects the given item, without deselecting any other items that are already selected..



clear
public void clear()(Code)
Clears all child tree items ( Treeitem .

Note: after clear, Tree.getTreechildren won't be null, but it has no child




clearSelection
public void clearSelection()(Code)
Clears the selection.



clone
public Object clone()(Code)



getAssociatedNode
protected Object getAssociatedNode(Treeitem ti, Tree t)(Code)
Return a node which is an associated Treeitem ti in a Tree tree
since:
   3.0.0



getChildByNode
protected Component getChildByNode(Object node)(Code)
Return the Tree or Treeitem component by a given associated node in model.
This implmentation calls TreeModel.getPath method to locate assoicated Treeitem (or Tree) via path. You can override this method to speed up performance if possible.
since:
   3.0.0



getHeads
public Collection getHeads()(Code)
Returns a collection of heads, including Tree.getTreecols and auxiliary heads ( Auxhead ) (never null).
since:
   3.0.0



getIconSclass
public String getIconSclass()(Code)
Returns the style class prefix used to generate the icons of this tree.

Default: tree.
Another builtin style class: dottree (the style used prior 3.0).

Assume that the icon style class is tree, then the following style classes are used for the icons of each tree item:

tree-root-open
The icon used to represent the open state for tree items at the root level.
tree-root-close
The icon used to represent the close state for tree items at the root level.
tree-tee-open
The icon used to represent the open state for tree items that have next siblings.
tree-tee-close
The icon used to represent the close state for tree items at have next siblings.
tree-last-open
The icon used to represent the open state for tree items that don't have next siblings.
tree-last-close
The icon used to represent the close state for tree items at don't have next siblings.
tree-tee
The icon used to represent the T-shape icon.
tree-vbar
The icon used to represent the |-shape (vertical bar) icon.
tree-last
The icon used to represent the L-shape icon -- no next sibling.
tree-spacer
The icon used to represent the blank icon.

since:
   3.0.0



getInnerWidth
public String getInnerWidth()(Code)
Returns the inner width of this component. The inner width is the width of the inner table.

Default: "100%"
See Also:   Tree.setInnerWidth
since:
   3.0.0




getItemCount
public int getItemCount()(Code)
Returns the number of child Treeitem . The same as Tree.getItems .size().

Note: the performance of this method is no good.




getItems
public Collection getItems()(Code)
Returns a readonly list of all descending Treeitem (children's children and so on).

Note: the performance of the size method of returned collection is no good.




getModel
public TreeModel getModel()(Code)
Returns the list model associated with this tree, or null if this tree is not associated with any tree data model. the list model associated with this tree
since:
   3.0.0



getName
public String getName()(Code)
Returns the name of this component.

Default: null.

The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.

Don't use this method if your application is purely based on ZK's event-driven model.




getOuterAttrs
public String getOuterAttrs()(Code)



getPageSize
public int getPageSize()(Code)
Returns the page size that is used by all Treechildren to display a portion of their child Treeitem , or -1 if no limitation.

Default: 10.
since:
   2.4.1




getRows
public int getRows()(Code)
Returns the rows. Zero means no limitation.

Default: 0.




getSelectedCount
public int getSelectedCount()(Code)
Returns the number of items being selected.



getSelectedItem
public Treeitem getSelectedItem()(Code)
Returns the selected item.



getSelectedItems
public Set getSelectedItems()(Code)
Returns all selected items.



getSeltype
public String getSeltype()(Code)
Returns the seltype.

Default: "single".




getTreechildren
public Treechildren getTreechildren()(Code)
Returns the treechildren that this tree owns (might null).



getTreecols
public Treecols getTreecols()(Code)
Returns the treecols that this tree owns (might null).



getTreefoot
public Treefoot getTreefoot()(Code)
Returns the treefoot that this tree owns (might null).



getTreeitemRenderer
public TreeitemRenderer getTreeitemRenderer()(Code)
Returns the renderer to render each item, or null if the default renderer is used. the renderer to render each item, or null if the default
since:
   3.0.0



insertBefore
public boolean insertBefore(Component newChild, Component refChild)(Code)



isCheckmark
final public boolean isCheckmark()(Code)
Returns whether the check mark shall be displayed in front of each item.

Default: false.




isMultiple
public boolean isMultiple()(Code)
Returns whether multiple selections are allowed.

Default: false.




isVflex
final public boolean isVflex()(Code)
Returns whether to grow and shrink vertical to fit their given space, so called vertial flexibility.

Note: this attribute is ignored if Tree.setRows is specified

Default: false.




newExtraCtrl
protected Object newExtraCtrl()(Code)



onChildAdded
public void onChildAdded(Component child)(Code)



onChildRemoved
public void onChildRemoved(Component child)(Code)



onTreechildrenAdded
void onTreechildrenAdded(Treechildren tchs)(Code)
Called by Treechildren when is added to a tree.



onTreechildrenRemoved
void onTreechildrenRemoved(Treechildren tchs)(Code)
Called by Treechildren when is removed from a tree.



onTreeitemAdded
void onTreeitemAdded(Treeitem item)(Code)
Called by Treeitem when is added to a tree.



onTreeitemRemoved
void onTreeitemRemoved(Treeitem item)(Code)
Called by Treeitem when is removed from a tree.



removeItemFromSelection
public void removeItemFromSelection(Treeitem item)(Code)
Deselects the given item without deselecting other items.



renderItem
public void renderItem(Treeitem item)(Code)
Renders the specified Treeitem if not loaded yet, with Tree.getTreeitemRenderer .

It does nothing if Tree.getModel returns null.
See Also:   Tree.renderItems
since:
   3.0.0




renderItem
public void renderItem(Treeitem item, Object data)(Code)
Renders the specified Treeitem with data if not loaded yet, with Tree.getTreeitemRenderer .

It does nothing if Tree.getModel returns null.

Note: Since the corresponding data is given, This method has better performance than renderItem(Treeitem item) due to not searching for its corresponding data.
See Also:   Tree.renderItems
since:
   3.0.0




renderItemByPath
public Treeitem renderItemByPath(int[] path)(Code)
Load treeitems through path path
Note: By using this method, all treeitems in path will be rendered
Parameters:
  path - - an int[] path, see TreeModel.getPath the treeitem from tree by given path
since:
   3.0.0



renderItems
public void renderItems(Set items)(Code)
Renders the specified Treeitem s with data if not loaded yet, with Tree.getTreeitemRenderer .

It does nothing if Tree.getModel returns null.
See Also:   Tree.renderItem
since:
   3.0.0




selectAll
public void selectAll()(Code)
Selects all items.



selectItem
public void selectItem(Treeitem item)(Code)
Deselects all of the currently selected items and selects the given item.

It is the same as Tree.setSelectedItem .
Parameters:
  item - the item to select. If null, all items are deselected.




setCheckmark
public void setCheckmark(boolean checkmark)(Code)
Sets whether the check mark shall be displayed in front of each item.

The check mark is a checkbox if Tree.isMultiple returns true. It is a radio button if Tree.isMultiple returns false.




setIconSclass
public void setIconSclass(String scls)(Code)
Sets the style class prefix used to generate the icons of this tree.
since:
   3.0.0
See Also:   Tree.getIconSclass



setInnerWidth
public void setInnerWidth(String innerWidth)(Code)
Sets the inner width of this component. The inner width is the width of the inner table. By default, it is 100%. That is, it is the same as the width of this component. However, it is changed when the user is sizing the column's width.

Application developers rarely call this method, unless they want to preserve the widths of sizable columns changed by the user. To preserve the widths, the developer have to store the widths of all columns and the inner width ( Tree.getInnerWidth ), and then restore them when re-creating this component.
Parameters:
  innerWidth - the inner width. If null, "100%" is assumed.
since:
   3.0.0




setModel
public void setModel(TreeModel model) throws Exception(Code)
Sets the tree model associated with this tree.
Parameters:
  model - the tree model to associate, or null to dis-associateany previous model.
exception:
  UiException - if failed to initialize with the model
since:
   3.0.0



setMultiple
public void setMultiple(boolean multiple)(Code)
Sets whether multiple selections are allowed.



setName
public void setName(String name)(Code)
Sets the name of this component.

The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.

Don't use this method if your application is purely based on ZK's event-driven model.
Parameters:
  name - the name of this component.




setPageSize
public void setPageSize(int size) throws WrongValueException(Code)
Sets the page size that is used by all Treechildren to display a portion of their child Treeitem .
Parameters:
  size - the page size. If non-positive, there won't beany limitation. In other wordss, all Treeitem are shown.Notice: since the browser's JavaScript engine is slow tohandle huge trees, it is better not to set a non-positive sizeif your tree is huge.
since:
   2.4.1



setRows
public void setRows(int rows) throws WrongValueException(Code)
Sets the rows.

Note: if both Tree.setHeight is specified with non-empty, Tree.setRows is ignored




setSelectedItem
public void setSelectedItem(Treeitem item)(Code)
Deselects all of the currently selected items and selects the given item.

It is the same as Tree.selectItem .




setSeltype
public void setSeltype(String seltype) throws WrongValueException(Code)
Sets the seltype. Currently, only "single" is supported.



setTreeitemRenderer
public void setTreeitemRenderer(TreeitemRenderer renderer)(Code)
Sets the renderer which is used to render each item if Tree.getModel is not null.

Note: changing a render will not cause the tree to re-render. If you want it to re-render, you could assign the same model again (i.e., setModel(getModel())), or fire an TreeDataEvent event.
Parameters:
  renderer - the renderer, or null to use the default.
exception:
  UiException - if failed to initialize with the model
since:
   3.0.0




setVflex
public void setVflex(boolean vflex)(Code)
Sets whether to grow and shrink vertical to fit their given space, so called vertial flexibility.

Note: this attribute is ignored if Tree.setRows is specified




smartUpdate
public void smartUpdate(String attr, String value)(Code)



toggleItemSelection
public void toggleItemSelection(Treeitem item)(Code)
If the specified item is selected, it is deselected. If it is not selected, it is selected. Other items in the tree that are selected are not affected, and retain their selected state.



Methods inherited from org.zkoss.zul.impl.XulElement
public String getAction()(Code)(Java Doc)
public String getActionAttrs()(Code)(Java Doc)
protected String getAllOnClickAttrs(boolean ignoreOnClick)(Code)(Java Doc)
public String getContext()(Code)(Java Doc)
public String getInnerAttrs()(Code)(Java Doc)
public String getOuterAttrs()(Code)(Java Doc)
public String getPopup()(Code)(Java Doc)
public String getTooltip()(Code)(Java Doc)
public void setAction(String action)(Code)(Java Doc)
public void setContext(String context)(Code)(Java Doc)
public void setContext(Popup popup)(Code)(Java Doc)
public void setPopup(String popup)(Code)(Java Doc)
public void setPopup(Popup popup)(Code)(Java Doc)
public void setTooltip(String tooltip)(Code)(Java Doc)
public void setTooltip(Popup popup)(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.