Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
SWTFormsBot |
|
| 1.0;1 |
1 | // Generated source. DO NOT MODIFY. | |
2 | // To add new widgets, please see README file in the generator plugin. | |
3 | package org.eclipse.swtbot.forms.finder; | |
4 | ||
5 | ||
6 | import org.eclipse.swt.widgets.Widget; | |
7 | import org.eclipse.swtbot.forms.finder.widgets.SWTBotHyperlink; | |
8 | import org.eclipse.swtbot.forms.finder.widgets.SWTBotImageHyperlink; | |
9 | import org.eclipse.swtbot.swt.finder.SWTBot; | |
10 | import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; | |
11 | import org.eclipse.swtbot.swt.finder.finders.ChildrenControlFinder; | |
12 | import org.eclipse.swtbot.swt.finder.finders.ControlFinder; | |
13 | import org.eclipse.swtbot.swt.finder.finders.Finder; | |
14 | import org.eclipse.swtbot.swt.finder.finders.MenuFinder; | |
15 | import org.eclipse.ui.forms.widgets.Hyperlink; | |
16 | import org.eclipse.ui.forms.widgets.ImageHyperlink; | |
17 | import org.hamcrest.Matcher; | |
18 | import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf; | |
19 | import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.inGroup; | |
20 | import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType; | |
21 | import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withId; | |
22 | import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic; | |
23 | ||
24 | ||
25 | /** | |
26 | * SWTFormsBot is a {@link SWTBot} with capabilities for testing eclipse forms. | |
27 | * | |
28 | * @see {@link SWTBot} - SWTBot for usage examples. | |
29 | */ | |
30 | public class SWTFormsBot extends SWTBot { | |
31 | ||
32 | /** | |
33 | * Constructs a bot. | |
34 | */ | |
35 | public SWTFormsBot() { | |
36 | 1 | this(new ControlFinder(), new MenuFinder()); |
37 | 1 | } |
38 | ||
39 | /** | |
40 | * Constructs a bot that will match the contents of the given parentWidget. | |
41 | * | |
42 | * @param parent the parent | |
43 | */ | |
44 | public SWTFormsBot(Widget parent) { | |
45 | 0 | this(new ChildrenControlFinder(parent), new MenuFinder()); |
46 | 0 | } |
47 | /** | |
48 | * Constructs an instance of the bot using the given control finder and menu finder. | |
49 | * | |
50 | * @param controlFinder the {@link ControlFinder} used to identify and find controls. | |
51 | * @param menuFinder the {@link MenuFinder} used to find menu items. | |
52 | */ | |
53 | public SWTFormsBot(ControlFinder controlFinder, MenuFinder menuFinder) { | |
54 | 1 | this(new Finder(controlFinder, menuFinder)); |
55 | 1 | } |
56 | ||
57 | /** | |
58 | * Constructs a bot with the given finder. | |
59 | * | |
60 | * @param finder the finder. | |
61 | */ | |
62 | public SWTFormsBot(Finder finder) { | |
63 | 1 | super(finder); |
64 | 1 | } |
65 | ||
66 | /** | |
67 | * @param mnemonicText the mnemonicText on the widget. | |
68 | * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code>. | |
69 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
70 | */ | |
71 | public SWTBotHyperlink hyperlink(String mnemonicText) { | |
72 | 1 | return hyperlink(mnemonicText, 0); |
73 | } | |
74 | ||
75 | /** | |
76 | * @param mnemonicText the mnemonicText on the widget. | |
77 | * @param index the index of the widget. | |
78 | * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code>. | |
79 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
80 | */ | |
81 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
82 | public SWTBotHyperlink hyperlink(String mnemonicText, int index) { | |
83 | 1 | Matcher matcher = allOf(widgetOfType(Hyperlink.class), withMnemonic(mnemonicText)); |
84 | 1 | return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher); |
85 | } | |
86 | ||
87 | /** | |
88 | * @param key the key set on the widget. | |
89 | * @param value the value for the key. | |
90 | * @return a {@link SWTBotHyperlink} with the specified <code>key/value</code>. | |
91 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
92 | */ | |
93 | public SWTBotHyperlink hyperlinkWithId(String key, String value) { | |
94 | 0 | return hyperlinkWithId(key, value, 0); |
95 | } | |
96 | ||
97 | /** | |
98 | * @param key the key set on the widget. | |
99 | * @param value the value for the key. | |
100 | * @param index the index of the widget. | |
101 | * @return a {@link SWTBotHyperlink} with the specified <code>key/value</code>. | |
102 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
103 | */ | |
104 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
105 | public SWTBotHyperlink hyperlinkWithId(String key, String value, int index) { | |
106 | 0 | Matcher matcher = allOf(widgetOfType(Hyperlink.class), withId(key, value)); |
107 | 0 | return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher); |
108 | } | |
109 | ||
110 | /** | |
111 | * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}. | |
112 | * @return a {@link SWTBotHyperlink} with the specified <code>value</code>. | |
113 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
114 | */ | |
115 | public SWTBotHyperlink hyperlinkWithId(String value) { | |
116 | 0 | return hyperlinkWithId(value, 0); |
117 | } | |
118 | ||
119 | /** | |
120 | * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}. | |
121 | * @param index the index of the widget. | |
122 | * @return a {@link SWTBotHyperlink} with the specified <code>value</code>. | |
123 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
124 | */ | |
125 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
126 | public SWTBotHyperlink hyperlinkWithId(String value, int index) { | |
127 | 0 | Matcher matcher = allOf(widgetOfType(Hyperlink.class), withId(value)); |
128 | 0 | return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher); |
129 | } | |
130 | ||
131 | /** | |
132 | * @param inGroup the inGroup on the widget. | |
133 | * @return a {@link SWTBotHyperlink} with the specified <code>inGroup</code>. | |
134 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
135 | */ | |
136 | public SWTBotHyperlink hyperlinkInGroup(String inGroup) { | |
137 | 0 | return hyperlinkInGroup(inGroup, 0); |
138 | } | |
139 | ||
140 | /** | |
141 | * @param inGroup the inGroup on the widget. | |
142 | * @param index the index of the widget. | |
143 | * @return a {@link SWTBotHyperlink} with the specified <code>inGroup</code>. | |
144 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
145 | */ | |
146 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
147 | public SWTBotHyperlink hyperlinkInGroup(String inGroup, int index) { | |
148 | 0 | Matcher matcher = allOf(widgetOfType(Hyperlink.class), inGroup(inGroup)); |
149 | 0 | return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher); |
150 | } | |
151 | ||
152 | /** | |
153 | * @return a {@link SWTBotHyperlink} with the specified <code>none</code>. | |
154 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
155 | */ | |
156 | public SWTBotHyperlink hyperlink() { | |
157 | 0 | return hyperlink(0); |
158 | } | |
159 | ||
160 | /** | |
161 | * @param index the index of the widget. | |
162 | * @return a {@link SWTBotHyperlink} with the specified <code>none</code>. | |
163 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
164 | */ | |
165 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
166 | public SWTBotHyperlink hyperlink(int index) { | |
167 | 0 | Matcher matcher = allOf(widgetOfType(Hyperlink.class)); |
168 | 0 | return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher); |
169 | } | |
170 | ||
171 | /** | |
172 | * @param mnemonicText the mnemonicText on the widget. | |
173 | * @param inGroup the inGroup on the widget. | |
174 | * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code> with the specified <code>inGroup</code>. | |
175 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
176 | */ | |
177 | public SWTBotHyperlink hyperlinkInGroup(String mnemonicText, String inGroup) { | |
178 | 0 | return hyperlinkInGroup(mnemonicText, inGroup, 0); |
179 | } | |
180 | ||
181 | /** | |
182 | * @param mnemonicText the mnemonicText on the widget. | |
183 | * @param inGroup the inGroup on the widget. | |
184 | * @param index the index of the widget. | |
185 | * @return a {@link SWTBotHyperlink} with the specified <code>mnemonicText</code> with the specified <code>inGroup</code>. | |
186 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
187 | */ | |
188 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
189 | public SWTBotHyperlink hyperlinkInGroup(String mnemonicText, String inGroup, int index) { | |
190 | 0 | Matcher matcher = allOf(widgetOfType(Hyperlink.class), withMnemonic(mnemonicText), inGroup(inGroup)); |
191 | 0 | return new SWTBotHyperlink((Hyperlink) widget(matcher, index), matcher); |
192 | } | |
193 | ||
194 | /** | |
195 | * @param mnemonicText the mnemonicText on the widget. | |
196 | * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code>. | |
197 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
198 | */ | |
199 | public SWTBotImageHyperlink imageHyperlink(String mnemonicText) { | |
200 | 2 | return imageHyperlink(mnemonicText, 0); |
201 | } | |
202 | ||
203 | /** | |
204 | * @param mnemonicText the mnemonicText on the widget. | |
205 | * @param index the index of the widget. | |
206 | * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code>. | |
207 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
208 | */ | |
209 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
210 | public SWTBotImageHyperlink imageHyperlink(String mnemonicText, int index) { | |
211 | 2 | Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withMnemonic(mnemonicText)); |
212 | 2 | return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher); |
213 | } | |
214 | ||
215 | /** | |
216 | * @param key the key set on the widget. | |
217 | * @param value the value for the key. | |
218 | * @return a {@link SWTBotImageHyperlink} with the specified <code>key/value</code>. | |
219 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
220 | */ | |
221 | public SWTBotImageHyperlink imageHyperlinkWithId(String key, String value) { | |
222 | 0 | return imageHyperlinkWithId(key, value, 0); |
223 | } | |
224 | ||
225 | /** | |
226 | * @param key the key set on the widget. | |
227 | * @param value the value for the key. | |
228 | * @param index the index of the widget. | |
229 | * @return a {@link SWTBotImageHyperlink} with the specified <code>key/value</code>. | |
230 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
231 | */ | |
232 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
233 | public SWTBotImageHyperlink imageHyperlinkWithId(String key, String value, int index) { | |
234 | 0 | Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withId(key, value)); |
235 | 0 | return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher); |
236 | } | |
237 | ||
238 | /** | |
239 | * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}. | |
240 | * @return a {@link SWTBotImageHyperlink} with the specified <code>value</code>. | |
241 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
242 | */ | |
243 | public SWTBotImageHyperlink imageHyperlinkWithId(String value) { | |
244 | 0 | return imageHyperlinkWithId(value, 0); |
245 | } | |
246 | ||
247 | /** | |
248 | * @param value the value for the key {@link org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#DEFAULT_KEY}. | |
249 | * @param index the index of the widget. | |
250 | * @return a {@link SWTBotImageHyperlink} with the specified <code>value</code>. | |
251 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
252 | */ | |
253 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
254 | public SWTBotImageHyperlink imageHyperlinkWithId(String value, int index) { | |
255 | 0 | Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withId(value)); |
256 | 0 | return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher); |
257 | } | |
258 | ||
259 | /** | |
260 | * @param inGroup the inGroup on the widget. | |
261 | * @return a {@link SWTBotImageHyperlink} with the specified <code>inGroup</code>. | |
262 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
263 | */ | |
264 | public SWTBotImageHyperlink imageHyperlinkInGroup(String inGroup) { | |
265 | 0 | return imageHyperlinkInGroup(inGroup, 0); |
266 | } | |
267 | ||
268 | /** | |
269 | * @param inGroup the inGroup on the widget. | |
270 | * @param index the index of the widget. | |
271 | * @return a {@link SWTBotImageHyperlink} with the specified <code>inGroup</code>. | |
272 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
273 | */ | |
274 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
275 | public SWTBotImageHyperlink imageHyperlinkInGroup(String inGroup, int index) { | |
276 | 0 | Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), inGroup(inGroup)); |
277 | 0 | return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher); |
278 | } | |
279 | ||
280 | /** | |
281 | * @return a {@link SWTBotImageHyperlink} with the specified <code>none</code>. | |
282 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
283 | */ | |
284 | public SWTBotImageHyperlink imageHyperlink() { | |
285 | 0 | return imageHyperlink(0); |
286 | } | |
287 | ||
288 | /** | |
289 | * @param index the index of the widget. | |
290 | * @return a {@link SWTBotImageHyperlink} with the specified <code>none</code>. | |
291 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
292 | */ | |
293 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
294 | public SWTBotImageHyperlink imageHyperlink(int index) { | |
295 | 0 | Matcher matcher = allOf(widgetOfType(ImageHyperlink.class)); |
296 | 0 | return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher); |
297 | } | |
298 | ||
299 | /** | |
300 | * @param mnemonicText the mnemonicText on the widget. | |
301 | * @param inGroup the inGroup on the widget. | |
302 | * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code> with the specified <code>inGroup</code>. | |
303 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
304 | */ | |
305 | public SWTBotImageHyperlink imageHyperlinkInGroup(String mnemonicText, String inGroup) { | |
306 | 0 | return imageHyperlinkInGroup(mnemonicText, inGroup, 0); |
307 | } | |
308 | ||
309 | /** | |
310 | * @param mnemonicText the mnemonicText on the widget. | |
311 | * @param inGroup the inGroup on the widget. | |
312 | * @param index the index of the widget. | |
313 | * @return a {@link SWTBotImageHyperlink} with the specified <code>mnemonicText</code> with the specified <code>inGroup</code>. | |
314 | * @throws WidgetNotFoundException if the widget is not found or is disposed. | |
315 | */ | |
316 | @SuppressWarnings({"unchecked", "rawtypes"}) | |
317 | public SWTBotImageHyperlink imageHyperlinkInGroup(String mnemonicText, String inGroup, int index) { | |
318 | 0 | Matcher matcher = allOf(widgetOfType(ImageHyperlink.class), withMnemonic(mnemonicText), inGroup(inGroup)); |
319 | 0 | return new SWTBotImageHyperlink((ImageHyperlink) widget(matcher, index), matcher); |
320 | } | |
321 | ||
322 | ||
323 | ||
324 | } |