|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swtbot.swt.finder.finders.Finder
public class Finder
A wrapper around ControlFinder
and MenuFinder
that delegates to either of them.
Constructor Summary | |
---|---|
Finder(ControlFinder controlFinder,
MenuFinder menuFinder)
Constructs the finder with the given control and menu finder. |
|
Finder(Finder finder,
MenuFinder menuFinder)
Establishes the finder from an existing finder (control finder only) and the given new menu finder. |
Method Summary | ||
---|---|---|
Shell |
activeShell()
Gets the currently active shell. |
|
|
findControls(List<Widget> children,
Matcher<T> matcher,
boolean recursive)
Finds the controls matching one of the widgets using the given matcher. |
|
|
findControls(Matcher<T> matcher)
Finds the controls in the active shell matching the given matcher. |
|
|
findControls(Widget widget,
Matcher<T> matcher,
boolean recursive)
Finds the controls starting with the given parent widget and uses the given matcher. |
|
List<MenuItem> |
findMenus(Matcher<MenuItem> matcher)
Finds a menu matching the given item in all available shells. |
|
List<MenuItem> |
findMenus(Menu bar,
Matcher<MenuItem> matcher,
boolean recursive)
Fins all the menus in the given menu bar matching the given matcher. |
|
List<MenuItem> |
findMenus(Shell[] shells,
Matcher<MenuItem> matcher,
boolean recursive)
Finds all the menus using the given matcher in the set of shells provided. |
|
List<MenuItem> |
findMenus(Shell shell,
Matcher<MenuItem> matcher,
boolean recursive)
Finds the menus in the given shell using the given matcher. |
|
List<Shell> |
findShells(String text)
Finds the shell matching the given text (shell.getText()). |
|
Display |
getDisplay()
Gets the display that has been set. |
|
TreePath |
getPath(Widget w)
Gets the path to the widget. |
|
Shell[] |
getShells()
Gets the shells registered with the display. |
|
void |
setShouldFindInvisibleControls(boolean shouldFindInVisibleControls)
This sets the flag to know if items should be returned if they are not visible. |
|
boolean |
shouldFindInvisibleControls()
Checks if this should return items that are not visible when performing the search for controls. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Finder(ControlFinder controlFinder, MenuFinder menuFinder)
controlFinder
- the finder that finds controls.menuFinder
- the finder that finds menus.public Finder(Finder finder, MenuFinder menuFinder)
finder
- the findermenuFinder
- the finder that finds menus.Method Detail |
---|
public Shell activeShell()
ControlFinder.activeShell()
public <T extends Widget> List<T> findControls(Matcher<T> matcher)
This method is thread safe.
matcher
- the matcher used to find controls in the active shell.
ControlFinder.findControls(Matcher)
public <T extends Widget> List<T> findControls(List<Widget> children, Matcher<T> matcher, boolean recursive)
children
widget if they exist.
children
- the list of widgets.matcher
- the matcher used to match the widgets.recursive
- if the match should be recursive.
true
then find
the widgets within each of the widget.ControlFinder.findControls(List, Matcher, boolean)
public <T extends Widget> List<T> findControls(Widget widget, Matcher<T> matcher, boolean recursive)
This method is thread safe.
widget
- the parent widget in which controls should be found.matcher
- the matcher used to match the widgets.recursive
- if the match should be recursive.
true
then
find the widget within each of the parentWidget.ControlFinder.findControls(Widget, Matcher, boolean)
public List<Shell> findShells(String text)
text
- The text on the Shell
ControlFinder.findShells(String)
public Shell[] getShells()
ControlFinder.getShells()
public List<MenuItem> findMenus(Matcher<MenuItem> matcher)
matcher
- the matcher that can match menus and menu items.
MenuFinder.findMenus(Matcher)
public List<MenuItem> findMenus(Menu bar, Matcher<MenuItem> matcher, boolean recursive)
bar
- the menu barmatcher
- the matcher that can match menus and menu items.recursive
- if set to true, will find sub-menus as well.
MenuFinder.findMenus(Menu, Matcher, boolean)
public List<MenuItem> findMenus(Shell shell, Matcher<MenuItem> matcher, boolean recursive)
shell
- the shell to probe for menus.matcher
- the matcher that can match menus and menu items.recursive
- if set to true, will find sub-menus as well.
MenuFinder.findMenus(Shell, Matcher, boolean)
public List<MenuItem> findMenus(Shell[] shells, Matcher<MenuItem> matcher, boolean recursive)
shells
- the shells to probe for menus.matcher
- the matcher that can match menus and menu items.recursive
- if set to true, will find sub-menus as well.
MenuFinder.findMenus(Shell[], Matcher, boolean)
public boolean shouldFindInvisibleControls()
true
if the finder should return items that are not visible. Otherwise false
is
returned to show no items will be returned if they are not visible.public void setShouldFindInvisibleControls(boolean shouldFindInVisibleControls)
shouldFindInVisibleControls
- true
to cause controls that are not visible to be found. Use
false so that controls that are visible will be returned.public Display getDisplay()
public TreePath getPath(Widget w)
w
- the widget.
ControlFinder.getPath(Widget)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |