S
- used to simulate "self types." For more information please read "Emulating 'self types' using Java Generics to simplify fluent API implementation."T
- the type of AbstractButton
that this fixture can manage.public abstract class AbstractTwoStateButtonFixture<S,T extends AbstractButton> extends AbstractButtonFixture<S,T>
AbstractButton
s that have 2 states ("checked" and "unchecked.")BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY
Constructor and Description |
---|
AbstractTwoStateButtonFixture(Class<S> selfType,
Robot robot,
String buttonName,
Class<? extends T> type)
Creates a new
AbstractButtonFixture . |
AbstractTwoStateButtonFixture(Class<S> selfType,
Robot robot,
T target)
Creates a new
AbstractButtonFixture . |
Modifier and Type | Method and Description |
---|---|
S |
check()
Checks (or selects) this fixture's
AbstractButton only it is not already checked. |
S |
check(boolean checked)
Checks (or unchecks) this fixture's
AbstractButton according to the checked parameter. |
S |
requireArmed()
Verifies that this fixture's
AbstractButton is armed. |
S |
requireArmed(boolean armed)
Verifies that this fixture's
AbstractButton armed state is equal to the armed parameter. |
S |
requireNotArmed()
Verifies that this fixture's
AbstractButton is not armed. |
S |
requireNotSelected()
Verifies that this fixture's
AbstractButton is not selected. |
S |
requireSelected()
Verifies that this fixture's
AbstractButton is selected. |
S |
requireSelected(boolean selected)
Verifies that this fixture's
AbstractButton selection state is equal to the selected
parameter. |
S |
uncheck()
Unchecks this fixture's
AbstractButton only if it is checked. |
createDriver, requireText, requireText, text
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 AbstractTwoStateButtonFixture(@Nonnull Class<S> selfType, @Nonnull Robot robot, @Nonnull T target)
AbstractButtonFixture
.selfType
- the "self type."target
- the JButton
to be managed by this fixture.robot
- performs simulation of user events on the given AbstractButton
.NullPointerException
- if robot
is null
.NullPointerException
- if target
is null
.public AbstractTwoStateButtonFixture(@Nonnull Class<S> selfType, @Nonnull Robot robot, @Nullable String buttonName, @Nonnull Class<? extends T> type)
AbstractButtonFixture
.selfType
- the "self type."robot
- performs simulation of user events on a AbstractButton
.buttonName
- the name of the AbstractButton
to find using the given RobotFixture
.type
- the type of the AbstractButton
to find using the given Robot
.NullPointerException
- if robot
is null
.NullPointerException
- if type
is null
.ComponentLookupException
- if a matching AbstractButton
could not be
found. Or if more than one matching AbstractButton
is found.@Nonnull public final S check(boolean checked)
AbstractButton
according to the checked
parameter.checked
- true
if the AbstractButton
should be checked.IllegalStateException
- if this fixture's AbstractButton
is disabled.IllegalStateException
- if this fixture's AbstractButton
is not showing on the screen.@Nonnull public final S check()
AbstractButton
only it is not already checked.IllegalStateException
- if this fixture's AbstractButton
is disabled.IllegalStateException
- if this fixture's AbstractButton
is not showing on the screen.@Nonnull public final S uncheck()
AbstractButton
only if it is checked.IllegalStateException
- if this fixture's AbstractButton
is disabled.IllegalStateException
- if this fixture's AbstractButton
is not showing on the screen.@Nonnull public final S requireSelected(boolean selected)
AbstractButton
selection state is equal to the selected
parameter.selected
- true
if the AbstractButton
must be selected.AssertionError
- if the AbstractButton
managed by this fixture is not selected.@Nonnull public final S requireSelected()
AbstractButton
is selected.AssertionError
- if the AbstractButton
managed by this fixture is not selected.@Nonnull public final S requireNotSelected()
AbstractButton
is not selected.AssertionError
- if the AbstractButton
managed by this fixture is selected.@Nonnull public final S requireArmed(boolean armed)
AbstractButton
armed state is equal to the armed
parameter.armed
- true
if the AbstractButton
must be armed.AssertionError
- if the AbstractButton
managed by this fixture is not armed.@Nonnull public final S requireArmed()
AbstractButton
is armed.AssertionError
- if the AbstractButton
managed by this fixture is not armed.@Nonnull public final S requireNotArmed()
AbstractButton
is not armed.AssertionError
- if the AbstractButton
managed by this fixture is armed.Copyright © 2014–2019 AssertJ. All rights reserved.