Package org.testfx.matcher.control
Class ListViewMatchers
java.lang.Object
org.testfx.matcher.control.ListViewMatchers
TestFX matchers for
ListView
controls.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
getItemsString
(javafx.scene.control.ListView<?> listView) private static String
getPlaceHolderDescription
(javafx.scene.Node placeHolder, boolean describeVisibility) private static boolean
hasCellValue
(javafx.scene.control.Cell cell, Object value) static org.hamcrest.Matcher
<javafx.scene.control.ListView> hasItems
(int amount) Creates a matcher that matches allListView
s that have exactlyamount
items (i.e.static org.hamcrest.Matcher
<javafx.scene.control.ListView> hasListCell
(Object value) Creates a matcher that matches allListView
s that have one cell that equals the givenvalue
.private static boolean
hasListCell
(javafx.scene.control.ListView listView, Object value) private static boolean
hasPlaceholder
(javafx.scene.control.ListView listView, javafx.scene.Node placeHolder) static org.hamcrest.Matcher
<javafx.scene.control.ListView> hasPlaceholder
(javafx.scene.Node placeHolder) Creates a matcher that matchesListView
s that have the givenplaceHolder
.private static boolean
hasSelectedItem
(javafx.scene.control.ListView<?> listView, Object value) static org.hamcrest.Matcher
<javafx.scene.control.ListView> hasSelectedRow
(Object value) Creates a matcher that matchesListView
s that have the given value within their selection.private static boolean
hasVisiblePlaceholder
(javafx.scene.control.ListView listView, javafx.scene.Node placeHolder) static org.hamcrest.Matcher
<javafx.scene.control.ListView> hasVisiblePlaceholder
(javafx.scene.Node placeHolder) Creates a matcher that matchesListView
s that have the given visibleplaceHolder
.static org.hamcrest.Matcher
<javafx.scene.control.ListView> isEmpty()
Creates a matcher that matches allListView
s that have no items (i.e.
-
Field Details
-
SELECTOR_LIST_CELL
- See Also:
-
-
Constructor Details
-
ListViewMatchers
private ListViewMatchers()
-
-
Method Details
-
hasListCell
Creates a matcher that matches allListView
s that have one cell that equals the givenvalue
.- Parameters:
value
- the list cell the matched ListView's should have
-
hasItems
public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasItems(int amount) Creates a matcher that matches allListView
s that have exactlyamount
items (i.e. sizeof(ListView.getItems()
) =amount
).- Parameters:
amount
- the number of items the matched ListView's should have
-
isEmpty
public static org.hamcrest.Matcher<javafx.scene.control.ListView> isEmpty()Creates a matcher that matches allListView
s that have no items (i.e. sizeof(ListView.getItems()
) = 0). -
hasPlaceholder
public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasPlaceholder(javafx.scene.Node placeHolder) Creates a matcher that matchesListView
s that have the givenplaceHolder
. As a special case if theplaceHolder
is an instance ofLabeled
then the placeholder matches if the givenplaceHolder
's text is equal to the ListView's text.- Parameters:
placeHolder
- the placeHolderNode
the matched ListView's should have
-
hasVisiblePlaceholder
public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasVisiblePlaceholder(javafx.scene.Node placeHolder) Creates a matcher that matchesListView
s that have the given visibleplaceHolder
. As a special case if theplaceHolder
is an instance ofLabeled
then the placeholder matches if the givenplaceHolder
's text is equal to the ListView's text and the ListView's placeHolder is visible.- Parameters:
placeHolder
- the visible placeHolderNode
the matched ListView's should have
-
hasSelectedRow
Creates a matcher that matchesListView
s that have the given value within their selection.- Parameters:
value
- the value placeHolderT
the matched ListView's should have
-
hasSelectedItem
-
hasListCell
-
hasCellValue
-
hasPlaceholder
private static boolean hasPlaceholder(javafx.scene.control.ListView listView, javafx.scene.Node placeHolder) -
hasVisiblePlaceholder
private static boolean hasVisiblePlaceholder(javafx.scene.control.ListView listView, javafx.scene.Node placeHolder) -
getItemsString
-
getPlaceHolderDescription
private static String getPlaceHolderDescription(javafx.scene.Node placeHolder, boolean describeVisibility)
-