Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
WidgetIsEnabledCondition |
|
| 1.0;1 |
1 | /******************************************************************************* | |
2 | * Copyright (c) 2010 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 org.eclipse.swt.widgets.Widget; | |
14 | import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot; | |
15 | ||
16 | class WidgetIsEnabledCondition extends DefaultCondition { | |
17 | ||
18 | private final AbstractSWTBot<? extends Widget> widget; | |
19 | ||
20 | 1954 | WidgetIsEnabledCondition(AbstractSWTBot<? extends Widget> widget) { |
21 | 1954 | this.widget = widget; |
22 | 1954 | } |
23 | ||
24 | public boolean test() throws Exception { | |
25 | 1954 | return widget.isEnabled(); |
26 | } | |
27 | ||
28 | public String getFailureMessage() { | |
29 | 0 | return "The widget " + widget + " was not enabled."; |
30 | } | |
31 | ||
32 | } |