public class JListItemFixture extends Object implements ItemFixture<JListItemFixture>
JList
s.Constructor and Description |
---|
JListItemFixture(JListFixture list,
int index)
Creates a new
JListItemFixture . |
Modifier and Type | Method and Description |
---|---|
JListItemFixture |
click()
Simulates a user clicking this fixture's list item.
|
JListItemFixture |
click(MouseButton button)
Simulates a user clicking this fixture's list item.
|
JListItemFixture |
click(MouseClickInfo mouseClickInfo)
Simulates a user clicking this fixture's list item.
|
JListItemFixture |
doubleClick()
Simulates a user double-clicking this fixture's list item.
|
JListItemFixture |
drag()
Simulates a user dragging this fixture's list item.
|
JListItemFixture |
drop()
Simulates a user dropping into this fixture's list item.
|
int |
index() |
JListItemFixture |
rightClick()
Simulates a user right-clicking this fixture's list item.
|
JListItemFixture |
select()
Simulates a user selecting this fixture's list item.
|
JPopupMenuFixture |
showPopupMenu()
Shows a pop-up menu using this fixture's list item as the invoker of the pop-up menu.
|
JListItemFixture |
unselect()
Simulates a user unselecting this fixture's list item.
|
String |
value()
Returns the
String representation of the value of this fixture's list item, using the
JListCellReader from the JListFixture that created this JListItemFixture . |
public JListItemFixture(@Nonnull JListFixture list, int index)
JListItemFixture
.list
- manages the JList
containing the list item to be managed by this fixture.index
- index of the list item to be managed by this fixture.NullPointerException
- if list
is null
.@Nonnull public final JListItemFixture select()
select
in interface ItemFixture<JListItemFixture>
IllegalStateException
- if this fixture's JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.@Nonnull public final JListItemFixture unselect()
IllegalStateException
- if this fixture's JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.@Nonnull public final JListItemFixture click()
click
in interface MouseInputSimulationFixture<JListItemFixture>
IllegalStateException
- if this fixture's JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.@Nonnull public final JListItemFixture click(@Nonnull MouseButton button)
click
in interface MouseInputSimulationFixture<JListItemFixture>
button
- the button to click.NullPointerException
- if the given MouseButton
is null
.IllegalStateException
- if this fixture's JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.@Nonnull public final JListItemFixture click(@Nonnull MouseClickInfo mouseClickInfo)
click
in interface MouseInputSimulationFixture<JListItemFixture>
mouseClickInfo
- 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 JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.@Nonnull public final JListItemFixture doubleClick()
doubleClick
in interface MouseInputSimulationFixture<JListItemFixture>
IllegalStateException
- if this fixture's JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.@Nonnull public final JListItemFixture rightClick()
rightClick
in interface MouseInputSimulationFixture<JListItemFixture>
IllegalStateException
- if this fixture's JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.@Nonnull public final JPopupMenuFixture showPopupMenu()
showPopupMenu
in interface ItemFixture<JListItemFixture>
IllegalStateException
- if this fixture's JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.ComponentLookupException
- if a pop-up menu cannot be found.@Nullable public final String value()
String
representation of the value of this fixture's list item, using the
JListCellReader
from the JListFixture
that created this JListItemFixture
.value
in interface ItemFixture<JListItemFixture>
String
representation of the value of this fixture's list item.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.JListFixture.replaceCellReader(JListCellReader)
@Nonnull public final JListItemFixture drag()
drag
in interface ItemFixture<JListItemFixture>
IllegalStateException
- if this fixture's JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.@Nonnull public final JListItemFixture drop()
drop
in interface ItemFixture<JListItemFixture>
IllegalStateException
- if this fixture's JList
is disabled.IllegalStateException
- if this fixture's JList
is not showing on the screen.IndexOutOfBoundsException
- if this item's index is negative or greater than the index of the last item in
the JList
.ActionFailedException
- if there is no drag action in effect.public final int index()
Copyright © 2014–2017 AssertJ. All rights reserved.