|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.AbstractComponent
net.sf.jzeno.echo.components.CustomComponent
net.sf.jzeno.echo.components.DynaTree
public class DynaTree
A simplified tree implementation, that allows full flexibility over the rendered nodes in the tree, and over retrieval of child nodes.
By default a DynaTree can be created to visualize any javabean, as long as that javabean contains 2 method :
No special interfaces, etc.. need to be implemented. Nodes containing child nodes will be represented as folders, and nodes containing no children will be represented as a document. This provides you with very simple way to create a tree control.
More control can be obtained over the tree retrieval, and it's
representation on the screen by implementing a custom DynaTreeModel
.
Here again simplicity was our goal, and implementing your custom model only
required 4 methods to be implemented.
In terms of data binding a DynaTree binds to the node that is currently selected in the tree.
Nested Class Summary | |
---|---|
class |
DynaTree.EventListener
|
Field Summary |
---|
Constructor Summary | |
---|---|
DynaTree()
|
|
DynaTree(java.lang.Class beanClass,
java.lang.String propertyPath,
java.lang.String constructionHints)
|
Method Summary | |
---|---|
void |
applyContext()
|
void |
collapse(java.lang.Object node)
Close the given node. |
void |
collapseAll()
Close all nodes in the tree. |
void |
expand(java.util.List expandedNodes)
|
void |
expand(java.lang.Object node)
Expand the tree to make the given node visible to the user. |
void |
expandAll()
Ecpand all the nodes in the tree. |
java.util.List |
findExpandedNodes()
|
DynaTreeModel |
getModel()
Retrieve the tree's model. |
java.lang.Object |
getRootNode()
Retrieve the root node of the tree. |
boolean |
isRootVisible()
|
void |
propagateEvent(ActionEvent event)
|
void |
rebind()
This operation causes the component to reset it's content to that of the domain model. |
void |
refresh()
Force the tree to redraw. |
void |
select(java.lang.Object node)
Change the tree's selection to the given node. |
void |
setModel(DynaTreeModel model)
Replace the tree's node (with your own implementation). |
void |
setRootNode(java.lang.Object rootNode)
Set the root node of the tree. |
void |
setRootVisible(boolean b)
Should the root of the tree be represented ? |
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent |
---|
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getDecorator, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isReadOnly, isRequired, isValid, markInvalid, markValid, preRender, removeValidator, setActionCommand, setBean, setBeanClass, setDecorator, setNullObject, setProperty, setReadOnly, setRequired, setValue, traceValue, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DynaTree()
public DynaTree(java.lang.Class beanClass, java.lang.String propertyPath, java.lang.String constructionHints)
Method Detail |
---|
public void setRootVisible(boolean b)
Should the root of the tree be represented ? Setting this to false will allow you to create a tree, that appear to have multiple roots.
public boolean isRootVisible()
public void rebind()
RebindableComponent
This operation causes the component to reset it's content to that of the domain model.
rebind
in interface RebindableComponent
rebind
in class CustomComponent
public void select(java.lang.Object node)
Change the tree's selection to the given node.
public void collapseAll()
Close all nodes in the tree. (Don't use this if the root node is not visible !)
public void expandAll()
Ecpand all the nodes in the tree. Be carefull if you have a large tree !
public void expand(java.lang.Object node)
Expand the tree to make the given node visible to the user.
public void collapse(java.lang.Object node)
Close the given node.
public DynaTreeModel getModel()
Retrieve the tree's model.
public void setModel(DynaTreeModel model)
Replace the tree's node (with your own implementation).
public void refresh()
Force the tree to redraw. This is useful if the structure of your tree was changed. A DynaTree will not automatically detect changes to the tree !
public void expand(java.util.List expandedNodes)
public java.util.List findExpandedNodes()
public void propagateEvent(ActionEvent event)
propagateEvent
in interface EventPropagator
public java.lang.Object getRootNode()
Retrieve the root node of the tree.
public void setRootNode(java.lang.Object rootNode)
Set the root node of the tree.
public void applyContext()
applyContext
in interface Precreation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |