1 33 34 package edu.rice.cs.util.docnavigation; 35 36 import javax.swing.tree.*; 37 38 public class LeafNode<ItemT extends INavigatorItem> extends DefaultMutableTreeNode implements NodeData<ItemT> { 39 public String _rep; 40 public LeafNode(ItemT i) { 41 super(i); 42 _rep = i.getName(); 43 } 44 public void setData(ItemT i) { super.setUserObject(i); } 45 public ItemT getData() { 46 @SuppressWarnings ("unchecked") ItemT result = (ItemT) super.getUserObject(); 47 return result; 48 } 49 public <Ret> Ret execute(NodeDataVisitor<? super ItemT, Ret> v, Object ... p) { return v.itemCase(getData(), p); } 50 public String toString() { return _rep; } 51 } 52 | Popular Tags |