Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 12779ed82a593255ada40a483dacd17e77f1fed8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*******************************************************************************
 * Copyright (c) 2012 CEA LIST.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    Nicolas Bros (Mia-Software) - Bug 372865 - FacetSet selection dialog
 *******************************************************************************/
package org.eclipse.papyrus.emf.facet.util.swt.internal.exported;

import org.eclipse.swt.widgets.TreeItem;

public final class SWTTestUtils {
	private SWTTestUtils() {
		// utility class
	}

	/**
	 * Find a tree item with the given text among the list of tree items.
	 *
	 * @param text
	 *            the text of the tree item to find
	 * @param items
	 *            the list of tree items to search
	 * @return the tree item or <code>null</code> if not found
	 */
	public static TreeItem findTreeItem(final String text, final TreeItem[] items) {
		TreeItem result = null;
		for (TreeItem item : items) {
			if (text.equals(item.getText())) {
				result = item;
			}
		}
		return result;
	}
}

Back to the top