1 19 20 package org.netbeans.modules.xml.multiview.ui; 21 22 import javax.swing.JTree ; 23 import javax.swing.tree.TreeCellRenderer ; 24 25 import org.openide.explorer.view.BeanTreeView; 26 import org.openide.explorer.view.NodeTreeModel; 27 33 public class StructureTreeView extends BeanTreeView { 34 35 36 public StructureTreeView() { 37 } 38 39 public StructureTreeView(TreeCellRenderer r,String lineStyle){ 40 super(); 41 tree.setCellRenderer(r); 42 tree.putClientProperty("JTree.lineStyle", lineStyle); tree.setShowsRootHandles(false); 44 } 46 47 public NodeTreeModel getModel(){ 48 return (NodeTreeModel) tree.getModel(); 49 } 50 51 public JTree getTree(){ 52 return tree; 53 } 54 55 public void addNotify() { 56 super.addNotify(); 57 expandAll(); 58 } 59 } 60 | Popular Tags |