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 JComponent
that this fixture can manage.D
- the type of JComponentDriver
that this fixture uses internally.public abstract class AbstractJComponentFixture<S,T extends JComponent,D extends JComponentDriver> extends AbstractComponentFixture<S,T,D> implements JComponentFixture<S>
JComponent
s.BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY
Constructor and Description |
---|
AbstractJComponentFixture(Class<S> selfType,
Robot robot,
Class<? extends T> type)
Creates a new
AbstractJComponentFixture . |
AbstractJComponentFixture(Class<S> selfType,
Robot robot,
String name,
Class<? extends T> type)
Creates a new
AbstractJComponentFixture . |
AbstractJComponentFixture(Class<S> selfType,
Robot robot,
T target)
Creates a new
AbstractJComponentFixture . |
Modifier and Type | Method and Description |
---|---|
Object |
clientProperty(Object key)
Returns the client property stored in this fixture's
JComponent , under the given key. |
S |
requireToolTip(Pattern pattern)
Asserts that the toolTip in this fixture's
JComponent matches the given regular expression pattern. |
S |
requireToolTip(String expected)
Asserts that the toolTip in this fixture's
JComponent matches the given value. |
background, click, click, click, createDriver, 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 AbstractJComponentFixture(@Nonnull Class<S> selfType, @Nonnull Robot robot, @Nonnull Class<? extends T> type)
AbstractJComponentFixture
.selfType
- the "self type."robot
- performs simulation of user events on a JComponent
.type
- the type of the JComponent
to find using the given Robot
.NullPointerException
- if robot
is null
.NullPointerException
- if type
is null
.ComponentLookupException
- if a matching component could not be found.ComponentLookupException
- if more than one matching component is found.public AbstractJComponentFixture(@Nonnull Class<S> selfType, @Nonnull Robot robot, @Nullable String name, @Nonnull Class<? extends T> type)
AbstractJComponentFixture
.selfType
- the "self type."robot
- performs simulation of user events on a JComponent
.name
- the name of the JComponent
to find using the given Robot
.type
- the type of the JComponent
to find using the given Robot
.NullPointerException
- if robot
is null
.NullPointerException
- if type
is null
.ComponentLookupException
- if a matching component could not be found. Or if more
than one matching component is found.public AbstractJComponentFixture(@Nonnull Class<S> selfType, @Nonnull Robot robot, @Nonnull T target)
AbstractJComponentFixture
.selfType
- the "self type."robot
- performs simulation of user events on the given JComponent
.target
- the JComponent
to be managed by this fixture.NullPointerException
- if robot
is null
.NullPointerException
- if target
is null
.@Nullable public final Object clientProperty(@Nonnull Object key)
JComponent
, under the given key.clientProperty
in interface JComponentFixture<S>
key
- the key to use to retrieve the client property.null
if the property was not found.NullPointerException
- if the given key is null
.@Nonnull public final S requireToolTip(@Nullable String expected)
JComponent
matches the given value.requireToolTip
in interface JComponentFixture<S>
expected
- the given value. It can be a regular expression.AssertionError
- if the toolTip in this fixture's JComponent
does not match the given value.@Nonnull public final S requireToolTip(@Nonnull Pattern pattern)
JComponent
matches the given regular expression pattern.requireToolTip
in interface JComponentFixture<S>
pattern
- the regular expression pattern to match.NullPointerException
- if the given regular expression pattern is null
.AssertionError
- if the toolTip in this fixture's JComponent
does not match the given value.Copyright © 2014–2019 AssertJ. All rights reserved.