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 AbstractJPopupMenuInvokerFixture<S,T extends JComponent,D extends JComponentDriver> extends AbstractJComponentFixture<S,T,D> implements JPopupMenuInvokerFixture
JComponent
s capable of invoking JPopupMenu
s.BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY
Constructor and Description |
---|
AbstractJPopupMenuInvokerFixture(Class<S> selfType,
Robot robot,
Class<? extends T> type)
Creates a new
AbstractJPopupMenuInvokerFixture . |
AbstractJPopupMenuInvokerFixture(Class<S> selfType,
Robot robot,
String name,
Class<? extends T> type)
Creates a new
AbstractJPopupMenuInvokerFixture . |
AbstractJPopupMenuInvokerFixture(Class<S> selfType,
Robot robot,
T target)
Creates a new
AbstractJPopupMenuInvokerFixture . |
Modifier and Type | Method and Description |
---|---|
JPopupMenuFixture |
showPopupMenu()
Shows a pop-up menu using this fixture's
JComponent 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
JComponent as the invoker of the pop-up menu. |
clientProperty, requireToolTip, requireToolTip
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 AbstractJPopupMenuInvokerFixture(@Nonnull Class<S> selfType, @Nonnull Robot robot, @Nonnull Class<? extends T> type)
AbstractJPopupMenuInvokerFixture
.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 AbstractJPopupMenuInvokerFixture(@Nonnull Class<S> selfType, @Nonnull Robot robot, @Nullable String name, @Nonnull Class<? extends T> type)
AbstractJPopupMenuInvokerFixture
.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.ComponentLookupException
- if more than one matching component is found.public AbstractJPopupMenuInvokerFixture(@Nonnull Class<S> selfType, @Nonnull Robot robot, @Nonnull T target)
AbstractJPopupMenuInvokerFixture
.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
.@Nonnull public JPopupMenuFixture showPopupMenu()
JComponent
as the invoker of the pop-up menu.showPopupMenu
in interface JPopupMenuInvokerFixture
IllegalStateException
- if Settings.clickOnDisabledComponentsAllowed()
is false
and this
fixture's JComponent
is disabled.IllegalStateException
- if this fixture's JComponent
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.@Nonnull public JPopupMenuFixture showPopupMenuAt(@Nonnull Point p)
JComponent
as the invoker of the pop-up menu.showPopupMenuAt
in interface JPopupMenuInvokerFixture
p
- the given point where to show the pop-up menu.IllegalStateException
- if Settings.clickOnDisabledComponentsAllowed()
is false
and this
fixture's JComponent
is disabled.IllegalStateException
- if this fixture's JComponent
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.Copyright © 2014–2017 AssertJ. All rights reserved.