@InternalApi public class JMenuItemDriver extends JComponentDriver
Supports functional testing of JMenuItem
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 |
---|
JMenuItemDriver(Robot robot)
Creates a new
JMenuItemDriver . |
Modifier and Type | Method and Description |
---|---|
void |
click(Component c)
Simulates a user clicking once the given AWT or Swing
Component using the left mouse button. |
void |
click(JMenuItem menuItem)
Finds and selects the given
JMenuItem . |
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisible
doResizeHeight, doResizeWidth, isResizable, move, resize
backgroundOf, checkClickAllowed, checkInEdtEnabledAndShowing, checkInEdtShowing, 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 JMenuItemDriver(@Nonnull Robot robot)
JMenuItemDriver
.robot
- the robot to use to simulate user input.public void click(Component c)
ComponentDriver
Component
using the left mouse button.click
in class ComponentDriver
c
- the Component
to click on.@RunsInEDT public void click(@Nonnull JMenuItem menuItem)
JMenuItem
.menuItem
- the JMenuItem
to select.IllegalStateException
- if Settings.clickOnDisabledComponentsAllowed()
is false
and the
menu to select is disabled.IllegalStateException
- if the menu to select is not showing on the screen.ActionFailedException
- if the menu has a pop-up and it fails to show up.Copyright © 2014–2019 AssertJ. All rights reserved.