Search in sources :

Example 1 with WorkbenchView

use of org.eclipse.reddeer.workbench.impl.view.WorkbenchView in project jbosstools-openshift by jbosstools.

the class NodeJSAppDebugTest method getVariable.

/**
 * getVariable from Variables view.
 *
 * @param variable
 *            name
 * @return TreeItem
 */
protected TreeItem getVariable(String name) {
    WorkbenchView variables = new WorkbenchView("Variables");
    variables.activate();
    DefaultTree variablesTree = new DefaultTree();
    TreeItem var = null;
    try {
        new WaitUntil(new TreeContainsItem(variablesTree, new WithTextMatcher(name), false));
    } catch (WaitTimeoutExpiredException e) {
        // not found
        return null;
    }
    List<TreeItem> vars = variablesTree.getItems();
    for (TreeItem i : vars) {
        if (i.getText().equals(name)) {
            var = i;
        }
    }
    return var;
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) WorkbenchView(org.eclipse.reddeer.workbench.impl.view.WorkbenchView) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)1 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)1 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)1 WorkbenchView (org.eclipse.reddeer.workbench.impl.view.WorkbenchView)1