diff options
Diffstat (limited to 'org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/TreeUtil.java')
-rw-r--r-- | org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/TreeUtil.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/TreeUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/TreeUtil.java new file mode 100644 index 000000000..054d4dcf0 --- /dev/null +++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/TreeUtil.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2002, 2004 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.ua.tests.util; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeItem; + +/* + * Utility methods for working with Trees. + */ +public class TreeUtil { + + /* + * Fully expands the given tree. + */ + public static void expandTree(Tree tree) { + tree.setFocus(); + TreeItem[] items = tree.getItems(); + for (int i=0;i<items.length;++i) { + tree.setSelection(new TreeItem[] { items[i] }); + Keyboard.press(SWT.ARROW_RIGHT); + } + } +} |