Ejemplo n.º 1
0
 public boolean isLeaf(Object node) {
   if (node instanceof Entity) {
     EntityCategory category = d_domain.getCategory(((Entity) node));
     if (category != null) {
       return d_domain.getCategoryContents(category).contains(node);
     }
   }
   return false;
 }
Ejemplo n.º 2
0
 public TreePath getPathTo(Object node) {
   if (d_root.equals(node)) {
     return new TreePath(new Object[] {d_root});
   } else if (d_domain.getCategories().contains(node)) {
     return new TreePath(new Object[] {d_root, node});
   } else if (isLeaf(node)) {
     return new TreePath(new Object[] {d_root, d_domain.getCategory(((Entity) node)), node});
   }
   return null;
 }