itreecontentprovider.java
来自「jfa2ce 源码帮助开发人员更好的理解运用」· Java 代码 · 共 61 行
JAVA
61 行
/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/package org.eclipse.jface.viewers;/** * An interface to content providers for tree-structure-oriented * viewers. * * @see AbstractTreeViewer */public interface ITreeContentProvider extends IStructuredContentProvider { /** * Returns the child elements of the given parent element. * <p> * The difference between this method and <code>IStructuredContentProvider.getElements</code> * is that <code>getElements</code> is called to obtain the * tree viewer's root elements, whereas <code>getChildren</code> is used * to obtain the children of a given parent element in the tree (including a root). * </p> * The result is not modified by the viewer. * * @param parentElement the parent element * @return an array of child elements */ public Object[] getChildren(Object parentElement); /** * Returns the parent for the given element, or <code>null</code> * indicating that the parent can't be computed. * In this case the tree-structured viewer can't expand * a given node correctly if requested. * * @param element the element * @return the parent element, or <code>null</code> if it * has none or if the parent cannot be computed */ public Object getParent(Object element); /** * Returns whether the given element has children. * <p> * Intended as an optimization for when the viewer does not * need the actual children. Clients may be able to implement * this more efficiently than <code>getChildren</code>. * </p> * * @param element the element * @return <code>true</code> if the given element has children, * and <code>false</code> if it has no children */ public boolean hasChildren(Object element);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?