1 26 27 package org.objectweb.util.explorer.core.common.lib; 28 29 30 import java.io.Serializable ; 31 32 import org.objectweb.util.explorer.api.Entry; 33 import org.objectweb.util.explorer.api.Tree; 34 import org.objectweb.util.explorer.api.TreeView; 35 36 42 public class DefaultTreeView 43 implements TreeView, Serializable 44 { 45 46 52 53 protected Entry entry_, parent_; 54 55 56 protected Tree tree_; 57 58 64 68 public DefaultTreeView(Tree tree, Entry current, Entry parent) { 69 tree_ = tree; 70 entry_ = current; 71 parent_ = parent; 72 } 73 74 80 84 protected Object getValue(Entry entry) { 85 return (entry != null)?entry.getValue():null; 86 } 87 88 94 97 public Entry getSelectedEntry() { 98 return entry_; 99 } 100 101 104 public Entry getParentEntry() { 105 return parent_; 106 } 107 108 111 public Object getSelectedObject() { 112 return getValue(entry_); 113 } 114 115 118 public Object getParentObject() { 119 return getValue(parent_); 120 } 121 122 125 public Tree 126 getTree(){ 127 return (Tree)tree_; 128 } 129 130 } 131 | Popular Tags |