org.fest.swing.driver
Class JPopupMenuDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
org.fest.swing.driver.JPopupMenuDriver
public class JPopupMenuDriver
- extends JComponentDriver
Understands functional testing of JPopupMenu
s:
- user input simulation
- state verification
- property value query
This class is intended for internal use only. Please use the classes in the package
org.fest.swing.fixture
in your tests.
- Author:
- Yvonne Wang, Alex Ruiz
Methods inherited from class org.fest.swing.driver.ComponentDriver |
assertIsEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JPopupMenuDriver
public JPopupMenuDriver(Robot robot)
- Creates a new
JPopupMenuDriver
.
- Parameters:
robot
- the robot to use to simulate user input.
menuLabelsOf
@RunsInEDT
public String[] menuLabelsOf(JPopupMenu popupMenu)
- Returns the contents of the pop-up menu as a
String
array.
- Parameters:
popupMenu
- the target JPopupMenu
.
- Returns:
- the contents of the pop-up menu as a
String
array.
menuItem
@RunsInEDT
public JMenuItem menuItem(JPopupMenu popupMenu,
String name)
- Finds a
JMenuItem
, contained in the Container
, which name matches
the specified one.
- Parameters:
popupMenu
- the target JPopupMenu
.name
- the name to match.
- Returns:
- the
JMenuItem
found.
- Throws:
ComponentLookupException
- if a JMenuItem
having a matching name could not be found.
ComponentLookupException
- if more than one JMenuItem
having a matching name is found.
menuItem
public JMenuItem menuItem(JPopupMenu popupMenu,
GenericTypeMatcher<? extends JMenuItem> matcher)
- Finds a
JMenuItem
, contained in the Container
, that matches the
specified search criteria.
- Parameters:
popupMenu
- the target JPopupMenu
.matcher
- contains the search criteria for finding a JMenuItem
.
- Returns:
- the
JMenuItem
found.
- Throws:
ComponentLookupException
- if a JMenuItem
that matches the given search criteria could not be
found.
ComponentLookupException
- if more than one JMenuItem
that matches the given search criteria
is found.
Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.