* @param matcher a matcher.
* @return a widget within the parent widget that matches the specified matcher.
* @throws WorkbenchPartNotActiveException if the part is not the active part.
*/
protected Widget findWidget(Matcher<?> matcher) {
Finder finder = bot.getFinder();
Control control = ((WorkbenchPartReference) partReference).getPane().getControl();
boolean shouldFindInvisibleControls = finder.shouldFindInvisibleControls();
finder.setShouldFindInvisibleControls(true);
try {
return bot.widget(matcher, control);
} catch (Exception e) {
throw new WidgetNotFoundException("Could not find any control inside the view " + partReference.getPartName(), e); //$NON-NLS-1$
} finally {
finder.setShouldFindInvisibleControls(shouldFindInvisibleControls);
}
}