| /********************************************************************** |
| * Copyright (c) 2002 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Common Public License v0.5 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/cpl-v05.html |
| * |
| * Contributors: |
| * IBM - Initial API and implementation |
| **********************************************************************/ |
| package org.eclipse.ant.internal.ui; |
| |
| import org.eclipse.jface.viewers.ITreeContentProvider; |
| import org.eclipse.jface.viewers.Viewer; |
| |
| /** |
| * Content provider for the tree viewer of the Ant Console. |
| */ |
| |
| public class AntTreeContentProvider implements ITreeContentProvider { |
| |
| private AntConsole console; |
| |
| public AntTreeContentProvider(AntConsole console) { |
| this.console = console; |
| } |
| |
| /** |
| * @see ITreeContentProvider#getChildren(Object) |
| */ |
| public Object[] getChildren(Object parent) { |
| return ((OutputStructureElement) parent).getChildren(); |
| } |
| |
| /** |
| * @see ITreeContentProvider#getParent(Object) |
| */ |
| public Object getParent(Object element) { |
| return ((OutputStructureElement) element).getParent(); |
| } |
| |
| /** |
| * @see ITreeContentProvider#hasChildren(Object) |
| */ |
| public boolean hasChildren(Object element) { |
| return ((OutputStructureElement) element).hasChildren(); |
| } |
| |
| /** |
| * @see IStructuredContentProvider#getElements(Object) |
| */ |
| public Object[] getElements(Object parent) { |
| return ((OutputStructureElement) parent).getChildren(); |
| } |
| |
| /** |
| * @see IContentProvider#dispose() |
| */ |
| public void dispose() { |
| } |
| |
| /** |
| * @see IContentProvider#inputChanged(Viewer, Object, Object) |
| */ |
| public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| } |
| |
| } |
| |