001/*
002// This software is subject to the terms of the Eclipse Public License v1.0
003// Agreement, available at the following URL:
004// http://www.eclipse.org/legal/epl-v10.html.
005// You must accept the terms of that agreement to use this software.
006//
007// Copyright (C) 2008-2009 Pentaho
008// All Rights Reserved.
009*/
010package mondrian.gui.validate.impl;
011
012import mondrian.gui.validate.TreeModelPath;
013
014import javax.swing.tree.TreePath;
015
016/**
017 * Implementation of <code>TreeModelPath</code> for Workbench.
018 *
019 * @author mlowery
020 */
021public class WorkbenchTreeModelPath implements TreeModelPath {
022
023    TreePath treePath;
024
025    public WorkbenchTreeModelPath(TreePath treePath) {
026        super();
027        this.treePath = treePath;
028    }
029
030    public Object getPathComponent(int element) {
031        return treePath.getPathComponent(element);
032    }
033
034    public int getPathCount() {
035        return treePath.getPathCount();
036    }
037
038    public boolean isEmpty() {
039        return treePath == null || treePath.getPathCount() == 0;
040    }
041
042}
043
044// End WorkbenchTreeModelPath.java