public class JToggleButtonFixture extends ComponentFixture<JToggleButton> implements CommonComponentFixture, JComponentFixture, JPopupMenuInvokerFixture, TextDisplayFixture, TwoStateButtonFixture
JToggleButtons:
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target| Constructor and Description |
|---|
JToggleButtonFixture(Robot robot,
JToggleButton target)
Creates a new
. |
JToggleButtonFixture(Robot robot,
String toggleButtonName)
Creates a new
. |
| Modifier and Type | Method and Description |
|---|---|
JToggleButtonFixture |
check()
Checks (or selects) this fixture's
only it is not already checked. |
JToggleButtonFixture |
click()
Simulates a user clicking this fixture's
. |
JToggleButtonFixture |
click(MouseButton button)
Simulates a user clicking this fixture's
. |
JToggleButtonFixture |
click(MouseClickInfo mouseClickInfo)
Simulates a user clicking this fixture's
. |
Object |
clientProperty(Object key)
Returns the client property stored in this fixture's
, under the given key. |
JToggleButtonFixture |
doubleClick()
Simulates a user double-clicking this fixture's
. |
protected void |
driver(AbstractButtonDriver newDriver)
Sets the
to be used by this fixture. |
JToggleButtonFixture |
focus()
Gives input focus to this fixture's
. |
JToggleButtonFixture |
pressAndReleaseKey(KeyPressInfo keyPressInfo)
Simulates a user pressing given key with the given modifiers on this fixture's
. |
JToggleButtonFixture |
pressAndReleaseKeys(int... keyCodes)
Simulates a user pressing and releasing the given keys on this fixture's
. |
JToggleButtonFixture |
pressKey(int keyCode)
Simulates a user pressing the given key on this fixture's
. |
JToggleButtonFixture |
releaseKey(int keyCode)
Simulates a user releasing the given key on this fixture's
. |
JToggleButtonFixture |
requireDisabled()
Asserts that this fixture's
is disabled. |
JToggleButtonFixture |
requireEnabled()
Asserts that this fixture's
is enabled. |
JToggleButtonFixture |
requireEnabled(Timeout timeout)
Asserts that this fixture's
is enabled. |
JToggleButtonFixture |
requireFocused()
Asserts that this fixture's
has input focus. |
JToggleButtonFixture |
requireNotSelected()
Verifies that this fixture's
is not selected. |
JToggleButtonFixture |
requireNotVisible()
Asserts that this fixture's
is not visible. |
JToggleButtonFixture |
requireSelected()
Verifies that this fixture's
is selected. |
JToggleButtonFixture |
requireText(Pattern pattern)
Asserts that the text of this fixture's
matches the given regular expression
pattern. |
JToggleButtonFixture |
requireText(String expected)
Asserts that the text of this fixture's
matches the specified value. |
JToggleButtonFixture |
requireToolTip(Pattern pattern)
Asserts that the toolTip in this fixture's
matches the given regular expression
pattern. |
JToggleButtonFixture |
requireToolTip(String expected)
Asserts that the toolTip in this fixture's
matches the given value. |
JToggleButtonFixture |
requireVisible()
Asserts that this fixture's
is visible. |
JToggleButtonFixture |
rightClick()
Simulates a user right-clicking this fixture's
. |
JPopupMenuFixture |
showPopupMenu()
Shows a pop-up menu using this fixture's
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
as the invoker of
the pop-up menu. |
String |
text()
Returns the text of this fixture's
. |
JToggleButtonFixture |
uncheck()
Unchecks this fixture's
only if it is checked. |
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNullpublic JToggleButtonFixture(Robot robot, JToggleButton target)
JToggleButtonFixture.robot - performs simulation of user events on the given JToggleButton.target - the JToggleButton to be managed by this fixture.NullPointerException - if robot is null.NullPointerException - if target is null.public JToggleButtonFixture(Robot robot, String toggleButtonName)
JToggleButtonFixture.robot - performs simulation of user events on a JToggleButton.toggleButtonName - the name of the JToggleButton to find using the given Robot.NullPointerException - if robot is null.ComponentLookupException - if a matching JToggleButton could not be found.ComponentLookupException - if more than one matching JToggleButton is found.protected final void driver(AbstractButtonDriver newDriver)
AbstractButtonDriver to be used by this fixture.newDriver - the new AbstractButtonDriver.NullPointerException - if the given driver is null.public String text()
JToggleButton.text in interface TextDisplayFixtureJToggleButton.public JToggleButtonFixture check()
JToggleButton only it is not already checked.IllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.public JToggleButtonFixture uncheck()
JToggleButton only if it is checked.IllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.public JToggleButtonFixture click()
JToggleButton.click in interface MouseInputSimulationFixtureIllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.public JToggleButtonFixture click(MouseButton button)
JToggleButton.click in interface MouseInputSimulationFixturebutton - the button to click.NullPointerException - if the given MouseButton is null.IllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.public JToggleButtonFixture click(MouseClickInfo mouseClickInfo)
JToggleButton.click in interface MouseInputSimulationFixturemouseClickInfo - specifies the button to click and the times the button should be clicked.NullPointerException - if the given MouseClickInfo is null.IllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.public JToggleButtonFixture doubleClick()
JToggleButton.doubleClick in interface MouseInputSimulationFixtureIllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.public JToggleButtonFixture rightClick()
JToggleButton.rightClick in interface MouseInputSimulationFixtureIllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.public JToggleButtonFixture focus()
JToggleButton.focus in interface FocusableComponentFixtureIllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.public JToggleButtonFixture pressAndReleaseKey(KeyPressInfo keyPressInfo)
JToggleButton.
Modifiers is a mask from the available InputEvent masks.pressAndReleaseKey in interface KeyboardInputSimulationFixturekeyPressInfo - specifies the key and modifiers to press.NullPointerException - if the given KeyPressInfo is null.IllegalArgumentException - if the given code is not a valid key code.IllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.KeyPressInfopublic JToggleButtonFixture pressAndReleaseKeys(int... keyCodes)
JToggleButton.pressAndReleaseKeys in interface KeyboardInputSimulationFixturekeyCodes - one or more codes of the keys to press.NullPointerException - if the given array of codes is null.IllegalArgumentException - if any of the given code is not a valid key code.IllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.KeyEventpublic JToggleButtonFixture pressKey(int keyCode)
JToggleButton.pressKey in interface KeyboardInputSimulationFixturekeyCode - the code of the key to press.IllegalArgumentException - if any of the given code is not a valid key code.IllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.KeyEventpublic JToggleButtonFixture releaseKey(int keyCode)
JToggleButton.releaseKey in interface KeyboardInputSimulationFixturekeyCode - the code of the key to release.IllegalArgumentException - if any of the given code is not a valid key code.IllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.KeyEventpublic JToggleButtonFixture requireSelected()
JToggleButton is selected.requireSelected in interface TwoStateButtonFixtureAssertionError - if this fixture's JToggleButton is not selected.public JToggleButtonFixture requireNotSelected()
JToggleButton is not selected.requireNotSelected in interface TwoStateButtonFixtureAssertionError - if this fixture's JToggleButton is selected.public JToggleButtonFixture requireText(String expected)
JToggleButton matches the specified value.requireText in interface TextDisplayFixtureexpected - the text to match. It can be a regular expression.AssertionError - if the text of the target JToggleButton does not match the given one.public JToggleButtonFixture requireText(Pattern pattern)
JToggleButton matches the given regular expression
pattern.requireText in interface TextDisplayFixturepattern - the regular expression pattern to match.NullPointerException - if the given regular expression pattern is null.AssertionError - if the text of the target JToggleButton does not match the given regular
expression pattern.public JToggleButtonFixture requireFocused()
JToggleButton has input focus.requireFocused in interface FocusableComponentFixtureAssertionError - if this fixture's JToggleButton does not have input focus.public JToggleButtonFixture requireEnabled()
JToggleButton is enabled.requireEnabled in interface StateVerificationFixtureAssertionError - if this fixture's JToggleButton is disabled.public JToggleButtonFixture requireEnabled(Timeout timeout)
JToggleButton is enabled.requireEnabled in interface StateVerificationFixturetimeout - the time this fixture will wait for the component to be enabled.WaitTimedOutError - if this fixture's JToggleButton is never enabled.public JToggleButtonFixture requireDisabled()
JToggleButton is disabled.requireDisabled in interface StateVerificationFixtureAssertionError - if this fixture's JToggleButton is enabled.public JToggleButtonFixture requireVisible()
JToggleButton is visible.requireVisible in interface StateVerificationFixtureAssertionError - if this fixture's JToggleButton is not visible.public JToggleButtonFixture requireNotVisible()
JToggleButton is not visible.requireNotVisible in interface StateVerificationFixtureAssertionError - if this fixture's JToggleButton is visible.public JToggleButtonFixture requireToolTip(String expected)
JToggleButton matches the given value.requireToolTip in interface ToolTipDisplayFixtureexpected - the given value. It can be a regular expression.AssertionError - if the toolTip in this fixture's JToggleButton does not match the given value.public JToggleButtonFixture requireToolTip(Pattern pattern)
JToggleButton matches the given regular expression
pattern.requireToolTip in interface ToolTipDisplayFixturepattern - the regular expression pattern to match.NullPointerException - if the given regular expression pattern is null.AssertionError - if the toolTip in this fixture's JToggleButton does not match the given
regular expression.public Object clientProperty(Object key)
JToggleButton, under the given key.clientProperty in interface ClientPropertyStorageFixturekey - the key to use to retrieve the client property.null if the property was
not found.NullPointerException - if the given key is null.public JPopupMenuFixture showPopupMenu()
JToggleButton as the invoker of the pop-up menu.showPopupMenu in interface JPopupMenuInvokerFixtureIllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.ComponentLookupException - if a pop-up menu cannot be found.public JPopupMenuFixture showPopupMenuAt(Point p)
JToggleButton as the invoker of
the pop-up menu.showPopupMenuAt in interface JPopupMenuInvokerFixturep - the given point where to show the pop-up menu.IllegalStateException - if this fixture's JToggleButton is disabled.IllegalStateException - if this fixture's JToggleButton is not showing on the screen.ComponentLookupException - if a pop-up menu cannot be found.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.