1 26 27 package org.objectweb.util.browser.core.common; 28 29 30 import java.io.Serializable ; 31 32 import org.objectweb.util.browser.api.Entry; 33 import org.objectweb.util.browser.api.Tree; 34 import org.objectweb.util.browser.core.api.ExtendedEntry; 35 import org.objectweb.util.browser.core.api.ExtendedTreeView; 36 import org.objectweb.util.browser.core.api.TreeConfiguration; 37 38 44 public class DefaultTreeView 45 implements ExtendedTreeView, Serializable 46 { 47 48 54 55 protected DynamicTree tree_; 56 57 58 protected Entry entry_, parent_; 59 60 61 protected Object handleObject_; 62 63 69 73 public DefaultTreeView(DynamicTree tree) { 74 tree_ = tree; 75 entry_ = tree_.getSelectedEntry(); 76 parent_ = tree_.getSelectedEntryParent(); 77 } 78 79 84 public DefaultTreeView(DynamicTree tree, Entry entry) { 85 tree_ = tree; 86 entry_ = entry; 87 parent_ = null; 88 } 89 90 96 100 protected Object getValue(Entry entry) { 101 if (entry != null) 102 return (((ExtendedEntry) entry).getWrappedObject()); 103 return null; 104 } 105 106 112 119 123 public TreeConfiguration getTreeConfiguration() { 124 return (TreeConfiguration) tree_; 125 } 126 127 130 public Entry getSelectedEntry() { 131 return entry_; 132 } 133 134 137 public Entry getParentEntry() { 138 return parent_; 139 } 140 141 144 public Object getSelectedObject() { 145 return getValue(entry_); 146 } 147 148 151 public Object getParentObject() { 152 return getValue(parent_); 153 } 154 155 158 public Tree 159 getTree(){ 160 return (Tree)tree_; 161 } 162 163 } 164 | Popular Tags |