KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > store > links > CatalogTreeRenderer


1 package com.openedit.store.links;
2
3 import com.openedit.store.Category;
4 import com.openedit.webui.tree.BaseTreeRenderer;
5 import com.openedit.webui.tree.TreeRenderer;
6 import com.openedit.webui.tree.WebTree;
7
8 /**
9  * A {@link TreeRenderer} that renders {@link WebTree}s whose nodes are
10  * {@link Category}s.
11  *
12  * @author Eric Galluzzo
13  */

14 public class CatalogTreeRenderer extends BaseTreeRenderer
15 {
16     public CatalogTreeRenderer()
17     {
18         super();
19     }
20
21     public CatalogTreeRenderer( WebTree inWebTree )
22     {
23         super( inWebTree );
24     }
25
26     public String JavaDoc toId( Object JavaDoc inNode )
27     {
28         return ( (Category) inNode ).getId();
29     }
30
31     public String JavaDoc toName( Object JavaDoc inNode )
32     {
33         return ( (Category) inNode ).getName();
34     }
35
36     public String JavaDoc toUrl( Object JavaDoc inNode )
37     {
38         return toId( inNode );
39     }
40 }
41
Popular Tags