01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jface.tests.performance;
11:
12: import org.eclipse.jface.viewers.ITreeContentProvider;
13: import org.eclipse.jface.viewers.Viewer;
14:
15: /**
16: * The RefreshTestTreeContentProvider is the content provider for test trees.
17: */
18: public class RefreshTestTreeContentProvider implements
19: ITreeContentProvider {
20:
21: static TestTreeElement[] elements;
22: static {
23: elements = new TestTreeElement[RefreshTestContentProvider.ELEMENT_COUNT];
24: for (int i = 0; i < RefreshTestContentProvider.ELEMENT_COUNT; i++) {
25: elements[i] = (new TestTreeElement(i, null));
26:
27: }
28:
29: }
30:
31: public RefreshTestTreeContentProvider() {
32: super ();
33: }
34:
35: public Object[] getChildren(Object parentElement) {
36: return ((TestTreeElement) parentElement).children;
37: }
38:
39: public Object getParent(Object element) {
40: return ((TestTreeElement) element).parent;
41: }
42:
43: public boolean hasChildren(Object element) {
44: return ((TestTreeElement) element).children.length > 0;
45: }
46:
47: public Object[] getElements(Object inputElement) {
48: return elements;
49: }
50:
51: public void dispose() {
52: }
53:
54: public void inputChanged(Viewer viewer, Object oldInput,
55: Object newInput) {
56:
57: }
58:
59: }
|