comparison org.eclipse.jface/src/org/eclipse/jface/viewers/ITreeContentProvider.d @ 12:bc29606a740c

Added dwt-addons in original directory structure of eclipse.org
author Frank Benoit <benoit@tionex.de>
date Sat, 14 Mar 2009 18:23:29 +0100
parents
children
comparison
equal deleted inserted replaced
11:43904fec5dca 12:bc29606a740c
1 /*******************************************************************************
2 * Copyright (c) 2000, 2006 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/
13 module org.eclipse.jface.viewers.ITreeContentProvider;
14
15 import java.lang.all;
16
17 import org.eclipse.jface.viewers.IStructuredContentProvider;
18
19 /**
20 * An interface to content providers for tree-structure-oriented
21 * viewers.
22 *
23 * @see AbstractTreeViewer
24 */
25 public interface ITreeContentProvider : IStructuredContentProvider {
26 /**
27 * Returns the child elements of the given parent element.
28 * <p>
29 * The difference between this method and <code>IStructuredContentProvider.getElements</code>
30 * is that <code>getElements</code> is called to obtain the
31 * tree viewer's root elements, whereas <code>getChildren</code> is used
32 * to obtain the children of a given parent element in the tree (including a root).
33 * </p>
34 * The result is not modified by the viewer.
35 *
36 * @param parentElement the parent element
37 * @return an array of child elements
38 */
39 public Object[] getChildren(Object parentElement);
40
41 /**
42 * Returns the parent for the given element, or <code>null</code>
43 * indicating that the parent can't be computed.
44 * In this case the tree-structured viewer can't expand
45 * a given node correctly if requested.
46 *
47 * @param element the element
48 * @return the parent element, or <code>null</code> if it
49 * has none or if the parent cannot be computed
50 */
51 public Object getParent(Object element);
52
53 /**
54 * Returns whether the given element has children.
55 * <p>
56 * Intended as an optimization for when the viewer does not
57 * need the actual children. Clients may be able to implement
58 * this more efficiently than <code>getChildren</code>.
59 * </p>
60 *
61 * @param element the element
62 * @return <code>true</code> if the given element has children,
63 * and <code>false</code> if it has no children
64 */
65 public bool hasChildren(Object element);
66 }