public class JPanelFixture extends AbstractContainerFixture<JPanelFixture,JPanel,JComponentDriver> implements JComponentFixture<JPanelFixture>, JPopupMenuInvokerFixture
JPanel
s.BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY
Constructor and Description |
---|
JPanelFixture(Robot robot,
JPanel target)
Creates a new
JPanelFixture . |
JPanelFixture(Robot robot,
String panelName)
Creates a new
JPanelFixture . |
Modifier and Type | Method and Description |
---|---|
Object |
clientProperty(Object key)
Returns the client property stored in this fixture's
JPanel , under the given key. |
protected JComponentDriver |
createDriver(Robot robot) |
JPanelFixture |
requireToolTip(Pattern pattern)
Asserts that the toolTip in this fixture's
JPanel matches the given regular expression pattern. |
JPanelFixture |
requireToolTip(String expected)
Asserts that the toolTip in this fixture's
JPanel matches the given value. |
JPopupMenuFixture |
showPopupMenu()
Shows a pop-up menu using this fixture's
JPanel as the invoker of the pop-up menu. |
JPopupMenuFixture |
showPopupMenuAt(Point p)
Shows a pop-up menu at the given point using this fixture's
JPanel as the invoker of the pop-up menu. |
button, button, button, checkBox, checkBox, checkBox, comboBox, comboBox, comboBox, defaultDialogLookupTimeout, dialog, dialog, dialog, dialog, dialog, dialog, fileChooser, fileChooser, fileChooser, fileChooser, fileChooser, fileChooser, find, findByName, findByType, finder, internalFrame, internalFrame, internalFrame, label, label, label, list, list, list, menuItem, menuItem, menuItemWithPath, optionPane, optionPane, panel, panel, panel, progressBar, progressBar, progressBar, radioButton, radioButton, radioButton, scrollBar, scrollBar, scrollBar, scrollPane, scrollPane, scrollPane, slider, slider, slider, spinner, spinner, spinner, splitPane, splitPane, splitPane, tabbedPane, tabbedPane, tabbedPane, table, table, table, textBox, textBox, textBox, toggleButton, toggleButton, toggleButton, toolBar, toolBar, toolBar, tree, tree, tree, with
background, click, click, click, doubleClick, driver, drop, equals, focus, font, foreground, hashCode, isEnabled, myself, pressAndReleaseKey, pressAndReleaseKeys, pressKey, pressKeyWhileRunning, releaseKey, replaceDriverWith, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireShowing, requireVisible, rightClick, robot, target, targetCastedTo
public JPanelFixture(@Nonnull Robot robot, @Nonnull String panelName)
JPanelFixture
.robot
- performs simulation of user events on a JPanel
.panelName
- the name of the JPanel
to find using the given Robot
.NullPointerException
- if robot
is null
.ComponentLookupException
- if a matching JPanel
could not be found.ComponentLookupException
- if more than one matching JPanel
is found.public JPanelFixture(@Nonnull Robot robot, @Nonnull JPanel target)
JPanelFixture
.robot
- performs simulation of user events on the given JPanel
.target
- the JPanel
to be managed by this fixture.NullPointerException
- if robot
is null
.NullPointerException
- if target
is null
.@Nonnull protected JComponentDriver createDriver(@Nonnull Robot robot)
createDriver
in class AbstractComponentFixture<JPanelFixture,JPanel,JComponentDriver>
@Nonnull public JPanelFixture requireToolTip(@Nullable String expected)
JPanel
matches the given value.requireToolTip
in interface JComponentFixture<JPanelFixture>
expected
- the given value. It can be a regular expression.AssertionError
- if the toolTip in this fixture's JPanel
does not match the given value.@Nonnull public JPanelFixture requireToolTip(@Nonnull Pattern pattern)
JPanel
matches the given regular expression pattern.requireToolTip
in interface JComponentFixture<JPanelFixture>
pattern
- the regular expression pattern to match.NullPointerException
- if the given regular expression pattern is null
.AssertionError
- if the toolTip in this fixture's JPanel
does not match the given regular expression.@Nullable public Object clientProperty(@Nonnull Object key)
JPanel
, under the given key.clientProperty
in interface JComponentFixture<JPanelFixture>
key
- the key to use to retrieve the client property.null
if the property was not found.NullPointerException
- if the given key is null
.@Nonnull public JPopupMenuFixture showPopupMenu()
JPanel
as the invoker of the pop-up menu.showPopupMenu
in interface JPopupMenuInvokerFixture
IllegalStateException
- if Settings.clickOnDisabledComponentsAllowed()
is false
and this
fixture's JPanel
is disabled.IllegalStateException
- if this fixture's JPanel
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.@Nonnull public JPopupMenuFixture showPopupMenuAt(@Nonnull Point p)
JPanel
as the invoker of the pop-up menu.showPopupMenuAt
in interface JPopupMenuInvokerFixture
p
- the given point where to show the pop-up menu.IllegalStateException
- if Settings.clickOnDisabledComponentsAllowed()
is false
and this
fixture's JPanel
is disabled.IllegalStateException
- if this fixture's JPanel
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.Copyright © 2014–2019 AssertJ. All rights reserved.