001    package mondrian.gui.validate.impl;
002    
003    import javax.swing.tree.TreePath;
004    
005    import mondrian.gui.validate.TreeModelPath;
006    
007    /**
008     * Implementation of <code>TreeModelPath</code> for Workbench.
009     *
010     * @author mlowery
011     */
012    public class WorkbenchTreeModelPath implements TreeModelPath {
013    
014        TreePath treePath;
015    
016        public WorkbenchTreeModelPath(TreePath treePath) {
017            super();
018            this.treePath = treePath;
019        }
020    
021        public Object getPathComponent(int element) {
022            return treePath.getPathComponent(element);
023        }
024    
025        public int getPathCount() {
026            return treePath.getPathCount();
027        }
028    
029        public boolean isEmpty() {
030            return treePath == null || treePath.getPathCount() == 0;
031        }
032    
033    }
034    
035    // End WorkbenchTreeModelPath.java