EchoPoint
1.0

echopoint.tree
Interface TreeCellRenderer

All Known Implementing Classes:
DefaultTreeCellRenderer

public interface TreeCellRenderer

The TreeCellRender is responsible for returning Components used to render a Tree node. In the most general form the getTreeCellRendererText method will be called to return a Label component that contains the tree node's :

A more specific case is when a Component is to be returned as the Tree cell. In this case the getTreeCellRendererComponent method will be called to provide the component for the Tree cell.


Method Summary
 nextapp.echo.Component getTreeCellRendererComponent(Tree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf)
          Returns a Component that will be rendered as a Tree cell.
 nextapp.echo.Label getTreeCellRendererText(Tree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf)
          Returns a Label that will be used to render a Tree cell.
 

Method Detail

getTreeCellRendererComponent

public nextapp.echo.Component getTreeCellRendererComponent(Tree tree,
                                                           java.lang.Object value,
                                                           boolean selected,
                                                           boolean expanded,
                                                           boolean leaf)
Returns a Component that will be rendered as a Tree cell.

If selected is true, the cell will be drawn as if selected. If expanded is true the node is currently expanded and if leaf is true the node represets a leaf tree is the Tree the receiver is being configured for.

This method is called second by the tree rendering code, and only after the getTreeCellRendererText method has returned null.

The returned Component MUST be a unqiue Component since it will be rendered as the Tree cell.

Returns:
Component that is used to draw the value.

getTreeCellRendererText

public nextapp.echo.Label getTreeCellRendererText(Tree tree,
                                                  java.lang.Object value,
                                                  boolean selected,
                                                  boolean expanded,
                                                  boolean leaf)
Returns a Label that will be used to render a Tree cell. The following attributes are used to render the Tree cell.

If selected is true, the cell will be drawn as if selected. If expanded is true the node is currently expanded and if leaf is true the node represets a leaf tree is the Tree the receiver is being configured for.

This method is called first by the tree rendering code. If this returns null, then the getTreeCellRendererComponent method is then invoked.

The returned Label does NOT have to be a unqiue Component since only the public values of the Label are used by the the Tree rendering code. Therefore it does NOT have to be a Component in the Echo heirarchy nor does it have to be a unique Label object.

You could return the same Label object back each time this method is called, only changing the background, forground, font and icon as appropriate.

Returns the Label that is used to draw the Tree cell.

Returns:
Label that is used to draw the Tree cell.

EchoPoint
1.0