public class JSpinnerFixture extends AbstractJPopupMenuInvokerFixture<JSpinnerFixture,JSpinner,JSpinnerDriver>
JSpinner
s:BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY
Constructor and Description |
---|
JSpinnerFixture(Robot robot,
JSpinner target)
Creates a new
JSpinnerFixture . |
JSpinnerFixture(Robot robot,
String spinnerName)
Creates a new
JSpinnerFixture . |
Modifier and Type | Method and Description |
---|---|
protected JSpinnerDriver |
createDriver(Robot robot) |
JSpinnerFixture |
decrement()
Simulates a user decrementing the value of this fixture's
JSpinner one time. |
JSpinnerFixture |
decrement(int times)
Simulates a user decrementing the value of this fixture's
JSpinner the given number of times. |
JSpinnerFixture |
enterText(String text)
Simulates a user entering the given text in this fixture's
JSpinner (assuming its editor has a
JTextComponent under it). |
JSpinnerFixture |
enterTextAndCommit(String text)
Simulates a user entering and committing the given text in this fixture's
JSpinner (assuming its editor has
a JTextComponent under it). |
JSpinnerFixture |
increment()
Simulates a user incrementing the value of this fixture's
JSpinner one time. |
JSpinnerFixture |
increment(int times)
Simulates a user incrementing the value of this fixture's
JSpinner the given number of times. |
JSpinnerFixture |
requireValue(Object value)
Verifies that the value of this fixture's
JSpinner is equal to the given one. |
JSpinnerFixture |
select(Object value)
Selects the given value in this fixture's
JSpinner . |
String |
text()
Returns the text displayed by this fixture's
JSpinner . |
showPopupMenu, showPopupMenuAt
clientProperty, requireToolTip, requireToolTip
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 JSpinnerFixture(@Nonnull Robot robot, @Nullable String spinnerName)
JSpinnerFixture
.robot
- performs simulation of user events on a JSpinner
.spinnerName
- the name of the JSpinner
to find using the given Robot
.NullPointerException
- if robot
is null
.ComponentLookupException
- if a matching JSpinner
could not be found.ComponentLookupException
- if more than one matching JSpinner
is found.public JSpinnerFixture(@Nonnull Robot robot, @Nonnull JSpinner target)
JSpinnerFixture
.robot
- performs simulation of user events on the given JSpinner
.target
- the JSpinner
to be managed by this fixture.NullPointerException
- if robot
is null
.NullPointerException
- if target
is null
.@Nonnull protected JSpinnerDriver createDriver(@Nonnull Robot robot)
createDriver
in class AbstractComponentFixture<JSpinnerFixture,JSpinner,JSpinnerDriver>
@Nonnull public JSpinnerFixture increment(int times)
JSpinner
the given number of times.times
- how many times the value of this fixture's JSpinner
should be incremented.IllegalArgumentException
- if times
is less than or equal to zero.IllegalStateException
- if this fixture's JSpinner
is disabled.IllegalStateException
- if this fixture's JSpinner
is not showing on the screen.@Nonnull public JSpinnerFixture increment()
JSpinner
one time.IllegalStateException
- if this fixture's JSpinner
is disabled.IllegalStateException
- if this fixture's JSpinner
is not showing on the screen.@Nonnull public JSpinnerFixture decrement(int times)
JSpinner
the given number of times.times
- how many times the value of this fixture's JSpinner
should be decremented.IllegalArgumentException
- if times
is less than or equal to zero.IllegalStateException
- if this fixture's JSpinner
is disabled.IllegalStateException
- if this fixture's JSpinner
is not showing on the screen.@Nonnull public JSpinnerFixture decrement()
JSpinner
one time.IllegalStateException
- if this fixture's JSpinner
is disabled.IllegalStateException
- if this fixture's JSpinner
is not showing on the screen.@Nonnull public JSpinnerFixture enterText(@Nonnull String text)
JSpinner
(assuming its editor has a
JTextComponent
under it). This method does not commit the value to the JSpinner
.text
- the text to enter.IllegalStateException
- if this fixture's JSpinner
is disabled.IllegalStateException
- if this fixture's JSpinner
is not showing on the screen.ActionFailedException
- if the editor of the JSpinner
is not a JTextComponent
or cannot be
found.UnexpectedException
- if the entering the text in the JSpinner
's editor fails.@Nonnull public JSpinnerFixture enterTextAndCommit(String text)
JSpinner
(assuming its editor has
a JTextComponent
under it).text
- the text to enter.IllegalStateException
- if this fixture's JSpinner
is disabled.IllegalStateException
- if this fixture's JSpinner
is not showing on the screen.ActionFailedException
- if the editor of the JSpinner
is not a JTextComponent
or cannot be
found.UnexpectedException
- if the entering the text in the JSpinner
's editor fails.public JSpinnerFixture select(@Nonnull Object value)
JSpinner
.value
- the value to select.IllegalStateException
- if this fixture's JSpinner
is disabled.IllegalStateException
- if this fixture's JSpinner
is not showing on the screen.IllegalArgumentException
- if the JSpinner
does not support the specified value
.@Nonnull public JSpinnerFixture requireValue(@Nonnull Object value)
JSpinner
is equal to the given one.value
- the expected value of this fixture's JSpinner
.AssertionError
- if the value of this fixture's JSpinner
is not equal to the given one.@Nullable public String text()
JSpinner
. This method first tries to get the text displayed in
the JSpinner
's editor, assuming it is a JTextComponent
. If the text from the editor cannot be
retrieved, it will return the String
representation of the value in the JSpinner
's model.JSpinner
.Copyright © 2014–2019 AssertJ. All rights reserved.