forked from srizzo/code2code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigureParamsDialog.java
More file actions
53 lines (43 loc) · 1.39 KB
/
ConfigureParamsDialog.java
File metadata and controls
53 lines (43 loc) · 1.39 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
package pageobjects;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.StringResult;
import utils.Driver;
public class ConfigureParamsDialog {
public static boolean isVisible() {
try {
Driver.bot().label("Configure Params");
} catch (WidgetNotFoundException e) {
return false;
}
return true;
}
public static boolean isListed(String param) {
try {
Driver.bot().textWithLabel(param);
} catch (WidgetNotFoundException e) {
return false;
}
return true;
}
public static String getParamValue(String param) throws Exception {
return Driver.bot().textWithLabel(param).getText();
}
public static void clickNext() throws Exception {
Driver.bot().button("Next >").click();
}
public static void setParam(String param, String value) throws Exception {
Driver.bot().textWithLabel(param).setText(value);
}
public static String getDescription() throws Exception {
return UIThreadRunnable.syncExec(Driver.bot().activeShell().widget.getDisplay(), new StringResult(){
public String run() {
try {
return ((WizardDialog)Driver.bot().activeShell().widget.getData()).getCurrentPage().getDescription();
} catch (WidgetNotFoundException e) {
throw new RuntimeException(e);
}
}});
}
}