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 AbstractButtonFixture<S,T extends AbstractButton> extends AbstractJPopupMenuInvokerFixture<S,T,AbstractButtonDriver> implements TextDisplayFixture<S>
AbstractButton
s.BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY
Constructor and Description |
---|
AbstractButtonFixture(Class<S> selfType,
Robot robot,
String buttonName,
Class<? extends T> type)
Creates a new
AbstractButtonFixture . |
AbstractButtonFixture(Class<S> selfType,
Robot robot,
T target)
Creates a new
AbstractButtonFixture . |
Modifier and Type | Method and Description |
---|---|
protected AbstractButtonDriver |
createDriver(Robot robot) |
S |
requireText(Pattern pattern)
Asserts that the text of this fixture's
AbstractButton matches the given regular expression pattern. |
S |
requireText(String expected)
Asserts that the text of this fixture's
AbstractButton matches the specified value. |
String |
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 AbstractButtonFixture(@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 AbstractButtonFixture(@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 protected AbstractButtonDriver createDriver(@Nonnull Robot robot)
createDriver
in class AbstractComponentFixture<S,T extends AbstractButton,AbstractButtonDriver>
public final String text()
text
in interface TextDisplayFixture<S>
AbstractButton
.@Nonnull public final S requireText(@Nullable String expected)
AbstractButton
matches the specified value.requireText
in interface TextDisplayFixture<S>
expected
- the text to match. It can be a regular expression.AssertionError
- if the text of the target AbstractButton
does not match the given one.@Nonnull public final S requireText(@Nonnull Pattern pattern)
AbstractButton
matches the given regular expression pattern.requireText
in interface TextDisplayFixture<S>
pattern
- the regular expression pattern to match.NullPointerException
- if the given regular expression pattern is null
.AssertionError
- if the text of the target AbstractButton
does not match the given regular expression
pattern.Copyright © 2014–2019 AssertJ. All rights reserved.