@InternalApi public class JPopupMenuDriver extends JComponentDriver
Supports functional testing of JPopupMenu
s.
Note: This class is intended for internal use only. Please use the classes in the package
org.assertj.swing.fixture
in your tests.
robot
Constructor and Description |
---|
JPopupMenuDriver(Robot robot)
Creates a new
JPopupMenuDriver . |
Modifier and Type | Method and Description |
---|---|
JMenuItem |
menuItem(JPopupMenu popupMenu,
GenericTypeMatcher<? extends JMenuItem> matcher)
Finds a
JMenuItem , contained in the Container , that matches the specified search criteria. |
JMenuItem |
menuItem(JPopupMenu popupMenu,
String name)
Finds a
JMenuItem , contained in the Container , which name matches the specified one. |
String[] |
menuLabelsOf(JPopupMenu popupMenu)
Returns the contents of the pop-up menu as a
String array. |
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisible
doResizeHeight, doResizeWidth, isResizable, move, resize
backgroundOf, checkClickAllowed, checkInEdtEnabledAndShowing, checkInEdtShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, drop, focus, focusAndWaitForFocusGain, fontOf, foregroundOf, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, pressKeyWhileRunning, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
public JPopupMenuDriver(@Nonnull Robot robot)
JPopupMenuDriver
.robot
- the robot to use to simulate user input.@RunsInEDT @Nonnull public String[] menuLabelsOf(@Nonnull JPopupMenu popupMenu)
String
array.popupMenu
- the target JPopupMenu
.String
array.@RunsInEDT @Nonnull public JMenuItem menuItem(@Nonnull JPopupMenu popupMenu, @Nullable String name)
JMenuItem
, contained in the Container
, which name matches the specified one.popupMenu
- the target JPopupMenu
.name
- the name to match.JMenuItem
found.ComponentLookupException
- if a JMenuItem
having a matching name could
not be found.ComponentLookupException
- if more than one JMenuItem
having a matching
name is found.@Nonnull public JMenuItem menuItem(@Nonnull JPopupMenu popupMenu, @Nonnull GenericTypeMatcher<? extends JMenuItem> matcher)
JMenuItem
, contained in the Container
, that matches the specified search criteria.popupMenu
- the target JPopupMenu
.matcher
- contains the search criteria for finding a JMenuItem
.JMenuItem
found.ComponentLookupException
- if a JMenuItem
that matches the given search
criteria could not be found. Or if more than one JMenuItem
that matches the given search criteria
is found.Copyright © 2014–2019 AssertJ. All rights reserved.