Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
WaitForWidgetInParent |
|
| 1.0;1 |
1 | /******************************************************************************* | |
2 | * Copyright (c) 2008 Ketan Padegaonkar and others. | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * Ketan Padegaonkar - initial API and implementation | |
10 | *******************************************************************************/ | |
11 | package org.eclipse.swtbot.swt.finder.waits; | |
12 | ||
13 | import java.util.List; | |
14 | ||
15 | import org.eclipse.swt.widgets.Widget; | |
16 | import org.hamcrest.Matcher; | |
17 | ||
18 | /** | |
19 | * @author Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com> | |
20 | * @see Conditions | |
21 | * @version $Id$ | |
22 | * @since 2.0 | |
23 | */ | |
24 | class WaitForWidgetInParent<T extends Widget> extends WaitForObjectCondition<T> { | |
25 | ||
26 | private final Widget parent; | |
27 | ||
28 | WaitForWidgetInParent(Matcher<T> matcher, Widget parent) { | |
29 | 13 | super(matcher); |
30 | 13 | this.parent = parent; |
31 | 13 | } |
32 | ||
33 | public String getFailureMessage() { | |
34 | 1 | return "Could not find widget matching: " + matcher; //$NON-NLS-1$ |
35 | } | |
36 | ||
37 | protected List<T> findMatches() { | |
38 | 23 | return bot.getFinder().findControls(parent, matcher, true); |
39 | } | |
40 | ||
41 | } |