tmf: batch import wizard smoke test
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui.swtbot.tests / src / org / eclipse / linuxtools / tmf / ui / swtbot / tests / conditions / TreeItemNodeAvailable.java
1 /*******************************************************************************
2 * Copyright (c) 2013 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.ui.swtbot.tests.conditions;
14
15 import org.eclipse.swtbot.swt.finder.SWTBot;
16 import org.eclipse.swtbot.swt.finder.waits.ICondition;
17 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
18
19 /**
20 * Is a TreeItem's node available? tests if the tree has an item with a given name
21 *
22 * @author Matthew Khouzam
23 */
24 class TreeItemNodeAvailable implements ICondition {
25
26 private final SWTBotTreeItem fTreeItem;
27 private final String fName;
28
29 public TreeItemNodeAvailable(String name, SWTBotTreeItem treeItem) {
30 fName = name;
31 fTreeItem = treeItem;
32 }
33
34 @Override
35 public boolean test() throws Exception {
36 try {
37 return fTreeItem.getNode(fName) != null;
38 } catch (Exception e) {
39 }
40 return false;
41 }
42
43 @Override
44 public void init(SWTBot bot) {
45 }
46
47 @Override
48 public String getFailureMessage() {
49 return null;
50 }
51
52 }
This page took 0.033887 seconds and 5 git commands to generate.