public class JSpinnerDriver extends JComponentDriver
JSpinners:
org.fest.swing.fixture in your tests.robot| Constructor and Description |
|---|
JSpinnerDriver(Robot robot)
Creates a new
JSpinnerDriver. |
| Modifier and Type | Method and Description |
|---|---|
void |
decrement(JSpinner spinner)
Decrements the value of the
. |
void |
decrement(JSpinner spinner,
int times)
Decrements the value of the
the given number of times. |
JTextComponent |
editor(JSpinner spinner)
Returns the
used as editor in the given . |
void |
enterText(JSpinner spinner,
String text)
Enters the given text in the
, assuming its editor has a
under it. |
void |
enterTextAndCommit(JSpinner spinner,
String text)
Enters and commits the given text in the
, assuming its editor has a
under it. |
void |
increment(JSpinner spinner)
Increments the value of the
. |
void |
increment(JSpinner spinner,
int times)
Increments the value of the
the given number of times. |
void |
requireValue(JSpinner spinner,
Object value)
Verifies that the value of the
is equal to the given one. |
void |
selectValue(JSpinner spinner,
Object value)
Selects the given value in the given
. |
String |
textOf(JSpinner spinner)
Returns the text displayed in the given
. |
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisiblemove, resize, resizeHeight, resizeWidthassertIsEnabledAndShowing, 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, waitForShowingpublic JSpinnerDriver(Robot robot)
JSpinnerDriver.robot - the robot to use to simulate user input.@RunsInEDT public void increment(JSpinner spinner, int times)
JSpinner the given number of times.spinner - the target JSpinner.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 the JSpinner is disabled.IllegalStateException - if the JSpinner is not showing on the screen.@RunsInEDT public void increment(JSpinner spinner)
JSpinner.spinner - the target JSpinner.IllegalStateException - if the JSpinner is disabled.IllegalStateException - if the JSpinner is not showing on the screen.@RunsInEDT public void decrement(JSpinner spinner, int times)
JSpinner the given number of times.spinner - the target JSpinner.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 the JSpinner is disabled.IllegalStateException - if the JSpinner is not showing on the screen.@RunsInEDT public void decrement(JSpinner spinner)
JSpinner.spinner - the target JSpinner.IllegalStateException - if the JSpinner is disabled.IllegalStateException - if the JSpinner is not showing on the screen.@RunsInEDT public String textOf(JSpinner spinner)
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.spinner - the target JSpinner.JSpinner.@RunsInEDT public void enterTextAndCommit(JSpinner spinner, String text)
JSpinner, assuming its editor has a
JTextComponent under it.spinner - the target JSpinner.text - the text to enter.IllegalStateException - if the JSpinner is disabled.IllegalStateException - if the JSpinner is not showing on the screen.ActionFailedException - if the editor of the JSpinner is not a JTextComponent or
cannot be found.UnexpectedException - if entering the text in the JSpinner's editor fails.@RunsInEDT public void enterText(JSpinner spinner, String text)
JSpinner, assuming its editor has a
JTextComponent under it. This method does not commit the value to the JSpinner.spinner - the target JSpinner.text - the text to enter.IllegalStateException - if the JSpinner is disabled.IllegalStateException - if the JSpinner is not showing on the screen.ActionFailedException - if the editor of the JSpinner is not a JTextComponent or
cannot be found.UnexpectedException - if entering the text in the JSpinner's editor fails.enterTextAndCommit(JSpinner, String)@RunsInEDT public void selectValue(JSpinner spinner, Object value)
JSpinner.spinner - the target JSpinner.value - the value to select.IllegalStateException - if the JSpinner is disabled.IllegalStateException - if the JSpinner is not showing on the screen.IllegalArgumentException - if the given JSpinner does not support the given value.@RunsInEDT public JTextComponent editor(JSpinner spinner)
JTextComponent used as editor in the given JSpinner.spinner - the target JSpinner.JTextComponent used as editor in the given JSpinner.ComponentLookupException - if the given JSpinner does not have a JTextComponent as
editor.@RunsInEDT public void requireValue(JSpinner spinner, Object value)
JSpinner is equal to the given one.spinner - the target JSpinner.value - the expected value.AssertionError - if the value of the JSpinner is not equal to the given one.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.